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_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_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_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_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];
DESCRIPTION
The bitonal image library libibs.a consists of low level functions for processing bitonal image data in the following ways.
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 operation 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_expand− G4 decompression
ibs_ib_zoom− Enlargement/reduction
ibs_ib_rotate− Rotation
ibs_ib_trans− Rectangular area transfer
ibs_ib_mirror− Mirror image processing
ibs_ib_set_filttable− Preparation for filter processing
ibs_ib_filt− Filter processing
FILES
/usr/sony/demo/libibs/bin/ibsdemoDemo program
/usr/sony/demo/libibs/src/∗Source code for demo program
RELATED INFORMATION
ibsdemo(1) ibs_compress(3X) ibs_expand(3X) ibs_getioerror(3X) ibs_zoom(3X) ibs_code(3X) ibs_rotate(3X) ibs_trans(3X) ibs_mirror(3X) ibs_filter(3X)
NEWS-OS 4.0 Manual Set PROGRAMMERS’ GUIDE “Image Board Library”
NEWS-OS 4.1 Manual Set PROGRAMMERS’ GUIDE “Bitonal Image Library”
NEWS-OSRelease 4.1C