Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# Image.fromYuvPlanes Method

Module: Image

## Definition

Creates an Image from the specified YUV planes.

Python

    @staticmethod
    from_yuv_planes(y_plane: bytearray, u_plane: bytearray, v_plane: bytearray, y_width: int, y_height: int, uv_pixel_stride: int, uv_row_stride: int, dst_pixel_format: PixelFormat) -> Image

Parameters

> `y_plane` bytearray
> in A buffer that contains the Y plane.
> `u_plane` bytearray
> in A buffer that contains the U plane.
> `v_plane` bytearray
> in A buffer that contains the V plane.
> `y_width` int
> in The width, in pixels, of the Y plane.
> `y_height` int
> in The height, in pixels, of the Y plane.
> `uv_pixel_stride` int
> in The pixel-level stride, in pixels, of the U and V planes.
> `uv_row_stride` int
> in The row-level stride, in pixels, of the U and V planes.
> `dst_pixel_format` PixelFormat
> in The pixel format into which to convert the input image.

Returns

> Image
> The newly created image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Dart

    static Image fromYuvPlanes(Uint8List? yPlane, Uint8List? uPlane, Uint8List? vPlane, int yWidth, int yHeight, int uvPixelStride, int uvRowStride, PixelFormat dstPixelFormat)

Parameters

> `yPlane` Uint8List
> in A buffer that contains the Y plane.
> `uPlane` Uint8List
> in A buffer that contains the U plane.
> `vPlane` Uint8List
> in A buffer that contains the V plane.
> `yWidth` int
> in The width, in pixels, of the Y plane.
> `yHeight` int
> in The height, in pixels, of the Y plane.
> `uvPixelStride` int
> in The pixel-level stride, in pixels, of the U and V planes.
> `uvRowStride` int
> in The row-level stride, in pixels, of the U and V planes.
> `dstPixelFormat` PixelFormat
> in The pixel format into which to convert the input image.

Returns

> Image
> The newly created image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C#

    public static Image FromYuvPlanes(byte[] yPlane, byte[] uPlane, byte[] vPlane, int yWidth, int yHeight, int uvPixelStride, int uvRowStride, PixelFormat dstPixelFormat)

Parameters

> `yPlane` byte[]
> in A buffer that contains the Y plane.
> `uPlane` byte[]
> in A buffer that contains the U plane.
> `vPlane` byte[]
> in A buffer that contains the V plane.
> `yWidth` int
> in The width, in pixels, of the Y plane.
> `yHeight` int
> in The height, in pixels, of the Y plane.
> `uvPixelStride` int
> in The pixel-level stride, in pixels, of the U and V planes.
> `uvRowStride` int
> in The row-level stride, in pixels, of the U and V planes.
> `dstPixelFormat` PixelFormat
> in The pixel format into which to convert the input image.

Returns

> Image
> The newly created image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Java

    public static Image fromYuvPlanes(byte[] yPlane, byte[] uPlane, byte[] vPlane, int yWidth, int yHeight, int uvPixelStride, int uvRowStride, PixelFormat dstPixelFormat) throws FaceException

Parameters

> `yPlane` byte[]
> in A buffer that contains the Y plane.
> `uPlane` byte[]
> in A buffer that contains the U plane.
> `vPlane` byte[]
> in A buffer that contains the V plane.
> `yWidth` int
> in The width, in pixels, of the Y plane.
> `yHeight` int
> in The height, in pixels, of the Y plane.
> `uvPixelStride` int
> in The pixel-level stride, in pixels, of the U and V planes.
> `uvRowStride` int
> in The row-level stride, in pixels, of the U and V planes.
> `dstPixelFormat` PixelFormat
> in The pixel format into which to convert the input image.

Returns

> Image
> The newly created image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

Swift

    public static func fromYuvPlanes(yPlane: [UInt8], uPlane: [UInt8], vPlane: [UInt8], yWidth: Int32, yHeight: Int32, uvPixelStride: Int32, uvRowStride: Int32, dstPixelFormat: PixelFormat) throws -> Image

Parameters

> `yPlane` [UInt8]
> in A buffer that contains the Y plane.
> `uPlane` [UInt8]
> in A buffer that contains the U plane.
> `vPlane` [UInt8]
> in A buffer that contains the V plane.
> `yWidth` Int32
> in The width, in pixels, of the Y plane.
> `yHeight` Int32
> in The height, in pixels, of the Y plane.
> `uvPixelStride` Int32
> in The pixel-level stride, in pixels, of the U and V planes.
> `uvRowStride` Int32
> in The row-level stride, in pixels, of the U and V planes.
> `dstPixelFormat` PixelFormat
> in The pixel format into which to convert the input image.

Returns

> Image
> The newly created image.

Exceptions

> FaceException
> An error has occurred during Face Library execution.

C

    int id3FaceImage_FromYuvPlanes (
        ID3_FACE_IMAGE hImage,
        unsigned char * yPlane,
        int yPlaneSize,
        unsigned char * uPlane,
        int uPlaneSize,
        unsigned char * vPlane,
        int vPlaneSize,
        int yWidth,
        int yHeight,
        int uvPixelStride,
        int uvRowStride,
        id3FacePixelFormat eDstPixelFormat)

Parameters

> `hImage` ID3_FACE_IMAGE
> in Handle to the Image object.
> `yPlane` unsigned char *
> in A buffer that contains the Y plane.
> `yPlaneSize` int
> in Size of the ‘yPlane’ buffer.
> `uPlane` unsigned char *
> in A buffer that contains the U plane.
> `uPlaneSize` int
> in Size of the ‘uPlane’ buffer.
> `vPlane` unsigned char *
> in A buffer that contains the V plane.
> `vPlaneSize` int
> in Size of the ‘vPlane’ buffer.
> `yWidth` int
> in The width, in pixels, of the Y plane.
> `yHeight` int
> in The height, in pixels, of the Y plane.
> `uvPixelStride` int
> in The pixel-level stride, in pixels, of the U and V planes.
> `uvRowStride` int
> in The row-level stride, in pixels, of the U and V planes.
> `eDstPixelFormat` id3FacePixelFormat
> in The pixel format into which to convert the input image.

Returns

> `int`
> An error code.
> See id3FaceError file for the list of possible error codes.