ScImageDescription Struct Reference

Public Member Functions

ScImageDescriptionsc_image_description_new (void)
 
void sc_image_description_retain (ScImageDescription *description)
 
void sc_image_description_release (ScImageDescription *description)
 
ScImageLayout sc_image_description_get_layout (ScImageDescription const *description)
 
void sc_image_description_set_layout (ScImageDescription *description, ScImageLayout layout)
 
uint32_t sc_image_description_get_width (ScImageDescription const *description)
 
void sc_image_description_set_width (ScImageDescription *description, uint32_t width)
 
uint32_t sc_image_description_get_height (ScImageDescription const *description)
 
void sc_image_description_set_height (ScImageDescription *description, uint32_t height)
 
uint32_t sc_image_description_get_first_plane_offset (ScImageDescription const *description)
 
void sc_image_description_set_first_plane_offset (ScImageDescription *description, uint32_t offset)
 
uint32_t sc_image_description_get_first_plane_row_bytes (ScImageDescription const *description)
 
void sc_image_description_set_first_plane_row_bytes (ScImageDescription *description, uint32_t row_bytes)
 
uint32_t sc_image_description_get_second_plane_row_bytes (ScImageDescription const *description)
 
void sc_image_description_set_second_plane_row_bytes (ScImageDescription *description, uint32_t row_bytes)
 
uint32_t sc_image_description_get_second_plane_offset (ScImageDescription const *description)
 
void sc_image_description_set_second_plane_offset (ScImageDescription *description, uint32_t offset)
 
uint32_t sc_image_description_get_memory_size (ScImageDescription const *description)
 
void sc_image_description_set_memory_size (ScImageDescription *description, uint32_t memory_size)
 

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 (SC_IMAGE_LAYOUT_YPCRCB_8U, SC_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:

Since
4.6.0
Examples:
CommandLineBarcodeScannerCameraSample.c, CommandLineBarcodeScannerImageProcessingSample.c, and CommandLineMatrixScanCameraSample.c.

Member Function Documentation

ScImageDescription * sc_image_description_new ( void  )

Create a new image description.

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

Returns
the newly created image description. After use, the image description must be released with sc_image_description_release().
Since
4.6.0
Examples:
CommandLineBarcodeScannerCameraSample.c, CommandLineBarcodeScannerImageProcessingSample.c, and CommandLineMatrixScanCameraSample.c.
void sc_image_description_retain ( ScImageDescription description)

Increase reference count of image description by one.

Parameters
descriptionThe image description object. Must not be null.
Since
4.6.0
void sc_image_description_release ( ScImageDescription description)

Decrease reference count of image description by one.

When the reference count drops to zero, the image description is deallocated.

Parameters
descriptionthe description object. May be null.
Since
4.6.0
Examples:
CommandLineBarcodeScannerCameraSample.c, CommandLineBarcodeScannerImageProcessingSample.c, and CommandLineMatrixScanCameraSample.c.
ScImageLayout sc_image_description_get_layout ( ScImageDescription const *  description)

Get the image layout.

The image layout describes the format of the pixel data. All values of ScImageLayout are accepted.

The default format is SC_IMAGE_LAYOUT_UNKNOWN.

Parameters
descriptionthe description object. Must not be null
Returns
returns the image description's image layout
The image currently set image layout.
Since
4.6.0
void sc_image_description_set_layout ( ScImageDescription description,
ScImageLayout  layout 
)

Set the image layout.

Parameters
descriptionthe description object. Must not be null
layoutthe new image layout
See also
sc_image_description_get_layout
Since
4.6.0
Examples:
CommandLineBarcodeScannerImageProcessingSample.c.
uint32_t sc_image_description_get_width ( ScImageDescription const *  description)

Get width of image.

Parameters
descriptionthe description object. Must not be null
Returns
The width of the image in pixels.
Since
4.6.0
void sc_image_description_set_width ( ScImageDescription description,
uint32_t  width 
)

Set width of image.

Parameters
descriptionthe description object. Must not be null
widthwidth in pixels
Since
4.6.0
Examples:
CommandLineBarcodeScannerImageProcessingSample.c.
uint32_t sc_image_description_get_height ( ScImageDescription const *  description)

Get height of image.

Parameters
descriptionthe description object. Must not be null
Returns
The height of the image in pixels.
Since
4.6.0
void sc_image_description_set_height ( ScImageDescription description,
uint32_t  height 
)

Set height of image.

Parameters
descriptionthe description object. Must not be null
heightheight in pixels
Since
4.6.0
Examples:
CommandLineBarcodeScannerImageProcessingSample.c.
uint32_t sc_image_description_get_first_plane_offset ( ScImageDescription const *  description)

Get start offset of the first data plane.

Parameters
descriptionthe description object. Must not be null.
Returns
The start offset of the first data plane.
Since
4.6.0
void sc_image_description_set_first_plane_offset ( ScImageDescription description,
uint32_t  offset 
)

Set the start offset of the first data plane.

Parameters
descriptionThe description object. Must not be null.
offsetThe offset as measured from the beginning of the data buffer.
Since
4.6.0
uint32_t sc_image_description_get_first_plane_row_bytes ( ScImageDescription const *  description)

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

Parameters
descriptionthe description object. Must not be null
Returns
The number of bytes per row.
Since
4.6.0
void sc_image_description_set_first_plane_row_bytes ( ScImageDescription description,
uint32_t  row_bytes 
)

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

Parameters
descriptionThe description object. Must not be null.
row_bytesThe number of bytes.
Since
4.6.0
Examples:
CommandLineBarcodeScannerImageProcessingSample.c.
uint32_t sc_image_description_get_second_plane_row_bytes ( ScImageDescription const *  description)

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

Parameters
descriptionthe description object. Must not be null
Returns
The number of bytes per row of the second plane
Since
4.6.0
void sc_image_description_set_second_plane_row_bytes ( ScImageDescription description,
uint32_t  row_bytes 
)

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

Parameters
descriptionThe description object. Must not be null.
row_bytesthe number of bytes per row.
Since
4.6.0
uint32_t sc_image_description_get_second_plane_offset ( ScImageDescription const *  description)

Get the start offset of the second data plane.

Parameters
descriptionThe description object. Must not be null.
Returns
The start offset of the second data plane.
Since
4.6.0
void sc_image_description_set_second_plane_offset ( ScImageDescription description,
uint32_t  offset 
)

Set the start offset of the second data plane.

Parameters
descriptionThe description object. Must not be null.
offsetThe number of bytes per row.
Since
4.6.0
uint32_t sc_image_description_get_memory_size ( ScImageDescription const *  description)

Get the total memory size of the frame data.

Parameters
descriptionthe description object. Must not be null
Returns
The total size of the image buffer in bytes.
Since
4.6.0
void sc_image_description_set_memory_size ( ScImageDescription description,
uint32_t  memory_size 
)

Set the total memory size of the frame data.

Parameters
descriptionThe description object. Must not be null.
memory_sizeThe total memory size of the frame data.
Since
4.6.0
Examples:
CommandLineBarcodeScannerImageProcessingSample.c.

The documentation for this struct was generated from the following file: