Image Class

Inherits: Base

Description

Image stores an image data and represents an image in memory.

Image raw data can be accessed as byte array. The width/height/stride information are also accessible.

Public Types

enum PixelFormat{Unknown, Gray, YUV_NV21, YUV_NV12, RGB888, BGR888, RGBA8888}

Public Properties

int Width
int Height
int Stride
PixelFormat Format
byte[] Pixels

enum PixelFormat

Constant

Value

Description

Unknown

0

The Unknown format.

Gray

1

The gray format.

YUV_NV21

2

The YUV (NV21) format.

YUV_NV12

3

The YUV (NV12) format.

RGB888

4

The RGB888 format.

BGR888

5

The BGR888 format.

RGBA8888

6

The RGBA8888 format.

int Width

Returns image width.

int Height

Returns image height.

int Stride

Returns image stride.

PixelFormat Format

Returns image format. Generally, you will get a YUV image from camera on mobile devices and BGR image from camera on desktop devices.

byte[] Pixels

Returns image raw data as a byte array.