Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ xil_lookup_set_name(3) — SunOS 5.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

xil_open(3)

xil_lookup_create(3)

xil_lookup_create_combined(3)

xil_lookup_get_by_name(3)

NAME

xil_lookup_get_by_name, xil_lookup_get_name, xil_lookup_set_name − get and set a lookup table name and get a handle to a lookup table by specifying its name

SYNOPSIS

#include <xil/xil.h>

XilLookup xil_lookup_get_by_name (XilSystemState State,

char ∗name);

char∗ xil_lookup_get_name (XilLookup lookup);

void xil_lookup_set_name (XilLookup lookup,

char ∗name);

DESCRIPTION

Use these functions to assign names to lookup tables, retrieve lookup tables by name, and get the handle of a lookup table by specifying its name. Some predefined lookup tables are created at the time of an xil_open(3) call.  These lookup tables can be retrieved by xil_lookup_get_by_name ().

xil_lookup_get_by_name () returns the handle to the lookup table with the specified name name.  If such a lookup table does not exist, NULL is returned.  xil_lookup_get_by_name () does not make a copy of the lookup table.

xil_lookup_get_name () returns a copy of the specified lookup table’s name.  A call to free (3) should be used to free the space allocated by xil_lookup_get_name (). If the specified lookup table has no name, NULL is returned.

xil_lookup_set_name () sets the name of the specified lookup table name. 

Standard Lookup Tables Provided

The XIL library creates several predefined lookup tables at the time of an xil_open(3) call.  The names of these lookup tables and their suggested uses follow. 

Lookup Table Name Suggested Use

"yuv_to_rgb" RGB lookup table for displaying 8:5:5 dithered YCC data

"cc855" A good colorcube for dithering YCC data into 200 colors.  This lookup table is created with an offset of 54. 

"cc496" A good colorcube for dithering RGB data into 216 colors.  This lookup table is created with an offset of 38. 

ERRORS

For a complete list of XIL error messages by number, consult Appendix B of the XIL Programmer’s Guide. 

EXAMPLES

Create an inverse 8-bit lookup table named "invert":

XilSystemState State;
XilLookup lookup;
int i;
unsigned char data[256];
for (i=0; i<256; i++) data[i] = 255 - i;
lookup = xil_lookup_create(State,XIL_BYTE,XIL_BYTE,1,256,0,data);
xil_lookup_set_name(lookup,"invert");

Use a lookup table named "invert" to remap an image:

XilSystemState State;
XilImage src, dst;
XilLookup lookup;
lookup = xil_lookup_get_by_name(State,"invert");
xil_lookup(src, dst, lookup);

NOTES

The set of standard objects is generated for each instantiation of an XilSystemState.  If these standard objects are deleted, they become unavailable for the duration of the current XIL session. 

If you give two lookup tables the same name, it is not defined which lookup table will be retrieved by a call to xil_lookup_get_by_name ().

SEE ALSO

xil_open(3), xil_lookup_create(3), xil_lookup_create_combined(3). 

SunOS 5.6  —  Last change: 29 March 1994

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026