Share via


XMColorAdjustSaturation 함수(directxmath.h)

색의 채도 값을 조정합니다.

구문

XMVECTOR XM_CALLCONV XMColorAdjustSaturation(
  [in] FXMVECTOR C,
  [in] float     Saturation
) noexcept;

매개 변수

[in] C

색을 설명하는 XMVECTOR입니다. C의 각 구성 요소는 0.0f에서 1.0f 범위여야 합니다.

[in] Saturation

채도 값입니다. 이 매개 변수는 회색 배율로 변환된 색과 원래 색 C 간에 선형으로 보간됩니다. 채도가 0.0f이면 함수는 회색조 색을 반환합니다. 채도가 1.0f이면 함수는 원래 색을 반환합니다.

반환 값

채도 조정으로 인한 색을 설명하는 XMVECTOR 를 반환합니다.

설명

다음 의사 코드는 함수의 작업을 보여 줍니다.

XMVector colorOut;

// Approximate values for each component's contribution to luminance.
// Based upon the NTSC standard described in ITU-R Recommendation BT.709.
float Luminance = 0.2125f * C.x + 0.7154f * C.y + 0.0721f * C.z;

colorOut.x = (C.x - Luminance) * Saturation + Luminance;
colorOut.y = (C.y - Luminance) * Saturation + Luminance;
colorOut.z = (C.z - Luminance) * Saturation + Luminance;
colorOut.w = C.w;

return colorOut;

플랫폼 요구 사항

Windows 8 Windows SDK를 사용하는 Microsoft Visual Studio 2010 또는 Microsoft Visual Studio 2012. Win32 데스크톱 앱, Windows 스토어 앱 및 Windows Phone 8개 앱에 지원됩니다.

요구 사항

요구 사항
대상 플랫폼 Windows
헤더 directxmath.h

추가 정보

DirectXMath 라이브러리 색 함수