[ prev :: next :: up ] libggi-current (3)

Convert from ggi_color(s) to ggi_pixel(s) and vice versa

Name

ggiMapColor, ggiUnmapPixel, ggiPackColors, ggiUnpackPixels : Convert from ggi_color(s) to ggi_pixel(s) and vice versa

Synopsis

#include <ggi/ggi.h>


ggi_pixel ggiMapColor(ggi_visual_t vis, ggi_color *col);

int ggiUnmapPixel(ggi_visual_t vis, ggi_pixel pixel, ggi_color *col);

int ggiPackColors(ggi_visual_t vis, void *buf, ggi_color *cols, int len);

int ggiUnpackPixels(ggi_visual_t vis, void *buf, ggi_color *cols, int len);

Description

ggiMapColor gets the pixelvalue for the given color.

ggiUnmapPixel gets the color associated with the given pixelvalue.

ggiPackColors converts the colors in :p:`cols` to pixelvalues in :p:`buf`. The output from this function is suitable for input to the ggiPut{HLine,VLine,Box} functions.

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 614); backlink

Unknown interpreted text role "p".

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 614); backlink

Unknown interpreted text role "p".

ggiUnpackPixels converts the pixelvalues in :p:`buf` to individual elements of :p:`cols`. This function maybe used to convert buffers output by the ggiGet{HLine,VLine,Box} functions from the pixelvalue representation to their actual colors as defined by :man:`ggi_color(3)`.

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 619); backlink

Unknown interpreted text role "p".

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 619); backlink

Unknown interpreted text role "p".

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 619); backlink

Unknown interpreted text role "man".

The buffers output from ggiPackColors and the input to ggiUnpackPixels are in the same format as the get/put buffers. Their format is defined in :man:`ggi_pixelformat(3)`.

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 626); backlink

Unknown interpreted text role "man".

Try to cache the results of color lookups in your application for efficiency purposes.

Return value

ggiMapColor returns a ggi_pixel.

ggiUnmapPixel, ggiPackColors, and ggiUnpackPixels returns 0 for OK, otherwise an error code.

See Also

:man:`ggiGetPixelFormat(3)`, :man:`ggi_color(3)`, :man:`ggi_pixelformat(3)`

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 651); backlink

Unknown interpreted text role "man".

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 651); backlink

Unknown interpreted text role "man".

System Message: ERROR/3 (../ggi-core/libggi/doc/libggi.txt, line 651); backlink

Unknown interpreted text role "man".
 
[ prev :: next :: up ] libggi-current (3)
2008/05/04 23:15:03