ImageDescription Class Reference

Inherits NativeHandle.

Public Member Functions

 ImageDescription ()
 
void setWidth (int width)
 
int getWidth ()
 
int getHeight ()
 
void setHeight (int height)
 
int getFirstPlaneOffset ()
 
void setFirstPlaneOffset (int offset)
 
int getFirstPlaneRowBytes ()
 
void setFirstPlaneRowBytes (int bytesPerRow)
 
int getSecondPlaneOffset ()
 
void setSecondPlaneOffset (int offset)
 
int getSecondPlaneRowBytes ()
 
void setSecondPlaneByteRowBytes (int bytesPerRow)
 
void setLayout (int layout)
 
int getLayout ()
 
long getMemorySize ()
 
void setMemorySize (int bufferSize)
 

Static Public Attributes

Image Layouts (Pixel Formats)
static final int IMAGE_LAYOUT_UNKNOWN
 
static final int IMAGE_LAYOUT_GRAY_8U
 
static final int IMAGE_LAYOUT_RGB_8U
 
static final int IMAGE_LAYOUT_RGBA_8U
 
static final int IMAGE_LAYOUT_ARGB_8U
 
static final int IMAGE_LAYOUT_YPCBCR_8U
 
static final int IMAGE_LAYOUT_YPCRCB_8U
 
static final int IMAGE_LAYOUT_YUYV_8U
 

Detailed Description

Describes dimensions as well as internal memory layout of an image buffer.

Depending on the image layout different properties must be set. All image layouts require at least width, height and memory size. Bi-planar formats (IMAGE_LAYOUT_YPCRCB_8U, IMAGE_LAYOUT_YPCBCR_8U) additionally require bytes per row as well as data plane offsets for both planes.

The following code snippet shows how to create an image description for an 8-bit grey-scale image:

desc.setWidth(640);
desc.setHeight(480);
desc.setMemorySize(640 * 480);
desc.setLayout(ImageDescription.IMAGE_LAYOUT_GRAY_8U);
Since
4.7.0

Constructor & Destructor Documentation

Create a new image description.

All fields are initialized to zero and the image layout set to IMAGE_LAYOUT_UNKNOWN.

Since
4.7.0

Member Function Documentation

void setWidth ( int  width)

Set width of image.

Parameters
widthwidth in pixels
Since
4.7.0
int getWidth ( )

Get width of image.

Returns
The width of the image in pixels.
Since
4.7.0
int getHeight ( )

Get height of image.

Returns
The height of the image in pixels.
Since
4.7.0
void setHeight ( int  height)

Set height of image.

Parameters
heightheight in pixels
Since
4.7.0
int getFirstPlaneOffset ( )

Get start offset of the first data plane.

Returns
The start offset of the first data plane.
Since
4.7.0
void setFirstPlaneOffset ( int  offset)

Set the start offset of the first data plane.

Parameters
offsetThe offset as measured from the beginning of the data buffer.
Since
4.7.0
int getFirstPlaneRowBytes ( )

Get the number of bytes per row for the first data plane.

Returns
The number of bytes per row.
Since
4.7.0
void setFirstPlaneRowBytes ( int  bytesPerRow)

Set the number of bytes per row for first data plane.

Parameters
bytesPerRowThe number of bytes.
Since
4.7.0
int getSecondPlaneOffset ( )

Get the start offset of the second data plane.

Returns
The start offset of the second data plane.
Since
4.7.0
void setSecondPlaneOffset ( int  offset)

Set the start offset of the second data plane.

Parameters
offsetThe number of bytes per row.
Since
4.7.0
int getSecondPlaneRowBytes ( )

Get the number of bytes per row for the second data plane.

Returns
The number of bytes per row of the second plane
Since
4.7.0
void setSecondPlaneByteRowBytes ( int  bytesPerRow)

Set the number of bytes per row for the second data plane.

Parameters
bytesPerRowthe number of bytes per row.
Since
4.7.0
void setLayout ( int  layout)

Set the image layout.

Parameters
layoutthe new image layout
See also
getLayout()
Since
4.7.0
int getLayout ( )

Get the image layout.

The image layout describes the format of the pixel data.

The default format is IMAGE_LAYOUT_UNKNOWN.

Returns
returns the image description's image layout
Since
4.7.0
long getMemorySize ( )

Get the total memory size of the frame data.

Returns
The total size of the image buffer in bytes.
Since
4.7.0
void setMemorySize ( int  bufferSize)

Set the total memory size of the frame data.

Parameters
bufferSizeThe total memory size of the frame data.
Since
4.7.0

Member Data Documentation

final int IMAGE_LAYOUT_UNKNOWN
static

Image layout is unknown.

final int IMAGE_LAYOUT_GRAY_8U
static

Single-channel 8-bit gray scale image.

When using this pixel layout the width/height and memory size properties of the ImageDescription must be set.

final int IMAGE_LAYOUT_RGB_8U
static

RGB image with 8bit per color channel.

When using this pixel layout the width/height and memory size properties of the ImageDescription must be set.

final int IMAGE_LAYOUT_RGBA_8U
static

RGBA image with 8bit per color channel.

When using this pixel layout the width/height and memory size properties of the ImageDescription must be set.

final int IMAGE_LAYOUT_ARGB_8U
static

ARGB image with 8bit per color channel.

When using this pixel layout the width/height and memory size properties of the ImageDescription must be set.

Since
5.6.0
final int IMAGE_LAYOUT_YPCBCR_8U
static

YpCbCr 4:2:0 image format.

A bi-planar format with separate Y and CbCr planes.

When using this pixel layout the width, height, memory size as well as the number of bytes per row and the offsets of both data planes must be set.

final int IMAGE_LAYOUT_YPCRCB_8U
static

YpCrCb 4:2:0 image format.

A bi-planar format with separate Y and CrCb planes.

When using this pixel layout the width, height, memory size as well as the number of bytes per row and the offsets of both data planes must be set.

final int IMAGE_LAYOUT_YUYV_8U
static

8-bit YUYV 4:2:2 image format.

The Y, U and V samples are packed together in one image plane. UV are shared between two adjacent pixels in a row.

When using this pixel layout the width/height and memory size properties of the ImageDescription must be set.


The documentation for this class was generated from the following file:
  • ImageDescription.java