IWICPlanarBitmapSourceTransform::DoesSupportTransform method (wincodec.h)

Use this method to determine if a desired planar output is supported and allow the caller to choose an optimized code path if it is. Otherwise, callers should fall back to IWICBitmapSourceTransform or IWICBitmapSource and retrieve interleaved pixels.

The following transforms can be checked:

  • Determine if the flip/rotate option specified via WICBitmapTransformOptions is supported.
  • Determine if the requested planar pixel format configuration is supported.
  • Determine the closest dimensions the implementation can natively scale to given the desired dimensions.

When a transform is supported, this method returns the description of the resulting planes in the pPlaneDescriptions parameter.

Syntax

HRESULT DoesSupportTransform(
  [in, out] UINT                      *puiWidth,
  [in, out] UINT                      *puiHeight,
            WICBitmapTransformOptions dstTransform,
            WICPlanarOptions          dstPlanarOptions,
  [in]      const WICPixelFormatGUID  *pguidDstFormats,
  [out]     WICBitmapPlaneDescription *pPlaneDescriptions,
            UINT                      cPlanes,
  [out]     BOOL                      *pfIsSupported
);

Parameters

[in, out] puiWidth

Type: UINT*

On input, the desired width. On output, the closest supported width to the desired width; this is the same size or larger than the desired width.

[in, out] puiHeight

Type: UINT*

On input, the desired height. On output, the closest supported height to the desired height; this is the same size or larger than the desired width.

dstTransform

Type: WICBitmapTransformOptions

The desired rotation or flip operation. Multiple WICBitmapTransformOptions can be combined in this flag parameter, see WICBitmapTransformOptions.

dstPlanarOptions

Type: WICPlanarOptions

Used to specify additional configuration options for the transform. See WICPlanarOptions for more detail.

WIC JPEG Decoder:

WICPlanarOptionsPreserveSubsampling can be specified to retain the subsampling ratios when downscaling. By default, the JPEG decoder attempts to preserve quality by downscaling only the Y plane in some cases, changing the image to 4:4:4 chroma subsampling.

[in] pguidDstFormats

Type: const WICPixelFormatGUID*

The requested pixel formats of the respective planes.

[out] pPlaneDescriptions

Type: WICBitmapPlaneDescription*

When *pfIsSupported == TRUE, the array of plane descriptions contains the size and format of each of the planes.

WIC JPEG Decoder: The Cb and Cr planes can be a different size from the values returned by puiWidth and puiHeight due to chroma subsampling.

cPlanes

Type: UINT

The number of component planes requested.

[out] pfIsSupported

Type: BOOL*

Set to TRUE if the requested transforms are natively supported.

Return value

Type: HRESULT

Check the value of pfIsSupported to determine if the transform is supported via IWICPlanarBitmapSourceTransform::CopyPixels. If this method fails, the output parameters for width, height, and plane descriptions are zero initialized. Other return values indicate failure.

Requirements

Requirement Value
Minimum supported client Windows 8.1 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 R2 [desktop apps | UWP apps]
Target Platform Windows
Header wincodec.h
Library Windowscodecs.lib
DLL Windowscodecs.dll

See also

IWICPlanarBitmapSourceTransform

IWicPlanarBitmapSourceTransform::CopyPixels

WICBitmapPlaneDescription

WICBitmapTransformOptions

WICPlanarOptions