YCbCr Effect

Converts planar and chroma subsampled JPEG YCbCr data to RGB. This effect assumes that the YCbCr data is formatted in compliance with the JPEG standard. Data for the inputs may be obtained from IWICPlanarBitmapSourceTransform.

The CLSID for this effect is CLSID_D2D1YCbCr.

Effect properties

Display name and index enumerationType and default valuesDescription

ChromaSubsampling

D2D1_YCBCR_CHROMA_SUBSAMPLING

D2D1_YCBCR_CHROMA_SUBSAMPLING

D2D1_YCBCR_CHROMA_SUBSAMPLING_AUTO

Specifies the chroma subsampling of the input chroma image.

TransformMatrix

D2D1_YCBCR_PROP_TRANSFORM_MATRIX

D2D1_MATRIX_3X2_F

Matrix3x2F::Identity()

A 3x2 Matrix specifying the axis-aligned affine transform of the image. Axis aligned transforms include Scale, Flips, and 90 degree rotations.

InterpolationMode

D2D1_YCBCR_INTERPOLATION_MODE

D2D1_YCBCR_INTERPOLATION_MODE

The interpolation mode.

 

Subsampling modes

EnumerationDescription

D2D1_YCBCR_CHROMA_SUBSAMPLING_AUTO

This mode attempts to infer the chroma subsampling from the bounds of the input images. When this option is selected, the smaller plane is upsampled to the size of the larger plane and this effect’s output rectangle is the intersection of the two planes. When using this mode, care should be taken when applying effects to the input planes that change the image bounds, such as the border transform, so that the desired size ratio between the planes is maintained.

D2D1_YCBCR_CHROMA_SUBSAMPLING_420

The chroma plane is horizontally subsampled by ½ and vertically subsampled by ½. When this option is selected, the chroma plane is horizontally and vertically upsampled by 2x and this effect’s output rectangle is the intersection of the two planes.

D2D1_YCBCR_CHROMA_SUBSAMPLING_422

The chroma plane is horizontally subsampled by ½. When this option is selected, the chroma plane is horizontally upsampled by 2x and this effect’s output rectangle is the intersection of the two planes.

D2D1_YCBCR_CHROMA_SUBSAMPLING_444

The chroma plane is not subsampled. When this option is selected this effect’s output rectangle is the intersection of the two planes.

D2D1_YCBCR_CHROMA_SUBSAMPLING_440

The chroma plane is vertically subsampled by ½. When this option is selected, the chroma plane is vertically upsampled by 2x and this effect’s output rectangle is the intersection of the two planes.

 

Interpolation modes

EnumerationDescription
D2D1_YCBCR_INTERPOLATION_MODE_NEAREST_NEIGHBORSamples the nearest single point and uses that. This mode uses less processing time, but outputs the lowest quality image.
D2D1_YCBCR_INTERPOLATION_MODE_LINEARUses a four point sample and linear interpolation. This mode uses more processing time than the nearest neighbor mode, but outputs a higher quality image.
D2D1_YCBCR_INTERPOLATION_MODE_CUBICUses a 16 sample cubic kernel for interpolation. This mode uses the most processing time, but outputs a higher quality image.
D2D1_YCBCR_INTERPOLATION_MODE_MULTI_SAMPLE_LINEARUses 4 linear samples within a single pixel for good edge anti-aliasing. This mode is good for scaling down by small amounts on images with few pixels.
D2D1_YCBCR_INTERPOLATION_MODE_ANISOTROPICUses anisotropic filtering to sample a pattern according to the transformed shape of the bitmap.
D2D1_YCBCR_INTERPOLATION_MODE_HIGH_QUALITY_CUBICUses a variable size high quality cubic kernel to perform a pre-downscale the image if downscaling is involved in the transform matrix. Then uses the cubic interpolation mode for the final output.

 

Output bitmap

The size of the output bitmap depends on the transform matrix that is applied to the image.

The effect performs the transform operation and then applies a bounding box around the result. The output bitmap is the size of the bounding box.

Requirements

Minimum supported clientWindows 8.1 [desktop apps | Windows Store apps]
Minimum supported serverWindows Server 2012 R2 [desktop apps | Windows Store apps]
Headerd2d1effects_1.h
Libraryd2d1.lib, dxguid.lib

 

Related topics

ID2D1Effect

 

 

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.