Wiki Page Content

Differences between revisions 5 and 6
Revision 5 as of 2011-05-17 17:39:45
Size: 1514
Editor: SheenaSmith
Comment: minor change
Revision 6 as of 2014-06-27 00:41:52
Size: 1958
Editor: AdamMil
Comment: updates display gamma ramp, not window gamma ramp
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Use this function to set the gamma ramp for a window. Use this function to set the gamma ramp for the display that owns a given window.
Line 18: Line 18:
||'''window'''||the window to change|| ||'''window'''||the window used to select the display whose gamma ramp will be changed||
Line 32: Line 32:
Set 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.
Set 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. Despite the name and signature, this method sets the gamma ramp of the entire display, not an individual window. A window is considered to be owned by the display that contains the window's center pixel. (The index of this display can be retrieved using [[SDL_GetWindowDisplayIndex]].) The gamma ramp set will not follow the window if it is moved to another display.

SDL_SetWindowGammaRamp

Use this function to set the gamma ramp for the display that owns a given window.

Syntax

int SDL_SetWindowGammaRamp(SDL_Window*   window,
                           const Uint16* red,
                           const Uint16* green,
                           const Uint16* blue)

Function Parameters

window

the window used to select the display whose gamma ramp will be changed

red

a 256 element array of 16-bit quantities representing the translation table for the red channel, or NULL

green

a 256 element array of 16-bit quantities representing the translation table for the green channel, or NULL

blue

a 256 element array of 16-bit quantities representing 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

Set 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. Despite the name and signature, this method sets the gamma ramp of the entire display, not an individual window. A window is considered to be owned by the display that contains the window's center pixel. (The index of this display can be retrieved using SDL_GetWindowDisplayIndex.) The gamma ramp set will not follow the window if it is moved to another display.


CategoryAPI, CategoryVideo

None: SDL_SetWindowGammaRamp (last edited 2014-06-28 22:11:09 by PhilippWiesemann)

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