Microsoft DirectX 8.0 (Visual Basic)

D3DXColorAdjustContrast

Adjusts the contrast value of a color.

D3DXColorAdjustContrast( _ 
    COut As D3DCOLORVALUE, _ 
    C1 As D3DCOLORVALUE, _ 
    c As Single)

Parameters

COut
A D3DCOLORVALUE type that is the result of the operation, the result of the contrast adjustment.
C1
A source D3DCOLORVALUE type.
c
Contrast value. This parameter linearly interpolates between 50 percent gray and the color C1. There are not limits on the value of c. If this parameter is zero, then the returned color is 50 percent gray. If this parameter is 1, then the returned color is the original color.

Error Codes

If the function fails, an error is raised and Err.Number can be set to one of the following values:

D3DERR_INVALIDCALL
D3DERR_OUTOFVIDEOMEMORY

For information on trapping errors, see the Microsoft® Visual Basic® Error Handling topic.

Remarks

This function interpolates the red, green, and blue color components of a D3DCOLORVALUE type between 50 percent gray and a specified contrast value, as shown in the following example.

    Cout.r = 0.5 + c * (C1.r - 0.5)

If c is greater than 0 and less than 1, the contrast is decreased. If c is greater than 1, then the contrast is increased.

See Also

D3DXColorAdjustSaturation