SDL_SetGammaRamp

Use this function to set the gamma ramp for the currently selected display.

Syntax

int SDL_SetGammaRamp(const Uint16* red,
                     const Uint16* green,
                     const Uint16* blue)

Function Parameters

red

the translation table for the red channel, or NULL

green

the translation table for the green channel, or NULL

blue

the translation table for the blue channel, or NULL

Return Value

Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.

Code Examples

You can add your code example here

Remarks

Sets the gamma translation table for the red, green, and blue channels of the video hardware. Each table is an array of 256 16-bit quantities, representing a mapping between the input and output for that channel. The input is the index into the array, and the output is the 16-bit gamma value at that index, scaled to the output color precision.

You may pass NULL to any of the channels to leave them unchanged.

This function adjusts the gamma based on lookup tables, you can also have the gamma calculated based on a "gamma function" parameter with SDL_SetGamma().

Not all display hardware is able to change gamma; it will return -1 if gamma is unsupported.


CategoryAPI, CategoryVideo

SDL_SetGammaRamp (last edited 2010-08-29 20:35:43 by SheenaSmith)

Feedback
Please include your contact information if you'd like to receive a reply.
Submit