Class PlanarBitmapSourceTransform
[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
intThe width to scale the source bitmap. This parameter must be equal to a value obtainable through IWICPlanarBitmapSourceTransform:: DoesSupportTransform.
height
intThe height to scale the source bitmap. This parameter must be equal to a value obtainable through IWICPlanarBitmapSourceTransform:: DoesSupportTransform.
dstTransform
BitmapTransformOptionsThe 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
PlanarOptionsUsed 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
intThe 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 Subsampling | X Coordinate | Y Coordinate | Chroma Width | Chroma Height |
---|---|---|---|---|
4:2:0 | Multiple of 2 | Multiple of 2 | lumaWidth / 2 Rounded up to the nearest integer. | lumaHeight / 2 Rounded up to the nearest integer. |
4:2:2 | Multiple of 2 | Any | lumaWidth / 2 Rounded up to the nearest integer. | lumaHeight |
4:4:4 | Any | Any | llumaWidth | llumaHeight |
4:4:0 | Any | Multiple of 2 | lumaWidth | llumaHeight / 2 Rounded up to the nearest integer. |
?
The pDstPlanes parameter supports the following pixel formats.
Plane Count | Plane 1 | Plane 2 | Plane 3 |
---|---|---|---|
3 | |||
2 | N/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
intNo documentation.
heightRef
intNo documentation.
dstTransform
BitmapTransformOptionsNo documentation.
dstPlanarOptions
PlanarOptionsNo documentation.
guidDstFormatsRef
Guid[]No documentation.
planeDescriptionsRef
BitmapPlaneDescription[]No documentation.
planes
intNo documentation.
fIsSupportedRef
RawBoolNo documentation.
Operators
explicit operator PlanarBitmapSourceTransform(nint)
public static explicit operator PlanarBitmapSourceTransform(nint nativePtr)
Parameters
nativePtr
nint