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
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
void sc_image_description_retain | ( | ScImageDescription * | description | ) |
Increase reference count of image description by one.
- Parameters
-
description The 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
-
description the description object. May be null.
- Since
- 4.6.0
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
-
description the 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
-
description the description object. Must not be null layout the new image layout
- See also
- sc_image_description_get_layout
- Since
- 4.6.0
uint32_t sc_image_description_get_width | ( | ScImageDescription const * | description | ) |
Get width of image.
- Parameters
-
description the 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
-
description the description object. Must not be null width width in pixels
- Since
- 4.6.0
uint32_t sc_image_description_get_height | ( | ScImageDescription const * | description | ) |
Get height of image.
- Parameters
-
description the 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
-
description the description object. Must not be null height height in pixels
- Since
- 4.6.0
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
-
description the description object. Must not be null
- Returns
- number of planes in the image or zero on error
- 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
-
description the description object. Must not be null. plane_index the 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
-
description The description object. Must not be null. plane_index the index of the data plane. Must be less than sc_image_description_get_planes_count
.offset The 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
-
description the description object. Must not be null plane_index the 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
-
description The description object. Must not be null. plane_index the index of the data plane. Must be less than sc_image_description_get_planes_count
.row_bytes The number of bytes.
- Since
- 7.0.0
The documentation for this struct was generated from the following file: