Table of Contents

Class PlanarBitmapSourceTransform

Namespace
SharpDX.WIC
Assembly
SharpDX.Direct2D1.dll
[Guid("3AFF9CCE-BE95-4303-B927-E7D16FF4A613")]
public class PlanarBitmapSourceTransform : ComObject
Inheritance
PlanarBitmapSourceTransform

Constructors

PlanarBitmapSourceTransform(nint)

public PlanarBitmapSourceTransform(nint nativePtr)

Parameters

nativePtr nint

Methods

CopyPixels(RawBox?, int, int, BitmapTransformOptions, PlanarOptions, BitmapPlane[], int)

Copies pixels into the destination planes. Configured by the supplied input parameters.

If a dstTransform, scale, or format conversion is specified, cbStride is the transformed stride and is based on the destination pixel format of the pDstPlanes parameter, not the original source's pixel format.

public void CopyPixels(RawBox? rcSourceRef, int width, int height, BitmapTransformOptions dstTransform, PlanarOptions dstPlanarOptions, BitmapPlane[] dstPlanesRef, int planes)

Parameters

rcSourceRef RawBox?

The source rectangle of pixels to copy.

width int

The width to scale the source bitmap. This parameter must be equal to a value obtainable through IWICPlanarBitmapSourceTransform:: DoesSupportTransform.

height int

The height to scale the source bitmap. This parameter must be equal to a value obtainable through IWICPlanarBitmapSourceTransform:: DoesSupportTransform.

dstTransform BitmapTransformOptions

The desired rotation or flip to perform prior to the pixel copy. A rotate can be combined with a flip horizontal or a flip vertical, see BitmapTransformOptions.

dstPlanarOptions PlanarOptions

Used to specify additional configuration options for the transform. See PlanarOptions 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.

dstPlanesRef BitmapPlane[]

Specifies the pixel format and output buffer for each component plane. The number of planes and pixel format of each plane must match values obtainable through IWICPlanarBitmapSourceTransform::DoesSupportTransform.

planes int

The number of component planes specified by the pDstPlanes parameter.

Remarks

WIC JPEG Decoder: Depending on the configured chroma subsampling of the image, the source rectangle has the following restrictions:

Chroma SubsamplingX CoordinateY CoordinateChroma WidthChroma Height
4:2:0Multiple of 2Multiple of 2lumaWidth / 2 Rounded up to the nearest integer.lumaHeight / 2 Rounded up to the nearest integer.
4:2:2Multiple of 2AnylumaWidth / 2 Rounded up to the nearest integer.lumaHeight
4:4:4AnyAnyllumaWidthllumaHeight
4:4:0AnyMultiple of 2lumaWidthllumaHeight / 2 Rounded up to the nearest integer.

?

The pDstPlanes parameter supports the following pixel formats.

Plane CountPlane 1Plane 2Plane 3
3
2N/A

?

DoesSupportTransform(ref int, ref int, BitmapTransformOptions, PlanarOptions, Guid[], BitmapPlaneDescription[], int, out RawBool)

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 BitmapSourceTransform or BitmapSource and retrieve interleaved pixels.

The following transforms can be checked:

  • Determine if the flip/rotate option specified via BitmapTransformOptions 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.

public void DoesSupportTransform(ref int widthRef, ref int heightRef, BitmapTransformOptions dstTransform, PlanarOptions dstPlanarOptions, Guid[] guidDstFormatsRef, BitmapPlaneDescription[] planeDescriptionsRef, int planes, out RawBool fIsSupportedRef)

Parameters

widthRef int

No documentation.

heightRef int

No documentation.

dstTransform BitmapTransformOptions

No documentation.

dstPlanarOptions PlanarOptions

No documentation.

guidDstFormatsRef Guid[]

No documentation.

planeDescriptionsRef BitmapPlaneDescription[]

No documentation.

planes int

No documentation.

fIsSupportedRef RawBool

No documentation.

Operators

explicit operator PlanarBitmapSourceTransform(nint)

public static explicit operator PlanarBitmapSourceTransform(nint nativePtr)

Parameters

nativePtr nint

Returns

PlanarBitmapSourceTransform