CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
coreflow::Image Class Reference

#include <vx_image.h>

Inheritance diagram for coreflow::Image:
coreflow::Reference

Public Member Functions

 Image (vx_context context, vx_reference ref)
 Construct a new Image object.
 
 ~Image ()
 Destroy the Image object.
 
void initPlane (vx_uint32 index, vx_uint32 soc, vx_uint32 channels, vx_uint32 width, vx_uint32 height)
 Used to initialize a single plane in an image object.
 
void initImage (vx_uint32 width, vx_uint32 height, vx_df_image color)
 Used to initialize the image meta-data structure with the correct values per the df_image code.
 
vx_bool allocateImage ()
 Used to allocate an image object.
 
vx_uint32 wdth () const
 Get the width of the image.
 
vx_uint32 hght () const
 Get the height of the image.
 
vx_df_image fmt () const
 Get the format of the image.
 
vx_size numPlanes () const
 Get the number of planes in the image.
 
vx_enum colorSpace () const
 Get the color space of the image.
 
vx_enum colorRange () const
 Get the color range of the image.
 
vx_size size () const
 Get size of image.
 
vx_enum memoryType () const
 Get the memory type.
 
void setSpace (vx_enum value)
 Set the color space.
 
vx_status swapHandle (void *const new_ptrs[], void *prev_ptrs[], vx_size num_planes)
 Swap the handle of the image.
 
vx_status getValidRegion (vx_rectangle_t *rect)
 Get the Valid Region object.
 
vx_status setValidRect (const vx_rectangle_t *rect)
 Set the Valid Region object.
 
vx_status setPixelValues (const vx_pixel_value_t *pixel_value)
 Get the pixel values of the image.
 
vx_size computePatchSize (const vx_rectangle_t *rect, vx_uint32 plane_index)
 Compute the size of the patch in bytes.
 
vx_status accessPatch (const vx_rectangle_t *rect, vx_uint32 plane_index, vx_imagepatch_addressing_t *addr, void **ptr, vx_enum usage)
 Access the image patch.
 
vx_status commitPatch (const vx_rectangle_t *rect, vx_uint32 plane_index, const vx_imagepatch_addressing_t *addr, const void *ptr)
 Commit the image patch.
 
vx_status copyPatch (const vx_rectangle_t *rect, vx_uint32 plane_index, const vx_imagepatch_addressing_t *addr, void *ptr, vx_enum usage, vx_enum mem_type)
 Copy the image patch to/from user memory.
 
vx_status mapPatch (const vx_rectangle_t *rect, vx_uint32 plane_index, vx_map_id *map_id, vx_imagepatch_addressing_t *addr, void **ptr, vx_enum usage, vx_enum mem_type, vx_uint32 flags)
 Used to map an image patch.
 
vx_status unmapPatch (vx_map_id map_id)
 Unmap an image patch.
 
void freeImage ()
 Used to free an image object. Only the data is freed, not the meta-data structure.
 
void destruct () override final
 Destroys an image.
 
vx_uint32 refCount () const
 Returns the reference count of the object.
 
vx_enum dataType () const
 Returns the type of the reference.
 
const vx_charrefName () const
 Returns the name of the reference.
 
void setName (const vx_char *name)
 Sets the name of the reference.
 
vx_uint32 incrementReference (vx_reftype_e refType)
 Increments the ref count.
 
vx_uint32 decrementReference (vx_reftype_e refType)
 Decrements the ref count.
 
vx_uint32 totalReferenceCount ()
 Returns the total reference count of the object.
 
void initReferenceForDelay (vx_delay delay, vx_int32 index)
 Used to initialize any vx_reference as a delay element.
 

Static Public Member Functions

static vx_bool isValidImage (vx_image image)
 Used to validate the vx_image types.
 
static vx_image createImage (vx_context context, vx_uint32 width, vx_uint32 height, vx_df_image color, vx_bool is_virtual=vx_false_e)
 Create a Image object.
 
static vx_bool isSupportedFourcc (vx_df_image code)
 Determines which VX_DF_IMAGE are supported in the sample implementation.
 
