D2D1_GAMMA enumeration (d2d1.h)

Specifies which gamma is used for interpolation.

Syntax

typedef enum D2D1_GAMMA {
  D2D1_GAMMA_2_2 = 0,
  D2D1_GAMMA_1_0 = 1,
  D2D1_GAMMA_FORCE_DWORD = 0xffffffff
} ;

Constants

 
D2D1_GAMMA_2_2
Value: 0
Interpolation is performed in the standard RGB (sRGB) gamma.
D2D1_GAMMA_1_0
Value: 1
Interpolation is performed in the linear-gamma color space.
D2D1_GAMMA_FORCE_DWORD
Value: 0xffffffff

Remarks

Interpolating in a linear gamma space (D2D1_GAMMA_1_0) can avoid changes in perceived brightness caused by the effect of gamma correction in spaces where the gamma is not 1.0, such as the default sRGB color space, where the gamma is 2.2. For an example of the differences between these two blending modes, consider the following illustration, which shows two gradients, each of which blends from red to blue to green:

Illustration of two gradients from red to blue to green, blended by using sRGB gamma and linear-gamma

The first gradient is interpolated linearly in the space of the render target (sRGB in this case), and one can see the dark bands between each color. The second gradient uses a gamma-correct linear interpolation, and thus does not exhibit the same variations in brightness.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Header d2d1.h