RGB to Hue Effect

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

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 normalizes the output data (hue, saturation value for HSV or hue, saturation, lightness for HSL) to the range [0, 1].

The CLSID for this effect is CLSID_D2D1RgbToHue.

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

Sample Code


ComPtr<ID2D1Effect> rgbToHueEffect;
m_d2dContext->CreateEffect(CLSID_D2D1RgbToHue, &rgbToHueEffect);
 
rgbToHueEffect->SetInput(0, bitmap);
rgbToHueEffect->SetValue(D2D1_RGBTOHUE_PROP_OUTPUT_COLOR_SPACE, D2D1_RGBTOHUE_OUTPUT_COLOR_SPACE_HUE_SATURATION_VALUE);
 
m_d2dContext->BeginDraw();
m_d2dContext->DrawImage(rgbToHueEffect.Get());
m_d2dContext->EndDraw();



Effect Properties

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

Requirements

Minimum supported clientWindows 10 [desktop apps | Windows Store apps]
Minimum supported serverWindows 10 [desktop apps | Windows Store apps]
Headerd2d1effects_2.h
Libraryd2d1.lib, dxguid.lib

 

Related topics

ID2D1Effect

 

 

Show: