IBS_ENCODE(3X) — NEWS-OS Programmer’s Manual
NAME
ibs_encode, ibs_decode − Functions for handling change-point arrays
SYNOPSIS
int ibs_encode(arg, imgadr, iw, w, x, sline, flag)
int arg;
char ∗imgadr;
int iw, w, x;
int ∗sline;
int flag;
int ibs_decode(arg, imgadr, iw, w, x, sline, flag)
int arg;
char ∗imgadr;
int iw, w, x;
int ∗sline;
int flag;
DESCRIPTION
ibs_encode converts a line of an image expressed as imgadr, iw, wand x values into a change-point array which is the internal data expression of the bitonal image library and stores it in the area designated by sline.
The image width (in dots) for the image data is specified using iw. The setting must be a multiple of 16.
The unused portion at the left side of the line designated by iw is specified in dots as x.
The value of w specifies the length of the portion of the line designated by iw that will actually contain the change-point array. The value for sline must be an area of ( w + 2 ) ∗ 4 bytes or greater.
arg,flag is ignored.
ibs_decode stores a portion of image data w dots long from the change-point array designated by sline, starting at a point x dots after the left edge of the area designated by imgadr.
imgadr must be equal to an area of iw / 8 or greater.
flag is masked by 0xf00 and can have the following meanings.
0x0000No changes to sections where there is no image data.
0x0100Fill sections where there is no image data with white.
0x0200Fill sections where there is no image data with black.
In any case, ( x + w ) must not exceed iw.
No checks are performed within the functions on the values of arguments. It is therefore necessary to check arguments before calling the above functions.
Change-point Array
The term “change-point” refers to points where the color of a pixel (white = 0, black = 1) differs from that of the preceding one, as the line is scanned from left to right. The way these change-points are arranged is the “change-point array.”
The range of values is 0 to w, increasing as one proceeds from left to right.
In addition, a virtual change-point is considered to exist following the last actual pixel on the line.
Example
0 1 2 3 4 5 6 7 8
W B W W B B B W Change-point array: 1,2,4,7,8
B B W B B W B B Change-point array: 0,2,3,5,6,8
RETURN VALUE
Always 0.
FILES
/usr/sony/lib/libibs.a
SEE ALSO
ibs_compress(3X) ibs_expand(3X) ibs_zoom(3X)
NEWS-OSRelease 4.1C