xil_lookup_create_combined(3)
NAME
xil_lookup_create_combined − create combined lookup tables
SYNOPSIS
#include <xil/xil.h>
XilLookup xil_lookup_create_combined ( XilSystemState State,
XilLookup lookup_list[],
unsigned int num_lookups)
DESCRIPTION
xil_lookup_create_combined () creates a combined lookup table. A combined lookup table is used for transforming multiband data to multiband data. Compare this function with xil_lookup_create(3), which converts single-band data to single-band or multiband data.
Combined lookups are a combination of n single lookup tables, where n is the number of bands in the input image you want to convert. Each single lookup must be a 1-band to 1-band lookup table; the tables must all have the same data type, but each can use a different offset.
To create a lookup table for a multiband input image, you call xil_lookup_create (3) once for each band in the input image, then combine the single lookup tables into a combined lookup table by calling xil_lookup_create_combined ().
xil_lookup_create_combined () returns a handle to a data structure of type XilLookup, which is the combined lookup. The parameter State is a handle to the system-state data structure created when you initialize the XIL library, lookup_list[] is an array of type XilLookup that stores the single lookup tables created for each of the input image’s bands, and num_lookups indicates how many lookup tables are stored in the lookup_list[] array.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Create a combined lookup table for converting a 24-bit color image to another 24-bit color image whose green band is accented but whose red and blue bands are subdued:
XilSystemState State;
XilLookup lookup_tables[3];
XilLookup combined_lookup_table;
Xil_unsigned8 red[256];/∗ red component of lookup ∗/
Xil_unsigned8 green[256];/∗ green component of lookup ∗/
Xil_unsigned8 blue[256];/∗ blue component of lookup ∗/
int i;
for(i=0; i<256; i++) {
green[i] = (i + 20) < 255 ? i + 20 : 255;
blue[i] = red[i] = (i - 10) < 0 ? 0 : i - 10;
}
lookup_tables[0] = xil_lookup_create(State, XIL_BYTE, XIL_BYTE,
1, 256, 0, red);
lookup_tables[1] = xil_lookup_create(State, XIL_BYTE, XIL_BYTE,
1, 256, 0, green);
lookup_tables[2] = xil_lookup_create(State, XIL_BYTE, XIL_BYTE,
1, 256, 0, blue);
combined_lookup_table = xil_lookup_create_combined(State,
lookup_tables, 3);
SEE ALSO
xil_lookup(3), xil_lookup_create(3), xil_lookup_convert(3), xil_lookup_get_band_lookup(3), xil_lookup_get_input_nbands(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_get_colorcube(3), xil_lookup_set_offset(3), xil_lookup_get_colorcube_info(3), xil_lookup_set_values(3).
SunOS 5.6 — Last change: 16 March 1994