CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
Internal Image API

The internal Image API. More...

Namespaces

namespace  coreflow
 The internal representation of a vx_array.
 

Macros

#define VX_PLANE_MAX   (4)
 The maximum number of 2d planes an image may have.
 

Enumerations

enum  vx_dim_e {
  VX_DIM_C = 0 ,
  VX_DIM_X ,
  VX_DIM_Y ,
  VX_DIM_MAX
}
 The dimensions enumeration, also stride enumerations. More...
 
enum  vx_bounds_e {
  VX_BOUND_START ,
  VX_BOUND_END ,
  VX_BOUND_MAX
}
 The bounds enumeration. More...
 

Functions

 coreflow::Image::Image (vx_context context, vx_reference ref)
 Construct a new Image object.
 
 coreflow::Image::~Image ()
 Destroy the Image object.
 
static vx_bool coreflow::Image::isValidImage (vx_image image)
 Used to validate the vx_image types.
 
static vx_image coreflow::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.
 
void coreflow::Image::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 coreflow::Image::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 coreflow::Image::allocateImage ()
 Used to allocate an image object.
 
static vx_bool coreflow::Image::isSupportedFourcc (vx_df_image code)
 Determines which VX_DF_IMAGE are supported in the sample implementation.
 
static vx_bool coreflow::Image::isValidDimensions (vx_uint32 width, vx_uint32 height, vx_df_image color)
 Validate image dimensions.
 
static vx_uint32 coreflow::Image::computePatchOffset (vx_uint32 x, vx_uint32 y, const vx_imagepatch_addressing_t *addr)
 Compute patch offset.
 
static vx_uint32 coreflow::Image::computePlaneOffset (vx_image image, vx_uint32 x, vx_uint32 y, vx_uint32 p)
 Compute plane offset.
 
static vx_uint32 coreflow::Image::computePatchRangeSize (vx_uint32 range, const vx_imagepatch_addressing_t *addr)
 Compute patch range size.
 
static vx_uint32 coreflow::Image::computePlaneRangeSize (vx_image image, vx_uint32 range, vx_uint32 p)
 Compute plane range size.
 
static vx_size coreflow::Image::sizeOfChannel (vx_df_image color)
 Size of color channel.
 
vx_uint32 coreflow::Image::wdth () const
 Get the width of the image.
 
vx_uint32 coreflow::Image::hght () const
 Get the height of the image.
 
vx_df_image coreflow::Image::fmt () const
 Get the format of the image.
 
vx_size coreflow::Image::numPlanes () const
 Get the number of planes in the image.
 
vx_enum coreflow::Image::colorSpace () const
 Get the color space of the image.
 
vx_enum coreflow::Image::colorRange () const
 Get the color range of the image.
 
vx_size coreflow::Image::size () const
 Get size of image.
 
vx_enum coreflow::Image::memoryType () const
 Get the memory type.
 
void coreflow::Image::setSpace (vx_enum value)
 Set the color space.
 
vx_status coreflow::Image::swapHandle (void *const new_ptrs[], void *prev_ptrs[], vx_size num_planes)
 Swap the handle of the image.
 
vx_status coreflow::Image::getValidRegion (vx_rectangle_t *rect)
 Get the Valid Region object.
 
vx_status coreflow::Image::setValidRect (const vx_rectangle_t *rect)
 Set the Valid Region object.
 
vx_status coreflow::Image::setPixelValues (const vx_pixel_value_t *pixel_value)
 Get the pixel values of the image.
 
vx_size coreflow::Image::computePatchSize (const vx_rectangle_t *rect, vx_uint32 plane_index)
 Compute the size of the patch in bytes.
 
vx_status coreflow::Image::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 coreflow::Image::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 coreflow::Image::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 coreflow::Image::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 coreflow::Image::unmapPatch (vx_map_id map_id)
 Unmap an image patch.
 
static void coreflow::Image::printImage (vx_image image)
 Prints the values of the images.
 
static void coreflow::Image::printImageAddressing (const vx_imagepatch_addressing_t *addr)
 Prints the addressing information of an image patch.
 
void coreflow::Image::freeImage ()
 Used to free an image object. Only the data is freed, not the meta-data structure.
 
void coreflow::Image::destruct () override final
 Destroys an image.
 

Detailed Description

The internal Image API.

Macro Definition Documentation

◆ VX_PLANE_MAX

#define VX_PLANE_MAX   (4)

#include <vx_internal.h>

The maximum number of 2d planes an image may have.

Enumeration Type Documentation

◆ vx_bounds_e

#include <vx_internal.h>

The bounds enumeration.

Enumerator
VX_BOUND_START 

The starting inclusive bound.

VX_BOUND_END 

The ending exclusive bound.

VX_BOUND_MAX 

[hidden] The maximum bound dimension

◆ vx_dim_e

enum vx_dim_e

#include <vx_internal.h>

The dimensions enumeration, also stride enumerations.

Enumerator
VX_DIM_C 

