Hue rotatation effect

Use the hue rotate effect to alter the hue of an image by applying a color matrix based on the rotation angle.

The CLSID for this effect is CLSID_D2D1HueRotation.

Example image

The example here shows the input and output images of the hue rotate effect with a rotation angle of 270 degrees.

Before
The image before the effect.
After
The image after the transform.

 


ComPtr<ID2D1Effect> hueRotationEffect;
m_d2dContext->CreateEffect(CLSID_D2D1HueRotation, &hueRotationEffect);

hueRotationEffect->SetInput(0, bitmap);
hueRotationEffect->SetValue(D2D1_HUEROTATION_PROP_ANGLE, 270.0f);

m_d2dContext->BeginDraw();
m_d2dContext->DrawImage(hueRotationEffect.Get());
m_d2dContext->EndDraw();

The effect calculates a color matrix based on the rotation angle (θ) you specify with the D2D1_HUEROTATION_PROP_ANGLE property. Here are the matrix equations.

Hue rotation calculations

The matrix created depends only on the rotation angle. You can use the color matrix effect if you need a specific matrix.

Effect properties

Display name and index enumerationType and default valueDescription

Angle

D2D1_HUEROTATION_PROP_ANGLE

FLOAT

0.0f

The angle to rotate the hue, in degrees.

 

Output bitmap

The output bitmap size is the same as the input bitmap size.

Requirements

Minimum supported clientWindows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]
Minimum supported serverWindows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]
Headerd2d1effects.h
Libraryd2d1.lib, dxguid.lib

 

Related topics

ID2D1Effect

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.