xil_ordered_dither(3)
NAME
xil_ordered_dither − use ordered dithering to convert a multiband or single-band image into a single-band image with a colormap
SYNOPSIS
#include <xil/xil.h>
void xil_ordered_dither(XilImage src,
XilImage dst,
XilLookup cmap,
XilDitherMask mask)
DESCRIPTION
This routine performs an ordered dithering of a src (source) image with dither matrices and produces a single-band dst (destination) image. cmap is a lookup table and must be a colorcube. mask is a dither mask and must contain n matrices for an n-band source image. These matrices must have the same dimensions and contain floating point values between 0.0 and 1.0.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Ordered-dither a 3-band image into a single-band image using a 4x4 dither mask:
XilImage src;/∗ 3-band source image ∗/
XilImage dst;/∗ 1-band destination image ∗/
XilLookup colormap;/∗ colorcube ∗/
XilDitherMask dithermask;/∗ 3 dither matrices ∗/
float data[]= {0.0, 0.5, 0.125, 0.625,
0.75, 0.25, 0.875, 0.375,
0.1875, 0.6875, 0.0625, 0.5625,
0.9375, 0.4375, 0.8125, 0.3125,
0.0, 0.5, 0.125, 0.625,
0.75, 0.25, 0.875, 0.375,
0.1875, 0.6875, 0.0625, 0.5625,
0.9375, 0.4375, 0.8125, 0.3125,
0.0, 0.5, 0.125, 0.625,
0.75, 0.25, 0.875, 0.375,
0.1875, 0.6875, 0.0625, 0.5625,
0.9375, 0.4375, 0.8125, 0.3125};
dithermask = xil_dithermask_create(State, 4, 4, 3, data);
xil_ordered_dither(src, dst, colormap, dithermask);
NOTES
In-place operations can occur when converting a single-band image into a single-band image of the same data type with a colormap.
SEE ALSO
xil_dithermask_create(3), xil_lookup_create_copy(3), xil_lookup_destroy(3), xil_lookup_get_input_datatype(3), xil_lookup_get_num_entries(3), xil_lookup_get_offset(3), xil_lookup_get_output_datatype(3), xil_lookup_get_output_nbands(3), xil_lookup_set_offset(3), xil_lookup_convert(3), xil_colorcube_create(3), xil_lookup_get_colorcube(3), xil_lookup_get_colorcube_info(3).
SunOS — Last change: 16 August 1993