/**************************************************************/ /* */ /* prepare_colormap - Prepare the client_data structure. */ /* The client_data structure */ /* communicates pixel data between the */ /* SE_stream_execute function and your */ /* callback function. */ /* */ /* arguments: */ /* */ /* client_data - Pointer to the */ /* client data */ /* structure. */ /* pixel_type - The pixel bit depth. */ /* pixelwidth - The width of the image */ /* specified in pixels. */ /* filename - The name of the BSQ file. */ /* */ /**************************************************************/ void prepare_colormap ( SE_COLORMAP_TYPE *colormap_type, SE_COLORMAP_DATA_TYPE *colormap_data_type, LONG *num_colormap_entries, UCHAR *colormap_data) { LONG i; /* Create an 8-bit RedGreenBlue colormap with 256 entries. */ *colormap_type = SE_COLORMAP_RGB; *colormap_data_type = SE_COLORMAP_DATA_BYTE; *num_colormap_entries = 256; /* Populate the the RGB color map a range of data from */ /* black (0,0,0) to white (256,256,256). */ for (i=0; i<256; i++) { /* Red */ colormap_data[3*i] = (UCHAR)i; /* Green */ colormap_data[(3*i)+1] = (UCHAR)(256-i); /* Blue */ colormap_data[(3*i)+2] = (UCHAR)(256%i); } return; } /* prepare_colormap */