Class PlanarBitmapFrameEncode
[Guid("F928B7B8-2221-40C1-B72E-7E82F1974D1A")]
public class PlanarBitmapFrameEncode : ComObject
- Inheritance
-
PlanarBitmapFrameEncode
Constructors
PlanarBitmapFrameEncode(nint)
public PlanarBitmapFrameEncode(nint nativePtr)
Parameters
nativePtr
nint
Methods
WritePixels(int, BitmapPlane[], int)
Writes lines from the source planes to the encoded format.
public void WritePixels(int lineCount, BitmapPlane[] planesRef, int planes)
Parameters
lineCount
intThe number of lines to encode. See the Remarks section for WIC Jpeg specific line count restrictions.
planesRef
BitmapPlane[]Specifies the source buffers for each component plane encoded.
planes
intThe number of component planes specified by the pPlanes parameter.
Remarks
Successive WritePixels calls are assumed sequentially add scanlines to the output image. IWICBitmapFrameEncode::Initialize, IWICBitmapFrameEncode::SetSize and IWICBitmapFrameEncode::SetPixelFormat must be called before this method or it will fail.
The interleaved pixel format set via IWICBitmapFrameEncode::SetPixelFormat and the codec specific encode parameters determine the supported planar formats.
WIC JPEG Encoder: QueryInterface can be used to obtain this interface from the WIC JPEG BitmapFrameEncode implementation. When using this method to encode Y?CbCr data with the WIC JPEG encoder, chroma subsampling can be configured with encoder options during frame creation. See the Encoding Overview and IWICBitmapEncoder::CreateNewFrame for more details.
Depending upon the configured chroma subsampling, the lineCount parameter has the following restrictions:
Chroma Subsampling | Line Count Restriction | Chroma Plane Width | Chroma Plane Height |
---|---|---|---|
4:2:0 | Multiple of 2, unless the call covers the last scanline of the image | lumaWidth / 2 Rounded up to the nearest integer. | lumaHeight / 2 Rounded up to the nearest integer. |
4:2:2 | Any | lumaWidth / 2 Rounded up to the nearest integer. | Any |
4:4:4 | Any | Any | Any |
4:4:0 | Multiple of 2, unless the call covers the last scanline of the image | Any | llumaHeight / 2 Rounded up to the nearest integer. |
?
The full scanline width must be encoded, and the width of the bitmap sources must match their planar configuration.
Additionally, if a pixel format is set via IWICBitmapFrameEncode::SetPixelFormat, it must be
The supported pixel formats of the bitmap sources passed into this method are as follows:
Plane Count | Plane 1 | Plane 2 | Plane 3 |
---|---|---|---|
3 | |||
2 | N/A |
?
WriteSource(ComArray<BitmapSource>, int, RawBox?)
Writes lines from the source planes to the encoded format.
public void WriteSource(ComArray<BitmapSource> planesOut, int planes, RawBox? rcSourceRef)
Parameters
planesOut
ComArray<BitmapSource>Specifies an array of BitmapSource that represent image planes.
planes
intThe number of component planes specified by the planes parameter.
rcSourceRef
RawBox?The source rectangle of pixels to encode from the BitmapSource planes. Null indicates the entire source. The source rect width must match the width set through SetSize. Repeated WriteSource calls can be made as long as the total accumulated source rect height is the same as set through SetSize.
Remarks
Successive WriteSource calls are assumed sequentially add scanlines to the output image. IWICBitmapFrameEncode::Initialize, IWICBitmapFrameEncode::SetSize and IWICBitmapFrameEncode::SetPixelFormat must be called before this method or it will fail.
The interleaved pixel format set via IWICBitmapFrameEncode::SetPixelFormat and the codec specific encode parameters determine the supported planar formats.
WIC JPEG Encoder: QueryInterface can be used to obtain this interface from the WIC JPEG BitmapFrameEncode implementation. When using this method to encode Y?CbCr data with the WIC JPEG encoder, chroma subsampling can be configured with encoder options during frame creation. See the Encoding Overview and IWICBitmapEncoder::CreateNewFrame for more details.
Depending upon the configured chroma subsampling, the lineCount parameter 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. | Any |
4:4:4 | Any | Any | Any | Any |
4:4:0 | Any | Multiple of 2 | lumaWidth | llumaHeight / 2 Rounded up to the nearest integer. |
?
The full scanline width must be encoded, and the width of the bitmap sources must match their planar configuration.
Additionally, if a pixel format is set via IWICBitmapFrameEncode::SetPixelFormat, it must be
The supported pixel formats of the bitmap sources passed into this method are as follows:
Plane Count | Plane 1 | Plane 2 | Plane 3 |
---|---|---|---|
3 | |||
2 | N/A |
?
WriteSource(BitmapSource[], int, RawBox?)
Writes lines from the source planes to the encoded format.
public void WriteSource(BitmapSource[] planesOut, int planes, RawBox? rcSourceRef)
Parameters
planesOut
BitmapSource[]Specifies an array of BitmapSource that represent image planes.
planes
intThe number of component planes specified by the planes parameter.
rcSourceRef
RawBox?The source rectangle of pixels to encode from the BitmapSource planes. Null indicates the entire source. The source rect width must match the width set through SetSize. Repeated WriteSource calls can be made as long as the total accumulated source rect height is the same as set through SetSize.
Remarks
Successive WriteSource calls are assumed sequentially add scanlines to the output image. IWICBitmapFrameEncode::Initialize, IWICBitmapFrameEncode::SetSize and IWICBitmapFrameEncode::SetPixelFormat must be called before this method or it will fail.
The interleaved pixel format set via IWICBitmapFrameEncode::SetPixelFormat and the codec specific encode parameters determine the supported planar formats.
WIC JPEG Encoder: QueryInterface can be used to obtain this interface from the WIC JPEG BitmapFrameEncode implementation. When using this method to encode Y?CbCr data with the WIC JPEG encoder, chroma subsampling can be configured with encoder options during frame creation. See the Encoding Overview and IWICBitmapEncoder::CreateNewFrame for more details.
Depending upon the configured chroma subsampling, the lineCount parameter 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. | Any |
4:4:4 | Any | Any | Any | Any |
4:4:0 | Any | Multiple of 2 | lumaWidth | llumaHeight / 2 Rounded up to the nearest integer. |
?
The full scanline width must be encoded, and the width of the bitmap sources must match their planar configuration.
Additionally, if a pixel format is set via IWICBitmapFrameEncode::SetPixelFormat, it must be
The supported pixel formats of the bitmap sources passed into this method are as follows:
Plane Count | Plane 1 | Plane 2 | Plane 3 |
---|---|---|---|
3 | |||
2 | N/A |
?
Operators
explicit operator PlanarBitmapFrameEncode(nint)
public static explicit operator PlanarBitmapFrameEncode(nint nativePtr)
Parameters
nativePtr
nint