D3DXCOLORADJUSTSURATION function

xiaoxiao2021-03-06  59

D3DXCOLORADJUSTSURATION function

Adjust the color saturation.

definition:

D3DXColor * WinAPI D3DXCOLORADJUSTSATION

D3DXColor * Pout,

Const d3dxcolor * pc,

Float S

);

parameter:

pout

[IN, OUT] points to the D3DxColor structure, return the results of the operation.

PC

[in] points to the color D3DxColor to be adjusted.

s

Saturation value. This parameter is linear interpolation. The size of the value is not limited, if 0, returns the grayscale color. If it is 1, return to the original color.

return value:

The function returns the saturation of the D3DxColor structure.

Description:

The alpha value is not changed. The return value is the same as the POUT parameter so that it can be used as a parameter of other functions.

This function performs saturation calculation when red, green, and blue, as shown in the following example:

// The following is calculated based on the NTSC standard.

Float grey = pc-> r * 0.2125f pc-> g * 0.7154f pc-> b * 0.0721f;

Pout-> r = grey s * (pc-> r - grey);

If S is greater than 0 and less than 1, the saturation will be reduced. If S is greater than 1, it is to increase saturation. The color value is calculated as follows:

R = g = b = 0.2125 * R 0.7154 * G 0.0721 * B

Function information:

HEADER

D3DX9Math.h

Import Library

D3DX9.LIB

Minimum operation systems

WINDOWS 98

related functions:

D3DXCOLORADJUSTCONTRAST

转载请注明原文地址:https://www.9cbs.com/read-111729.html

New Post(0)