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_planes_count (ScImageDescription const *description)
 
ptrdiff_t sc_image_description_get_plane_offset (ScImageDescription const *description, uint32_t plane_index)
 
void sc_image_description_set_plane_offset (ScImageDescription *description, uint32_t plane_index, ptrdiff_t offset)
 
uint32_t sc_image_description_get_plane_row_bytes (ScImageDescription const *description, uint32_t plane_index)
 
void sc_image_description_set_plane_row_bytes (ScImageDescription *description, uint32_t plane_index, uint32_t row_bytes)
 

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_planes_count ( ScImageDescription const *  description)

Get a number of non-interleaved image data planes according to the image layout. Image data planes either reside in a single contiguous buffer or each plane has its own.

Parameters
descriptionthe description object. Must not be null
Since
7.0.0
ptrdiff_t sc_image_description_get_plane_offset ( ScImageDescription const *  description,
uint32_t  plane_index 
)

Get an offset of the first pixel value of the selected data plane relative to the start of the corresponding image frame buffer.

Parameters
descriptionthe description object. Must not be null.
plane_indexthe index of the data plane. Must be less than sc_image_description_get_planes_count.
Returns
The start offset of the selected data plane relative to the image buffer.
Since
7.0.0
void sc_image_description_set_plane_offset ( ScImageDescription description,
uint32_t  plane_index,
ptrdiff_t  offset 
)

Set the start offset of the selected data plane relative to the image buffer start.

Parameters
descriptionThe description object. Must not be null.
plane_indexthe index of the data plane. Must be less than sc_image_description_get_planes_count.
offsetThe offset as measured from the beginning of the data buffer.
Since
7.0.0
uint32_t sc_image_description_get_plane_row_bytes ( ScImageDescription const *  description,
uint32_t  plane_index 
)

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

Parameters
descriptionthe description object. Must not be null
plane_indexthe index of the data plane. Must be less than sc_image_description_get_planes_count.
Returns
The number of bytes per row.
Since
7.0.0
void sc_image_description_set_plane_row_bytes ( ScImageDescription description,
uint32_t  plane_index,
uint32_t  row_bytes 
)

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

Parameters
descriptionThe description object. Must not be null.
plane_indexthe index of the data plane. Must be less than sc_image_description_get_planes_count.
row_bytesThe number of bytes.
Since
7.0.0
Examples:
CommandLineBarcodeScannerImageProcessingSample.c.

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