CaptureImage.fromRawBuffer Method

Module: CaptureImage

Definition

Creates an Image from the specified raw data buffer.

@staticmethod
from_raw_buffer(pixels: bytearray, width: int, height: int, stride: int, src_pixel_format: PixelFormat, dst_pixel_format: PixelFormat) -> CaptureImage

Parameters

pixels bytearray
in A buffer that contains image pixels.

width int
in The width, in pixels, of the image.

height int
in The height, in pixels, of the image.

stride int
in The stride, in pixels, of the image.

src_pixel_format PixelFormat
in The pixel format of the input image.

dst_pixel_format PixelFormat
in The pixel format into which to convert the input image.

Returns

The newly created capture image.

Exceptions

An error has occurred during Devices Library execution.
static CaptureImage fromRawBuffer(Uint8List? pixels, int width, int height, int stride, PixelFormat srcPixelFormat, PixelFormat dstPixelFormat)

Parameters

pixels Uint8List
in A buffer that contains image pixels.

width int
in The width, in pixels, of the image.

height int
in The height, in pixels, of the image.

stride int
in The stride, in pixels, of the image.

srcPixelFormat PixelFormat
in The pixel format of the input image.

dstPixelFormat PixelFormat
in The pixel format into which to convert the input image.

Returns

The newly created capture image.

Exceptions

An error has occurred during Devices Library execution.
public static CaptureImage FromRawBuffer(byte[] pixels, int width, int height, int stride, PixelFormat srcPixelFormat, PixelFormat dstPixelFormat)

Parameters

pixels byte[]
in A buffer that contains image pixels.

width int
in The width, in pixels, of the image.

height int
in The height, in pixels, of the image.

stride int
in The stride, in pixels, of the image.

srcPixelFormat PixelFormat
in The pixel format of the input image.

dstPixelFormat PixelFormat
in The pixel format into which to convert the input image.

Returns

The newly created capture image.

Exceptions

An error has occurred during Devices Library execution.
public static CaptureImage fromRawBuffer(byte[] pixels, int width, int height, int stride, PixelFormat srcPixelFormat, PixelFormat dstPixelFormat) throws DevicesException

Parameters

pixels byte[]
in A buffer that contains image pixels.

width int
in The width, in pixels, of the image.

height int
in The height, in pixels, of the image.

stride int
in The stride, in pixels, of the image.

srcPixelFormat PixelFormat
in The pixel format of the input image.

dstPixelFormat PixelFormat
in The pixel format into which to convert the input image.

Returns

The newly created capture image.

Exceptions

An error has occurred during Devices Library execution.
int id3DevicesCaptureImage_FromRawBuffer (
    ID3_DEVICES_CAPTURE_IMAGE hCaptureImage,
    unsigned char * pixels,
    int pixelsSize,
    int width,
    int height,
    int stride,
    id3DevicesPixelFormat eSrcPixelFormat,
    id3DevicesPixelFormat eDstPixelFormat)

Parameters

in Handle to the CaptureImage object.

pixels unsigned char *
in A buffer that contains image pixels.

pixelsSize int
in Size of the ‘pixels’ buffer.

width int
in The width, in pixels, of the image.

height int
in The height, in pixels, of the image.

stride int
in The stride, in pixels, of the image.

eSrcPixelFormat id3DevicesPixelFormat
in The pixel format of the input image.

eDstPixelFormat id3DevicesPixelFormat
in The pixel format into which to convert the input image.

Returns

int
An error code.
See id3DevicesError file for the list of possible error codes.