Channels dimension, stride.

VX_DIM_X 

Width (dimension) or x stride.

VX_DIM_Y 

Height (dimension) or y stride.

VX_DIM_MAX 

[hidden] The maximum number of dimensions

Function Documentation

◆ accessPatch()

vx_status coreflow::Image::accessPatch ( const vx_rectangle_t * rect,
vx_uint32 plane_index,
vx_imagepatch_addressing_t * addr,
void ** ptr,
vx_enum usage )

#include <vx_image.h>

Access the image patch.

Parameters
rectThe rectangle to access
plane_indexThe plane index to access
addrThe addressing information for the patch
ptrThe pointer to the user memory
usageThe usage of the memory (read/write)
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ allocateImage()

vx_bool coreflow::Image::allocateImage ( )

#include <vx_image.h>

Used to allocate an image object.

◆ colorRange()

vx_enum coreflow::Image::colorRange ( ) const

#include <vx_image.h>

Get the color range of the image.

Returns
vx_enum The color range of the image

◆ colorSpace()

vx_enum coreflow::Image::colorSpace ( ) const

#include <vx_image.h>

Get the color space of the image.

Returns
vx_enum The color space of the image

◆ commitPatch()

vx_status coreflow::Image::commitPatch ( const vx_rectangle_t * rect,
vx_uint32 plane_index,
const vx_imagepatch_addressing_t * addr,
const void * ptr )

#include <vx_image.h>

Commit the image patch.

Parameters
rectThe rectangle to commit
plane_indexThe plane index to commit
addrThe addressing information for the patch
ptrThe pointer to the user memory
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ computePatchOffset()

static vx_uint32 coreflow::Image::computePatchOffset ( vx_uint32 x,
vx_uint32 y,
const vx_imagepatch_addressing_t * addr )
static

#include <vx_image.h>

Compute patch offset.

Parameters
xx coord
yy coord
addrimage patch addressing
Returns
vx_uint32

◆ computePatchRangeSize()

static vx_uint32 coreflow::Image::computePatchRangeSize ( vx_uint32 range,
const vx_imagepatch_addressing_t * addr )
static

#include <vx_image.h>

Compute patch range size.

Parameters
rangerange
addrimage patch addressing
Returns
vx_uint32

◆ computePatchSize()

vx_size coreflow::Image::computePatchSize ( const vx_rectangle_t * rect,
vx_uint32 plane_index )

#include <vx_image.h>

Compute the size of the patch in bytes.

Parameters
rectThe rectangle to compute the size for
plane_indexThe plane index to compute the size for
Returns
vx_size The size in bytes

◆ computePlaneOffset()

static vx_uint32 coreflow::Image::computePlaneOffset ( vx_image image,
vx_uint32 x,
vx_uint32 y,
vx_uint32 p )
static

#include <vx_image.h>

Compute plane offset.

Parameters
imageimage
xx coord
yy coord
pplane index
Returns
vx_uint32

◆ computePlaneRangeSize()

static vx_uint32 coreflow::Image::computePlaneRangeSize ( vx_image image,
vx_uint32 range,
vx_uint32 p )
static

#include <vx_image.h>

Compute plane range size.

Parameters
imageimage
rangerange
pplane index
Returns
vx_uint32

◆ copyPatch()

vx_status coreflow::Image::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 )

#include <vx_image.h>

Copy the image patch to/from user memory.

Parameters
rectThe rectangle to copy
plane_indexThe plane index to copy
addrThe addressing information for the patch
ptrThe pointer to the user memory
usageThe usage of the memory (read/write)
mem_typeThe type of memory (host, opencl, etc.)
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ createImage()

static vx_image coreflow::Image::createImage ( vx_context context,
vx_uint32 width,
vx_uint32 height,
vx_df_image color,
vx_bool is_virtual = vx_false_e )
static

#include <vx_image.h>

Create a Image object.

Parameters
[in]contextcontext to associate image to
[in]widthwidth of image
[in]heightheight of image
[in]colorformat / color of image
[in]is_virtualindicate of object is virtual or not
Returns
vx_image

◆ destruct()

void coreflow::Image::destruct ( )
finaloverridevirtual

#include <vx_image.h>

Destroys an image.

Reimplemented from coreflow::Reference.

◆ fmt()

vx_df_image coreflow::Image::fmt ( ) const

#include <vx_image.h>

Get the format of the image.

Returns
vx_df_image The format of the image

◆ freeImage()

void coreflow::Image::freeImage ( )

#include <vx_image.h>

Used to free an image object. Only the data is freed, not the meta-data structure.

◆ getValidRegion()

vx_status coreflow::Image::getValidRegion ( vx_rectangle_t * rect)

#include <vx_image.h>

Get the Valid Region object.

Parameters
rectThe rectangle to fill with the valid region
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ hght()

vx_uint32 coreflow::Image::hght ( ) const

#include <vx_image.h>

Get the height of the image.

Returns
vx_uint32 The height in pixels

