Name
ggiSetGammaMap, ggiGetGammaMap, ggiSetGamma, ggiGetGamma, ggiGammaMax — Manipulate the gamma maps and the gamma correction of a visual
Synopsis
#include <ggi/ggi.h>
int ggiSetGammaMap( | vis, | |
| s, | |
| len, | |
| gammamap) ; | |
ggi_visual_t | vis; |
int | s; |
int | len; |
ggi_color * | gammamap; |
int ggiGetGammaMap( | vis, | |
| s, | |
| len, | |
| gammamap) ; | |
ggi_visual_t | vis; |
int | s; |
int | len; |
ggi_color * | gammamap; |
int ggiSetGamma( | vis, | |
| r, | |
| g, | |
| b) ; | |
ggi_visual_t | vis; |
ggi_float | r; |
ggi_float | g; |
ggi_float | b; |
int ggiGetGamma( | vis, | |
| r, | |
| g, | |
| b) ; | |
ggi_visual_t | vis; |
ggi_float * | r; |
ggi_float * | g; |
ggi_float * | b; |
int ggiGammaMax( | vis, | |
| bitmeaning, | |
| maxread, | |
| maxwrite) ; | |
ggi_visual_t | vis; |
uint32 | bitmeaning; |
int * | maxread; |
int * | maxwrite; |
Description
Some modes on some hardware can use a per-channel palette to lookup the values
before sending to the monitor. Generally this is used for gamma correction
by filling the lookup table with a curve, hence the name "gamma map", but it
could be used for other things e.g. special effects in games. Truecolor
modes with gamma maps are sometimes referred to as "directcolor".
ggiSetGammaMap and
ggiGetGammaMap set or get the gamma map, for
len colors starting at
s. In the event that there are more map
entries for some channels than others, values for the upper indices of
the map in the shallow channels are ignored on write, and undefined on
read.
The ggiGammaMax function is used in order
to find out how many readable and writeable entries are in the map
(returned in the integers referenced by
maxwrite and maxread).
This must be done once for each channel. The parameter
bitmeaning should be set to the bit meaning
(e.g. GGI_BM_TYPE_COLOR | GGI_BM_SUB_BLUE) of the channel of which you
are inquiring. If ggiGammaMax returns an error,
you cannot set the gamma map on this visual. If
ggiGammaMax succeeds, but
maxwrite is -1 on return, this means that
ggiSetGamma will work, but that
ggiSetGammaMap will not.
ggiSetGamma and ggiGetGamma
sets or gets the gamma correction for the visual according to the
usual curve associated with the given values for each channel, which
should be positive.
Return value
All five functions 0 for OK, otherwise an
error code.