xil_lookup_set_values(3)
NAME
xil_lookup_set_values, xil_lookup_get_values − set and get values in a lookup table
SYNOPSIS
#include <xil/xil.h>
void xil_lookup_set_values ( XilLookup lookup,
short start,
unsigned int num_values,
void ∗data);
void xil_lookup_get_values ( XilLookup lookup,
short start,
unsigned int num_values,
void ∗data);
DESCRIPTION
xil_lookup_set_values () sets the specified values in the lookup table to those in data. The version number of the lookup table is updated whenever this is done.
xil_lookup_get_values () copies num_values lookup table values into the user-supplied buffer data. start is the table entry position at which to begin reading values. The user is responsible for allocating and freeing the buffer. The example below shows how big to make the buffer.
ERRORS
For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide.
EXAMPLES
Get a sequence of data values out of a lookup table containing XIL_SHORT data values, and add 1 to each entry:
XilLookup table;
unsigned int count, buf_size, i, j, output_nbands;
short start;
void∗ buffer;
xil_signed_16∗ pixel_ptr;
/∗ extract 100 entries starting at the 42nd value in the table /∗
/∗ (assumes a table offset of 0 )∗/
count = 100; start = 42;
/∗ determine how big to make the values buffer (assume XIL_SHORT datatype) ∗/
output_nbands = xil_lookup_get_output_nbands (table);
buf_size = output_nbands ∗ count ∗ sizeof(Xil_signed16);
/∗ allocate the values buffer ∗/
buffer = (void ∗) malloc (buf_size);
/∗ get the current values in the lookup table ∗/
xil_lookup_get_values (table, start, count, buffer);
/∗ increment all the extracted values by 1 ∗/
pixel_ptr = (Xil_signed16 ∗) buffer;
for (i = 0; i < count; i++)
for (j = 0; j < output_nbands; j++) {
∗pixel_ptr += 1;
pixel_ptr++;
}
/∗ replace the values in the lookup table ∗/
xil_lookup_set_values (table, start, count, buffer);
NOTES
These functions cannot be used on combined lookup tables.
SEE ALSO
xil_lookup_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_lookup_get_version(3).
SunOS 5.6 — Last change: 29 March 1994