◆ Image()

coreflow::Image::Image ( vx_context context,
vx_reference ref )

#include <vx_image.h>

Construct a new Image object.

Parameters
contextThe context associated with this obj
refThe parent ref of this obj

◆ initImage()

void coreflow::Image::initImage ( vx_uint32 width,
vx_uint32 height,
vx_df_image color )

#include <vx_image.h>

Used to initialize the image meta-data structure with the correct values per the df_image code.

Parameters
[in]widthWidth in pixels
[in]heightHeight in pixels
[in]colorVX_DF_IMAGE color space.

◆ initPlane()

void coreflow::Image::initPlane ( vx_uint32 index,
vx_uint32 soc,
vx_uint32 channels,
vx_uint32 width,
vx_uint32 height )

#include <vx_image.h>

Used to initialize a single plane in an image object.

Parameters
[in]indexThe index to the plane.
[in]socThe unit size (size of pixel).
[in]channelsThe number of channels in the plane.
[in]widthThe width in pixels.
[in]heightThe height in pixels.

◆ isSupportedFourcc()

static vx_bool coreflow::Image::isSupportedFourcc ( vx_df_image code)
static

#include <vx_image.h>

Determines which VX_DF_IMAGE are supported in the sample implementation.

Parameters
[in]codeThe df_image code to test.
Return values
vx_bool
vx_true_eThe code is supported.
vx_false_eThe code is not supported.

◆ isValidDimensions()

static vx_bool coreflow::Image::isValidDimensions ( vx_uint32 width,
vx_uint32 height,
vx_df_image color )
static

#include <vx_image.h>

Validate image dimensions.

Parameters
widthwidth
heightheight
colorcolor
Returns
vx_bool

◆ isValidImage()

static vx_bool coreflow::Image::isValidImage ( vx_image image)
static

#include <vx_image.h>

Used to validate the vx_image types.

Parameters
[in]imageThe vx_image to validate.

◆ mapPatch()

vx_status coreflow::Image::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 )

#include <vx_image.h>

Used to map an image patch.

Parameters
[in]rectThe rectangle to map.
[in]plane_indexThe plane index to map.
[out]map_idThe map id to use.
[out]addrThe addressing information for the patch.
[out]ptrThe pointer to the mapped memory.
[in]usageThe usage of the memory (read/write).
[in]mem_typeThe type of memory (host, opencl, etc.).
[in]flagsAdditional flags for mapping.

◆ memoryType()

vx_enum coreflow::Image::memoryType ( ) const

#include <vx_image.h>

Get the memory type.

Returns
vx_enum The memory type

◆ numPlanes()

vx_size coreflow::Image::numPlanes ( ) const

#include <vx_image.h>

Get the number of planes in the image.

Returns
vx_uint32 The number of planes

◆ printImage()

static void coreflow::Image::printImage ( vx_image image)
static

#include <vx_image.h>

Prints the values of the images.

◆ printImageAddressing()

static void coreflow::Image::printImageAddressing ( const vx_imagepatch_addressing_t * addr)
static

#include <vx_image.h>

Prints the addressing information of an image patch.

Parameters
[in]addrThe addressing structure.

◆ setPixelValues()

vx_status coreflow::Image::setPixelValues ( const vx_pixel_value_t * pixel_value)

#include <vx_image.h>

Get the pixel values of the image.

Parameters
pixel_valueThe pixel value structure to fill
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ setSpace()

void coreflow::Image::setSpace ( vx_enum value)

#include <vx_image.h>

Set the color space.

Parameters
valueThe space value to set

◆ setValidRect()

vx_status coreflow::Image::setValidRect ( const vx_rectangle_t * rect)

#include <vx_image.h>

Set the Valid Region object.

Parameters
rectThe rectangle to set as the valid region
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ size()

vx_size coreflow::Image::size ( ) const

#include <vx_image.h>

Get size of image.

Returns
vx_size The size in bytes

◆ sizeOfChannel()

static vx_size coreflow::Image::sizeOfChannel ( vx_df_image color)
static

#include <vx_image.h>

Size of color channel.

Parameters
colorcolor
Returns
vx_size

◆ swapHandle()

vx_status coreflow::Image::swapHandle ( void *const new_ptrs[],
void * prev_ptrs[],
vx_size num_planes )

#include <vx_image.h>

Swap the handle of the image.

Parameters
new_ptrsThe new pointers to the image planes
prev_ptrsThe previous pointers to the image planes
num_planesThe number of planes in the image
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ unmapPatch()

vx_status coreflow::Image::unmapPatch ( vx_map_id map_id)

#include <vx_image.h>

Unmap an image patch.

Parameters
map_idThe map id to unmap
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ wdth()

vx_uint32 coreflow::Image::wdth ( ) const

#include <vx_image.h>

Get the width of the image.

Returns
vx_uint32 The width in pixels

◆ ~Image()

coreflow::Image::~Image ( )

#include <vx_image.h>

Destroy the Image object.