Hue-to-RGB effect

Converts an HSL (Hue, Saturation, Lightness) or HSV (Hue, Saturation, Value) image to the RGB color space.

HSL and HSV are two different models for representing an RGB color in a cylindrical color space. They are useful because they allow you to reason about a color using more intuitive concepts like hue and intensity versus combining red, green and blue values.

This effect passes through any input alpha values.

The CLSID for this effect is CLSID_D2D1HueToRgb.

To reverse the behavior of this effect, use the RGB to Hue effect.

Sample code

ComPtr<ID2D1Effect> hueToRgbEffect;
m_d2dContext->CreateEffect(CLSID_D2D1HueToRgb, &hueToRgbEffect);
 
hueToRgbEffect->SetInput(0, bitmap);
hueToRgbEffect->SetValue(D2D1_HUETORGB_INPUT_COLOR_SPACE, D2D1_HUETORGB_INPUT_COLOR_SPACE_HUE_SATURATION_LIGHTNESS);
 
m_d2dContext->BeginDraw();
m_d2dContext->DrawImage(hueToRgbEffect.Get());
m_d2dContext->EndDraw();

Effect properties

The properties for the contrast effect are defined by the D2D1_HUETORGB_PROP enumeration.

Requirements

Requirement Value
Minimum supported client Windows 10 [desktop apps | Windows Store apps]
Minimum supported server Windows 10 [desktop apps | Windows Store apps]
Header d2d1effects_2.h
Library d2d1.lib, dxguid.lib