static vx_bool isValidDimensions (vx_uint32 width, vx_uint32 height, vx_df_image color)
 Validate image dimensions.
 
static vx_uint32 computePatchOffset (vx_uint32 x, vx_uint32 y, const vx_imagepatch_addressing_t *addr)
 Compute patch offset.
 
static vx_uint32 computePlaneOffset (vx_image image, vx_uint32 x, vx_uint32 y, vx_uint32 p)
 Compute plane offset.
 
static vx_uint32 computePatchRangeSize (vx_uint32 range, const vx_imagepatch_addressing_t *addr)
 Compute patch range size.
 
static vx_uint32 computePlaneRangeSize (vx_image image, vx_uint32 range, vx_uint32 p)
 Compute plane range size.
 
static vx_size sizeOfChannel (vx_df_image color)
 Size of color channel.
 
static void printImage (vx_image image)
 Prints the values of the images.
 
static void printImageAddressing (const vx_imagepatch_addressing_t *addr)
 Prints the addressing information of an image patch.
 
static vx_reference createReference (vx_context context, vx_enum type, vx_reftype_e refType, vx_reference scope)
 Used to create a reference.
 
static void printReference (vx_reference ref)
 Prints the values of a reference.
 
static vx_bool isValidReference (vx_reference ref)
 Used to validate everything but vx_context, vx_image and vx_buffer.
 
static vx_bool isValidReference (vx_reference ref, vx_enum type)
 Used to validate everything but vx_context, vx_image and vx_buffer.
 
static vx_size sizeOfType (vx_enum type)
 Returns the number of bytes in the internal structure for a given type.
 
static vx_status releaseReference (vx_reference *ref, vx_enum type, vx_reftype_e reftype, vx_destructor_f special_destructor)
 Used to destroy a reference.
 

Public Attributes

vx_memory_t memory
 The memory layout definition.
 
vx_uint32 width
 Width of the Image in Pixels.
 
vx_uint32 height
 Height of the Image in Pixels.
 
vx_df_image format
 Format of the Image in VX_DF_IMAGE codes.
 
vx_uint32 planes
 The number of active planes.
 
vx_enum space
 The constants space (BT601 or BT709)
 
vx_enum range
 The desired color range.
 
vx_uint32 scale [VX_PLANE_MAX][VX_DIM_MAX]
 The sub-channel scaling for each plane.
 
vx_uint32 bounds [VX_PLANE_MAX][VX_DIM_MAX][VX_BOUND_MAX]
 The per-plane, per-dimension bounds (start, end).
 
vx_image parent
 A pointer to a parent image object.
 
vx_image subimages [VX_INT_MAX_REF]
 The array of ROIs from this image.
 
vx_bool constant
 Indicates if the image is constant.
 
vx_rectangle_t region
 The valid region.
 
vx_enum memory_type
 The memory type.
 
struct _vx_platform * platform
 Platform for ICD compatibility.
 
vx_uint32 magic
 Used to validate references, must be set to VX_MAGIC.
 
vx_enum type
 Set to an enum value in vx_type_e.
 
vx_context context
 Pointer to the top level context. If this reference is the context, this will be NULL.
 
vx_reference scope
 The pointer to the object's scope parent. When virtual objects are scoped within a graph, this will point to that parent graph. This is left generic to allow future scoping variations. By default scope should be the same as context.
 
vx_uint32 external_count
 The count of the number of users with this reference. When greater than 0, this can not be freed. When zero, the value can be considered inaccessible.
 
vx_uint32 internal_count
 The count of the number of framework references. When greater than 0, this can not be freed.
 
vx_uint32 read_count
 The number of times the object has been read (in some portion)
 
vx_uint32 write_count
 The number of times the object has been written to (in some portion)
 
vx_sem_t lock
 The reference lock which is used to protect access to "in-fly" data.
 
void * reserved
 A reserved field which can be used to store anonymous data.
 
vx_uint32 index
 A field which can be used to store a temporary, per-graph index.
 
vx_bool extracted
 This indicates if the object was extracted from another object.
 
