Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ libibs(3X) — NEWS-os 4.2.1R

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ibsdemo(1)

ibs_compress(3X)

ibs_expand(3X)

ibs_getioerror(3X)

ibs_2dzoom(3X)

ibs_zoom(3X)

ibs_code(3X)

ibs_rotate(3X)

ibs_trans(3X)

ibs_mirror(3X)

ibs_filter(3X)

LIBIBS(3X)  —  NEWS-OS Programmer’s Manual

NAME

libibs − description of /usr/sony/lib/libibs.a bitonal image library

SYNOPSIS

BITONAL IMAGE COMPRESSION
ibs_compress_open(iw, x, w, flag, mode, work, inf, inarg,
outf, outarg, outbuf, outsize)
int ∗work;
int (∗inf)();
char ∗outbuf;
int (∗outf)();
 ibs_mhcompress(imgadr, work)
char ∗imgadr;
int ∗work;
 ibs_mrcompress(imgadr, work)
char ∗imgadr;
int ∗work;
ibs_put1d_eol(work)
int ∗work;
 ibs_put2d_eol(next, work)
int ∗work;
 ibs_put_fill(n, work)
int ∗work;
 ibs_put1d_rtc(work)
int ∗work;
 ibs_put2d_rtc(work)
int ∗work;
 ibs_put_eofb(work)
int ∗work;
ibs_comp_flush(work)
int ∗work;
 ibs_comp_align(work)
int ∗work;
 ibs_comp_getworksize(w, flag, mode)
DECOMPRESSION OF COMPRESSED BITONAL IMAGES
ibs_g3expand1d_open(iw, x, w, flag, work,
inf, inarg, inbuf, inbufsize, outf, outarg)
int ∗work;
int (∗inf)();
char ∗inbuf;
int (∗outf)();
ibs_g3expand1d(imgadr, work)
char ∗imgadr;
int ∗work;
ibs_skip1d(work, pnbyte)
int ∗work;
int ∗pnbyte;
ibs_g3expand2d_open(iw, x, w, flag, work,
inf, inarg, inbuf, inbufsize, outf, outarg)
int ∗work;
int (∗inf)();
char ∗inbuf;
int (∗outf)();
 ibs_g3expand2d(imgadr, work)
char ∗imgadr;
int ∗work;
ibs_skip2d(work, pnbyte)
int ∗work;
int ∗pnbyte;
ibs_expandtiff_open(iw, x, w, flag, work,
inf, inarg, inbuf, inbufsize, outf, outarg)
int ∗work;
int (∗inf)();
char ∗inbuf;
int (∗outf)();
 ibs_expandtiff(imgadr, work)
char ∗imgadr;
int ∗work;
ibs_g4expand_open(iw, x, w, flag, work,
inf, inarg, inbuf, inbufsize, outf, outarg)
int ∗work;
int (∗inf)();
char ∗inbuf;
int (∗outf)();
 ibs_g4expand(imgadr, work)
char ∗imgadr;
int ∗work;
ibs_exp_getworksize(w, flag, mode)
BITONAL IMAGE MAGNIFICATION AND REDUCTION
ibs_2drzoom_open(iniw, inx, inw, inrh, outiw, outx, outw, outrh,
flag, mode, work, inf, inarg, outf, outarg)
int ∗work;
int (∗inf)();
int (∗outf)();
 ibs_2drzoom(c, inimgadr, outimgadr, work)
char ∗inimgadr, ∗outimgadr;
int ∗work;
 ibs_2dzoom_open(iniw, inx, inw, inh, outiw, outx, outw, outh,
flag, mode, work, inf, inarg, outf, outarg)
int ∗work;
int (∗inf)();
int (∗outf)();
 ibs_2dzoom(inimgadr, outimgadr, work)
char ∗inimgadr, ∗outimgadr;
int ∗work;
 ibs_1dzoom_open(iniw, inx, inw, outiw, outx, outw,
flag, mode, work, inf, inarg, outf, outarg)
int ∗work;
int (∗inf)();
int (∗outf)();
 ibs_1dzoom(inimgadr, outimgadr, work)
char ∗inimgadr, ∗outimgadr;
int ∗work;
 ibs_zoom_open(iniw, inx, inw, outiw, outx, outw,
flag, mode, work, inf, inarg, outf, outarg)
int ∗work;
int (∗inf)();
int (∗outf)();
 ibs_zoom(inimgadr, outimgadr, work)
char ∗inimgadr, ∗outimgadr;
int ∗work;
 ibs_2dzoom_getworksize(iniw, inw, outiw, outw, flag, mode)
 ibs_zoom_getworksize(inw, outw, flag, mode)
BITONAL IMAGE ROTATION
int ibs_rotate(deg, sadr, siw, sx, sy, w, h,
dadr, diw, dx, dy)
char ∗sadr, ∗dadr;
BITONAL IMAGE RECTANGULAR AREA TRANSFER AND MIRROR IMAGE PROCESSING
int ibs_trans(rop, sadr, siw, sx, sy, w, h,
dadr, diw, dx, dy)
char ∗sadr, ∗dadr;
int ibs_mirror(rop, sadr, siw, sx, sy, w, h,
dadr, diw, dx, dy)
char ∗sadr, ∗dadr;
BITONAL IMAGE FILTER FUNCTIONS
int ibs_filter(table, sadr, siw, sx, sy, w, h,
dadr, diw, dx, dy)
char table[64];
char ∗sadr, ∗dadr;
OTHER FUNCTIONS
int ibs_encode(outarg, imgadr, iw, w, x, sline, flag)
char ∗imgadr;
int ∗sline;
 int ibs_decode(outarg, imgadr, iw, w, x, sline, flag)
