xil_colorcube_create(3)
NAME
xil_colorcube_create, xil_lookup_get_colorcube, xil_lookup_get_colorcube_info − operations on lookup tables used as colormap attributes of images
SYNOPSIS
#include <xil/xil.h>
XilLookup xil_colorcube_create ( XilSystemState State,
XilDataType input_type,
XilDataType output_type,
unsigned int nbands,
short offset,
int multipliers[],
unsigned int dimensions[]);
Xil_boolean xil_lookup_get_colorcube ( XilLookup lookup);
Xil_boolean xil_lookup_get_colorcube_info ( XilLookup lookup,
int ∗multipliers,
unsigned int ∗dimensions,
short ∗origin);
DESCRIPTION
xil_colorcube_create () creates a lookup table that represents a colorcube. input_type is the data type of the input (either XIL_BIT, XIL_BYTE, or XIL_SHORT). output_type is the data type of the output (either XIL_BIT, XIL_BYTE, XIL_SHORT or XIL_FLOAT). nbands is the number of bands of the colorcube. offset is the index of the first entry of the colorcube. multipliers is the distance between each color level in each dimension of the colorcube. These can be negative numbers to indicate decreasing color ramps rather than increasing color ramps. dimensions is a list of the sizes of each side of the colorcube.
xil_lookup_get_colorcube () returns TRUE or FALSE, depending on whether the specified lookup table was created as a colorcube.
xil_lookup_get_colorcube_info () returns TRUE or FALSE, depending on whether the specified lookup table was created as a colorcube. It also returns the multipliers , dimensions and origin for the colorcube. The dimension of the arrays multipliers and dimensions is nbands . The arrays must be allocated by the user/application. The pointers to multipliers , dimensions and origin may be NULL if the information is not needed.
origin is the index of the origin of the colorcube. In most cases, this should be the black pixel. If the origin is used as the starting index, then the multipliers can be used whether they have positive or negative values. The pointer may be NULL if the origin is not needed.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Create an RGB colorcube with 4 shades of blue, 9 shades of green, and 6 shades of red that starts at index 16. When incrementing through the colors, blue changes most quickly, followed by greens, and then red.
static unsigned int dimensions[3] = { 4, 9, 6 };
static int multipliers[3] = { 1, 4, 36 };
xil_create_colorcube(State, XIL_BYTE, XIL_BYTE,
3, 16, multipliers, dimensions);
NOTES
A colorcube does not have to be three dimensional. It can have any number of dimensions. This makes it possible to have a colorcube for any color space.
Because the functions xil_ordered_dither(3), xil_nearest_color(3), and xil_error_diffusion(3) effectively push data backwards through a lookup table, the output of the colorcube must match the input to these functions, and the input of the colorcube must match the output of these functions.
XIL also supplies some "common" colorcubes via xil_lookup_get_by_name(3).
SEE ALSO
xil_lookup_convert(3), xil_lookup_create(3), xil_lookup_create_copy(3), xil_lookup_destroy(3), xil_lookup_get_by_name(3), xil_lookup_set_values(3).
SunOS 5.6 — Last change: 04 August 1993