XieDither(3X) — Subroutines
Digital
NAME
XieDither − This routine creates a dithered copy of a source image.
C Format
dst_photo_id = XieDither(src_id, levels)
C Argument Information
XiePhoto dst_photo_id;
XiePhoto src_id;
unsigned long ∗levels;
RETURN VALUES
If the source image is an unbound photomap, the routine returns the identifier of the newly created image in the dst_photo_id argument. Otherwise, the routine returns the identifier of the photoflo to which the processing element is appended. You can free the photomap using the XieFreeResource routine.
PARAMETERS
src_idThe src_id argument specifies the source image. If the source image is an unbound photomap, the operation is performed immediately. Otherwise, the processing element is appended to the specified photoflo with execution pending a call to the XieExecuteFlo routine. The photoflo is specified explicitly if the source image is a photoflo, or implicitly if the source image is a photomap or phototap bound to the photoflo.
levelsThe levels argument specifies the address of an array containing the maximum number of output levels for each component of the dithered image. For example, to dither a gray scale image down to a bitonal image, the array entry would be levels[0] = 2; and to dither a multispectral image to 8 bits per pixel the array entries can be levels[0]=3, levels[1]=3, and levels[3]=2. If you specify a null value, the routine uses a default of 2 levels per component. Dithering to 1 level results in a value of 0 for all pixels in the component.
DESCRIPTION
This routine creates a dithered copy of a source image.
If the operation is performed immediately and you selected computation events using the XieSelectEvents routine, an XieK_ComputationEvent is added to the X11 event queue when the routine is completed.
XIE Events and Error Messages
Protocol Messages: X_ieDither
XIE event returned: XieK_ComputationEvent if immediate execution and computation events are selected
XieLib errors: None
XieServer errors: BadIDChoice -- Invalid identifier
BadAlloc -- Insufficient server resources
BadMatch -- The source image is not constrained or the levels argument is greater than the levels in the source image
BadValue -- The levels argument is 0 or negative