char ∗imgadr;
int ∗sline;
 ibs_getioerror(work)
int ∗work;
IMAGE BOARD LIBRARY SIMULATION
#include <newsiop/ib.h>
 IBS_ib_compress(cep)struct _ibcep_param ∗cep;
IBS_ib_expand(cep)struct _ibcep_param ∗cep;
IBS_ib_zoom(lic, mode)struct _iblic_param ∗lic; int mode;
IBS_ib_rotate(lic, angle)struct _iblic_param ∗lic; int angle;
IBS_ib_trans(lic)struct _iblic_param ∗lic;
IBS_ib_mirror(lic)struct _iblic_param ∗lic;
IBS_ib_filt(lic)struct _iblic_param ∗lic;
IBS_ib_set_filttable(n, table) int n; unsigned char table[64];
 ibs_ib_compress(cep)struct _ibcep_param ∗cep;
ibs_ib_expand(cep)struct _ibcep_param ∗cep;
ibs_ib_zoom(lic, mode)struct _iblic_param ∗lic; int mode;
ibs_ib_rotate(lic, angle)struct _iblic_param ∗lic; int angle;
ibs_ib_trans(lic)struct _iblic_param ∗lic;
ibs_ib_mirror(lic)struct _iblic_param ∗lic;
ibs_ib_filt(lic)struct _iblic_param ∗lic;
ibs_ib_set_filttable(n, table) int n; unsigned char table[64];

DESCRIPTION

The bitonal image library, libibs.a, consists of low level functions for processing bitonal image data such as follows:

• Compression/decompression (G3/G4)
• Expansion/reduction (integer/integer)
• Rotation (90/180/270 degrees)
• Mirror image processing
• Rectangular area transfer
• Filter processing (edge extraction, etc.)

For details, refer to the individual online manuals. 

DATA STRUCTURE

A description of the structure of the image data in the bitonal image library follows. 

Bit image expression
If each line of image data is viewed as a row of bytes, the addresses increase as one proceeds to the right. The line at the bottom has the highest addresses.
The image data within each byte is arranged with the MSB (Most Significant Bit) at the far left.
When the data is decompressed, dots corresponding to bits with a value of 0 are white, and dots corresponding to bits with a value of 1 are black.

Rectangular area expression
In the bitonal image library, a set of six variables is used to express rectangular areas: adr (starting address), iw (image width), x, y, w (width) and h (height).  In addition, a set of four variables is used to express an area consisting of a single line: adr, iw, x and w.
The adr position defines to the top left-hand corner and iw the bit plane. The horizontal (X) axis goes from left to right and the vertical (Y) axis from top to bottom (moving from lower to higher addresses in both cases), creating a regular grid of coordinates.  Using this grid of coordinates as a basis, the rectangular area is expressed by the bit offsets (x, y) from the MSB (0,0) of adr, the width w and the height h.  All values are expressed in dots. 
Some bitonal image library functions carry the limitations that the starting address (adr) must be an even number and iw must be a multiple of 16. 

IMAGE BOARD LIBRARY SIMULATIONS

The following functions are also provided.  They simulate capabilities (from the image board library) which were previously provided in hardware (image board NWB-242/243). 
These functions are compatible with the corresponding functions in the image board library with the exception as follows: "board address" in the bitonal image library does not means the address on the image board but address in process.

IBS_ib_compress− G4 compression
ibs_ib_compress− G4 compression
IBS_ib_expand− G4 decompression
ibs_ib_expand− G4 decompression
IBS_ib_zoom− Enlargement/reduction
ibs_ib_zoom− Enlargement/reduction
IBS_ib_rotate− Rotation
ibs_ib_rotate− Rotation
IBS_ib_trans− Rectangular area transfer
ibs_ib_trans− Rectangular area transfer
IBS_ib_mirror− Mirror image processing
ibs_ib_mirror− Mirror image processing
IBS_ib_set_filttable− Preparation for filter processing
ibs_ib_set_filttable− Preparation for filter processing
IBS_ib_filt− Filter processing
ibs_ib_filt− Filter processing

IBS_ib_rotate rotate counter to ibs_ib_rotate. 
The result of using IBS_ib_zoom is nearer to that of using the imageboard than using ibs_ib_zoom. 
The other functions named begin with IBS_ib are the same as the functions named begin with ibs_ib.

FILES

/usr/sony/demo/libibs/bin/ibsdemo Demo program

/usr/sony/demo/libibs/src/∗ Source code for demo program

SEE ALSO

ibsdemo(1), ibs_compress(3X), ibs_expand(3X), ibs_getioerror(3X), ibs_2dzoom(3X), ibs_zoom(3X), ibs_code(3X), ibs_rotate(3X), ibs_trans(3X), ibs_mirror(3X), ibs_filter(3X)
Chapter "Image Board Library" in NEWS-OS 4.0 Manual Set Programmer’s Guide. 
Chapter "Bitonal Image Library" in NEWS-OS 4.1 Manual Sub Set Programmer’s Guide. 

NEWS-OSRelease 4.2.1R

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026