vx_bool is_virtual
 This indicates if the object is virtual or not.
 
vx_delay delay
 
vx_int32 delay_slot_index
 
vx_bool is_accessible
 This indicates that if the object is virtual whether it is accessible at the moment or not.
 
vx_char name [VX_MAX_REFERENCE_NAME]
 The reference name.
 

Member Data Documentation

◆ bounds

vx_uint32 coreflow::Image::bounds[VX_PLANE_MAX][VX_DIM_MAX][VX_BOUND_MAX]

The per-plane, per-dimension bounds (start, end).

◆ constant

vx_bool coreflow::Image::constant

Indicates if the image is constant.

◆ context

vx_context coreflow::Reference::context
inherited

Pointer to the top level context. If this reference is the context, this will be NULL.

◆ delay

vx_delay coreflow::Reference::delay
inherited

◆ delay_slot_index

vx_int32 coreflow::Reference::delay_slot_index
inherited

◆ external_count

vx_uint32 coreflow::Reference::external_count
inherited

The count of the number of users with this reference. When greater than 0, this can not be freed. When zero, the value can be considered inaccessible.

◆ extracted

vx_bool coreflow::Reference::extracted
inherited

This indicates if the object was extracted from another object.

◆ format

vx_df_image coreflow::Image::format

Format of the Image in VX_DF_IMAGE codes.

◆ height

vx_uint32 coreflow::Image::height

Height of the Image in Pixels.

◆ index

vx_uint32 coreflow::Reference::index
inherited

A field which can be used to store a temporary, per-graph index.

◆ internal_count

vx_uint32 coreflow::Reference::internal_count
inherited

The count of the number of framework references. When greater than 0, this can not be freed.

◆ is_accessible

vx_bool coreflow::Reference::is_accessible
inherited

This indicates that if the object is virtual whether it is accessible at the moment or not.

◆ is_virtual

vx_bool coreflow::Reference::is_virtual
inherited

This indicates if the object is virtual or not.

◆ lock

vx_sem_t coreflow::Reference::lock
inherited

The reference lock which is used to protect access to "in-fly" data.

◆ magic

vx_uint32 coreflow::Reference::magic
inherited

Used to validate references, must be set to VX_MAGIC.

◆ memory

vx_memory_t coreflow::Image::memory

The memory layout definition.

◆ memory_type

vx_enum coreflow::Image::memory_type

The memory type.

◆ name

vx_char coreflow::Reference::name[VX_MAX_REFERENCE_NAME]
inherited

The reference name.

◆ parent

vx_image coreflow::Image::parent

A pointer to a parent image object.

◆ planes

vx_uint32 coreflow::Image::planes

The number of active planes.

◆ platform

struct _vx_platform* coreflow::Reference::platform
inherited

Platform for ICD compatibility.

◆ range

vx_enum coreflow::Image::range

The desired color range.

◆ read_count

vx_uint32 coreflow::Reference::read_count
inherited

The number of times the object has been read (in some portion)

◆ region

vx_rectangle_t coreflow::Image::region

The valid region.

◆ reserved

void* coreflow::Reference::reserved
inherited

A reserved field which can be used to store anonymous data.

◆ scale

vx_uint32 coreflow::Image::scale[VX_PLANE_MAX][VX_DIM_MAX]

The sub-channel scaling for each plane.

◆ scope

vx_reference coreflow::Reference::scope
inherited

The pointer to the object's scope parent. When virtual objects are scoped within a graph, this will point to that parent graph. This is left generic to allow future scoping variations. By default scope should be the same as context.

◆ space

vx_enum coreflow::Image::space

The constants space (BT601 or BT709)

◆ subimages

vx_image coreflow::Image::subimages[VX_INT_MAX_REF]

The array of ROIs from this image.

◆ type

vx_enum coreflow::Reference::type
inherited

Set to an enum value in vx_type_e.

◆ width

vx_uint32 coreflow::Image::width

Width of the Image in Pixels.

◆ write_count

vx_uint32 coreflow::Reference::write_count
inherited

The number of times the object has been written to (in some portion)