Perception Tool Kit (PTK) API Guide

Introduction

Collaboration diagram for PTK Grid:

Data Structures

struct  PTK_GridConfig
 Grid configuration. More...
 
struct  PTK_GridMetaData
 Grid Meta Data. More...
 
struct  PTK_Grid
 Grid definition. More...
 
struct  PTK_GridRoi
 Defines a rectangle in a target coordinate system. In local coordinate system, the vertices are (0|0), (xWidth|0), (xWidth|yWidth), (0|yWidth). More...
 

Functions

uint32_t PTK_Grid_getSize (const PTK_GridConfig *config)
 Compute how much memory is required to store the complete PTK Grid described by the given configuration struct. More...
 
PTK_GridPTK_Grid_init (uint8_t *mem, const PTK_GridConfig *config)
 Initialize an externally allocated piece of memory to be a valid PTK Grid instance. More...
 
static void PTK_Grid_clear (PTK_Grid *og)
 This clears a PTK_Grid, resetting all cell contents back to 0, including user data types. If a nonzero default value is required for user types, PTK_Grid userClear is recommended. More...
 
static uint32_t PTK_Grid_userClear (PTK_Grid *og, void *def)
 This clears a PTK Grid that is storing user data, resetting it to the default data supplied. The size of the default data is propagated from the existing definition for user data size already known to the PTK_Grid. Note that this function may be significantly slower than PTK_Grid clear due to implementation constraints. More...
 
static uint32_t PTK_Grid_copy (PTK_Grid *__restrict dst, const PTK_Grid *__restrict src)
 Copy data from the given source PTK Grid to the destination PTK_Grid. The two must have the same configuration and be of the same type, or the results will be undefined. More...
 
static uint32_t PTK_Grid_getXCell (const PTK_Grid *og, float x)
 This converts a real-valued x coordinate given in meters to an index for the grid access function. If the x coordinate is invalid (< the origin x coordinate or the total number of cells in the x direction), PTK_GRID_CELL_INVALID is produced instead. More...
 
static uint32_t PTK_Grid_getYCell (const PTK_Grid *og, float y)
 This converts a real-valued y coordinate given in meters to an index for the grid access function. If the y coordinate is invalid (< the origin y coordinate or the total number of cells in the y direction), PTK_GRID_CELL_INVALID is produced instead. More...
 
static uint32_t PTK_Grid_getZCell (const PTK_Grid *og, float z)
 This converts a real-valued z coordinate given in meters to an index for the grid access function. If the z coordinate is invalid (< the origin z coordinate or the total number of cells in the z direction), PTK_GRID_CELL_INVALID is produced instead. More...
 
static uint32_t PTK_Grid_getLinearIndex2d (const PTK_Grid *og, uint32_t x, uint32_t y)
 This is a mostly-internal function that is used for converting a pair of integer cell indices into a single linear index that is then used with the backing storage internal to the PTK_Grid. It handles the storage order (row-major vs. column-major) as necessary and makes the assumption that z coordinates are entirely unused. More...
 
static uint32_t PTK_Grid_getLinearIndex3d (const PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z)
 This is a mostly-internal function that is used for converting a triple of integer cell indices into a single linear index that is used with the backing storage internal to the PTK_Grid. It handles the storage order (row-, column-, or tube-major) as necessary. More...
 
static float PTK_Grid_getX (const PTK_Grid *og, uint32_t x)
 
static float PTK_Grid_getY (const PTK_Grid *og, uint32_t y)
 
static float PTK_Grid_getZ (const PTK_Grid *og, uint32_t z)
 
static void PTK_Grid_setf2d (PTK_Grid *og, uint32_t x, uint32_t y, float value)
 Sets the data of type PTK_GRID_TYPE_FLOAT in the specified cell. More...
 
static void PTK_Grid_setu2d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t value)
 Sets the data of type PTK_GRID_TYPE_UINT32 in the specified cell. More...
 
static void PTK_Grid_setb2d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t bits)
 Sets the data of type PTK_GRID_TYPE_BITS in the specified cell. More...
 
static float PTK_Grid_getf2d (const PTK_Grid *og, uint32_t x, uint32_t y)
 Returns the data of type PTK_GRID_TYPE_FLOAT in the specified cell. More...
 
static uint32_t PTK_Grid_getu2d (const PTK_Grid *og, uint32_t x, uint32_t y)
 Returns the data of type PTK_GRID_TYPE_UINT32 in the specified cell. More...
 
static uint32_t PTK_Grid_getb2d (const PTK_Grid *og, uint32_t x, uint32_t y)
 Returns the data of type PTK_GRID_TYPE_BITS in the specified cell. More...
 
static void PTK_Grid_setf3d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z, float value)
 Sets the data of type PTK_GRID_TYPE_FLOAT in the specified cell. More...
 
static void PTK_Grid_setu3d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z, uint32_t value)
 Sets the data of type PTK_GRID_TYPE_UINT32 in the specified cell. More...
 
static void PTK_Grid_setb3d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z, uint32_t bits)
 Sets the data of type PTK_GRID_TYPE_BITS in the specified cell. More...
 
static float PTK_Grid_getf3d (const PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z)
 Returns the data of type PTK_GRID_TYPE_FLOAT in the specified cell. More...
 
static uint32_t PTK_Grid_getu3d (const PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z)
 Returns the data of type PTK_GRID_TYPE_UINT32 in the specified cell. More...
 
static uint32_t PTK_Grid_getb3d (const PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z)
 Returns the data of type PTK_GRID_TYPE_BITS in the specified cell. More...
 
static uint32_t PTK_Grid_anyb2d (const PTK_Grid *og, uint32_t x, uint32_t y, uint32_t bits)
 Tests if the flags set for the specified cell contain any of the given flags values. Returns 1 if any of the flags match. More...
 
static uint32_t PTK_Grid_anyb3d (const PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z, uint32_t bits)
 Tests if the flags set for the specified cell contain any of the given flags values. Returns 1 if any of the flags match. More...
 
static uint32_t PTK_Grid_allb2d (const PTK_Grid *og, uint32_t x, uint32_t y, uint32_t bits)
 Test if all of the flags set for the specified cell match all of the given flags. Returns 0 if any of them are missing. More...
 
static uint32_t PTK_Grid_allb3d (const PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z, uint32_t bits)
 Test if all of the flags set for the specified cell match all of the given flags. Returns 0 if any of them are missing. More...
 
static void PTK_Grid_clearb2d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t bits)
 This removes the specified flags from the specified cell. Any flags not mentioned in flags are left. More...
 
static void PTK_Grid_clearb3d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z, uint32_t bits)
 This removes the specified flags from the specified cell. Any flags not mentioned in flags are left. More...
 
static float * PTK_Grid_reff2d (PTK_Grid *og, uint32_t x, uint32_t y)
 Returns a reference to the data of type PTK_GRID_TYPE_FLOAT in the specified cell. More...
 
static float * PTK_Grid_reff3d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z)
 Returns a reference to the data of type PTK_GRID_TYPE_FLOAT in the specified cell. More...
 
static uint32_t * PTK_Grid_refu2d (PTK_Grid *og, uint32_t x, uint32_t y)
 Returns a reference to the data of type PTK_GRID_TYPE_UINT32 in the specified cell. More...
 
static uint32_t * PTK_Grid_refu3d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z)
 Returns a reference to the data of type PTK_GRID_TYPE_UINT32 in the specified cell. More...
 
static uint32_t * PTK_Grid_refb2d (PTK_Grid *og, uint32_t x, uint32_t y)
 Returns a reference to the data of type PTK_GRID_TYPE_BITS in the specified cell. More...
 
static uint32_t * PTK_Grid_refb3d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z)
 Returns a reference to the data of type PTK_GRID_TYPE_BITS in the specified cell. More...
 
static void * PTK_Grid_refv2d (PTK_Grid *og, uint32_t x, uint32_t y)
 Returns a reference to the data of type PTK_GRID_TYPE_USER in the specified cell. More...
 
static void * PTK_Grid_refv3d (PTK_Grid *og, uint32_t x, uint32_t y, uint32_t z)
 Returns a reference to the data of type PTK_GRID_TYPE_USER in the specified cell. More...
 
static void PTK_GridRoi_setDefault (PTK_GridRoi *roi)
 Sets the default values for the ROI. The values are set as follows: More...
 

Enumerations

enum  PTK_GridType {
  PTK_GRID_TYPE_UINT32, PTK_GRID_TYPE_FLOAT, PTK_GRID_TYPE_BITS, PTK_GRID_TYPE_USER,
  PTK_GRID_TYPE_USER_FORCE_SIZE = 0xFFFFFFFF
}
 Grid data type definition. More...
 

Macros

#define PTK_GRID_OK   ((uint32_t)0)
 Error codes. More...
 
#define PTK_GRID_CELL_INVALID   ((uint32_t)-1)
 Invalid value used for any computed cell that does nto fit on the map. More...
 
#define PTK_GRID_CONFIG_TYPE_INVALID   ((uint32_t)-2)
 Type specidied in the Gird config is not what is expected. More...
 
#define PTK_GRID_CELL_COUNT_INVALID   ((uint32_t)-3)
 Grid cell count invalid. More...
 

Macro Definition Documentation

◆ PTK_GRID_OK

#define PTK_GRID_OK   ((uint32_t)0)

Error codes.

Return status OK.

◆ PTK_GRID_CELL_INVALID

#define PTK_GRID_CELL_INVALID   ((uint32_t)-1)

Invalid value used for any computed cell that does nto fit on the map.

◆ PTK_GRID_CONFIG_TYPE_INVALID

#define PTK_GRID_CONFIG_TYPE_INVALID   ((uint32_t)-2)

Type specidied in the Gird config is not what is expected.

◆ PTK_GRID_CELL_COUNT_INVALID

#define PTK_GRID_CELL_COUNT_INVALID   ((uint32_t)-3)

Grid cell count invalid.

Enumeration Type Documentation

◆ PTK_GridType

Grid data type definition.

Enumerator
PTK_GRID_TYPE_UINT32 

Values stored in grid cells are unsigned integers.

PTK_GRID_TYPE_FLOAT 

Values stored in grid cells are single precision floats.

PTK_GRID_TYPE_BITS 

Values stored in grid cells 32-bit wide bit fields.

PTK_GRID_TYPE_USER 

Values stored in grid cells are user defined data.

PTK_GRID_TYPE_USER_FORCE_SIZE 

Values to force the size to 32 bits.

Function Documentation

◆ PTK_Grid_getSize()

uint32_t PTK_Grid_getSize ( const PTK_GridConfig config)

Compute how much memory is required to store the complete PTK Grid described by the given configuration struct.

Parameters
[in]configConfiguration to determine memory size for.
Returns
Amount of memory required, in bytes.

◆ PTK_Grid_init()

PTK_Grid* PTK_Grid_init ( uint8_t *  mem,
const PTK_GridConfig config 
)

Initialize an externally allocated piece of memory to be a valid PTK Grid instance.

Parameters
[out]memExternally allocated memory of at PTK_Grid_getSize() bytes.
[in]configConfiguration to initialize for Pointer to newly initialized PTK Grid instance.
Returns

◆ PTK_Grid_clear()

static void PTK_Grid_clear ( PTK_Grid og)
inlinestatic

This clears a PTK_Grid, resetting all cell contents back to 0, including user data types. If a nonzero default value is required for user types, PTK_Grid userClear is recommended.

Parameters
[in,out]ogThe PTK Grid to clear.

◆ PTK_Grid_userClear()

static uint32_t PTK_Grid_userClear ( PTK_Grid og,
void *  def 
)
inlinestatic

This clears a PTK Grid that is storing user data, resetting it to the default data supplied. The size of the default data is propagated from the existing definition for user data size already known to the PTK_Grid. Note that this function may be significantly slower than PTK_Grid clear due to implementation constraints.

Parameters
[in,out]ogThe PTK Grid to clear.
[out]defThe default data to use when resetting each cell.
Returns
  • PTK_GRID_OK, if successful
  • PTK_GRID_CONFIG_TYPE_INVALID, otherwise

◆ PTK_Grid_copy()

static uint32_t PTK_Grid_copy ( PTK_Grid *__restrict  dst,
const PTK_Grid *__restrict  src 
)
inlinestatic

Copy data from the given source PTK Grid to the destination PTK_Grid. The two must have the same configuration and be of the same type, or the results will be undefined.

Parameters
[out]dstCopy data to this PTK_Grid.
[in]srcCopy data from this PTK_Grid.
Returns
  • PTK_GRID_OK, if successful
  • Appropriate error code, otherwise

◆ PTK_Grid_getXCell()

static uint32_t PTK_Grid_getXCell ( const PTK_Grid og,
float  x 
)
inlinestatic

This converts a real-valued x coordinate given in meters to an index for the grid access function. If the x coordinate is invalid (< the origin x coordinate or the total number of cells in the x direction), PTK_GRID_CELL_INVALID is produced instead.

Parameters
[in]ogPTK_Grid to compute a cell index for.
[in]xReal x coordinate in meters.
Returns
  • Cell index containing the given coordinate, if success
  • PTK_GRID_CELL_INVALID, otherwise

◆ PTK_Grid_getYCell()

static uint32_t PTK_Grid_getYCell ( const PTK_Grid og,
float  y 
)
inlinestatic

This converts a real-valued y coordinate given in meters to an index for the grid access function. If the y coordinate is invalid (< the origin y coordinate or the total number of cells in the y direction), PTK_GRID_CELL_INVALID is produced instead.

Parameters
[in]ogPTK_Grid to compute a cell index for.
[in]yReal y coordinate in meters.
Returns
  • Cell index containing the given coordinate, if success
  • PTK_GRID_CELL_INVALID, otherwise

◆ PTK_Grid_getZCell()

static uint32_t PTK_Grid_getZCell ( const PTK_Grid og,
float  z 
)
inlinestatic

This converts a real-valued z coordinate given in meters to an index for the grid access function. If the z coordinate is invalid (< the origin z coordinate or the total number of cells in the z direction), PTK_GRID_CELL_INVALID is produced instead.

Parameters
[in]ogPTK_Grid to compute a cell index for.
[in]zReal z coordinate in meters.
Returns
  • Cell index containing the given coordinate, if success
  • PTK_GRID_CELL_INVALID, otherwise

◆ PTK_Grid_getLinearIndex2d()

static uint32_t PTK_Grid_getLinearIndex2d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y 
)
inlinestatic

This is a mostly-internal function that is used for converting a pair of integer cell indices into a single linear index that is then used with the backing storage internal to the PTK_Grid. It handles the storage order (row-major vs. column-major) as necessary and makes the assumption that z coordinates are entirely unused.

Parameters
[in]ogPTK_Grid to compute a linear index for.
[in]xInteger x index.
[in]yInteger y index.
Returns
Linear index of the given cell in the backing storage array.

◆ PTK_Grid_getLinearIndex3d()

static uint32_t PTK_Grid_getLinearIndex3d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlinestatic

This is a mostly-internal function that is used for converting a triple of integer cell indices into a single linear index that is used with the backing storage internal to the PTK_Grid. It handles the storage order (row-, column-, or tube-major) as necessary.

Parameters
[in]ogPTK_Grid to compute a linear index for.
[in]xInteger x index.
[in]yInteger y index.
[in]zInteger z index.
Returns
Linear index of the given cell in the backing storage array.

◆ PTK_Grid_getX()

static float PTK_Grid_getX ( const PTK_Grid og,
uint32_t  x 
)
inlinestatic
Parameters
[in]og
[in]x
Returns

◆ PTK_Grid_getY()

static float PTK_Grid_getY ( const PTK_Grid og,
uint32_t  y 
)
inlinestatic
Parameters
[in]og
[in]y
Returns

◆ PTK_Grid_getZ()

static float PTK_Grid_getZ ( const PTK_Grid og,
uint32_t  z 
)
inlinestatic
Parameters
[in]og
[in]z
Returns

◆ PTK_Grid_setf2d()

static void PTK_Grid_setf2d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
float  value 
)
inlinestatic

Sets the data of type PTK_GRID_TYPE_FLOAT in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
[in]valueThe value to be set at the given cell indices.

◆ PTK_Grid_setu2d()

static void PTK_Grid_setu2d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  value 
)
inlinestatic

Sets the data of type PTK_GRID_TYPE_UINT32 in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
[in]valueThe value to be set at the given cell indices.

◆ PTK_Grid_setb2d()

static void PTK_Grid_setb2d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  bits 
)
inlinestatic

Sets the data of type PTK_GRID_TYPE_BITS in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
[in]bitsThe value to be set at the given cell indices.

◆ PTK_Grid_getf2d()

static float PTK_Grid_getf2d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y 
)
inlinestatic

Returns the data of type PTK_GRID_TYPE_FLOAT in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
Returns
The value stored at the given cell indices.

◆ PTK_Grid_getu2d()

static uint32_t PTK_Grid_getu2d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y 
)
inlinestatic

Returns the data of type PTK_GRID_TYPE_UINT32 in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
Returns
The value stored at the given cell indices.

◆ PTK_Grid_getb2d()

static uint32_t PTK_Grid_getb2d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y 
)
inlinestatic

Returns the data of type PTK_GRID_TYPE_BITS in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
Returns
The value stored at the given cell indices.

◆ PTK_Grid_setf3d()

static void PTK_Grid_setf3d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z,
float  value 
)
inlinestatic

Sets the data of type PTK_GRID_TYPE_FLOAT in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
[in]zThe integer z index of the cell to read.
[in]valueThe value to be set at the given cell indices.

◆ PTK_Grid_setu3d()

static void PTK_Grid_setu3d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z,
uint32_t  value 
)
inlinestatic

Sets the data of type PTK_GRID_TYPE_UINT32 in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
[in]zThe integer z index of the cell to read.
[in]valueThe value to be set at the given cell indices.

◆ PTK_Grid_setb3d()

static void PTK_Grid_setb3d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z,
uint32_t  bits 
)
inlinestatic

Sets the data of type PTK_GRID_TYPE_BITS in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
[in]zThe integer z index of the cell to read.
[in]bitsThe value to be set at the given cell indices.

◆ PTK_Grid_getf3d()

static float PTK_Grid_getf3d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlinestatic

Returns the data of type PTK_GRID_TYPE_FLOAT in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
[in]zThe integer z index of the cell to read.
Returns
The value stored at the given cell indices.

◆ PTK_Grid_getu3d()

static uint32_t PTK_Grid_getu3d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlinestatic

Returns the data of type PTK_GRID_TYPE_UINT32 in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
[in]zThe integer z index of the cell to read.
Returns
The value stored at the given cell indices.

◆ PTK_Grid_getb3d()

static uint32_t PTK_Grid_getb3d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlinestatic

Returns the data of type PTK_GRID_TYPE_BITS in the specified cell.

Parameters
[in]ogThe PTK_Grid to read.
[in]xThe integer x index of the cell to read.
[in]yThe integer y index of the cell to read.
[in]zThe integer z index of the cell to read.
Returns
The value stored at the given cell indices.

◆ PTK_Grid_anyb2d()

static uint32_t PTK_Grid_anyb2d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  bits 
)
inlinestatic

Tests if the flags set for the specified cell contain any of the given flags values. Returns 1 if any of the flags match.

Parameters
[in]ogPTK_Grid to check
[in]xThe integer x cell index to check
[in]yThe integer y cell index to check
[in]bitsThe flags to check.
Returns
  • 1 if a match was found
  • 0 otherwise

◆ PTK_Grid_anyb3d()

static uint32_t PTK_Grid_anyb3d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z,
uint32_t  bits 
)
inlinestatic

Tests if the flags set for the specified cell contain any of the given flags values. Returns 1 if any of the flags match.

Parameters
[in]ogPTK_Grid to check
[in]xThe integer x cell index to check
[in]yThe integer y cell index to check
[in]zThe integer z cell index to check
[in]bitsThe flags to check.
Returns
  • 1 if a match was found
  • 0 otherwise

◆ PTK_Grid_allb2d()

static uint32_t PTK_Grid_allb2d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  bits 
)
inlinestatic

Test if all of the flags set for the specified cell match all of the given flags. Returns 0 if any of them are missing.

Parameters
[in]ogThe PTK_Grid to check.
[in]xThe integer x cell index to check.
[in]yThe integer y cell index to check.
[in]bitsThe flags to check for.
Returns
  • 1 if all flags match
  • 0 otherwise

◆ PTK_Grid_allb3d()

static uint32_t PTK_Grid_allb3d ( const PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z,
uint32_t  bits 
)
inlinestatic

Test if all of the flags set for the specified cell match all of the given flags. Returns 0 if any of them are missing.

Parameters
[in]ogThe PTK_Grid to check.
[in]xThe integer x cell index to check.
[in]yThe integer y cell index to check.
[in]zThe integer z cell index to check.
[in]bitsThe flags to check for.
Returns
  • 1 if all flags match
  • 0 otherwise

◆ PTK_Grid_clearb2d()

static void PTK_Grid_clearb2d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  bits 
)
inlinestatic

This removes the specified flags from the specified cell. Any flags not mentioned in flags are left.

If the linear index matching the specified cell is out of bounds for this grid.

Parameters
[in,out]ogThe PTK_Grid to modify.
[in]xThe integer x cell index to modify.
[in]yThe integer y cell index to modify.
[in]bitsThe flags to remove from this cell.

◆ PTK_Grid_clearb3d()

static void PTK_Grid_clearb3d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z,
uint32_t  bits 
)
inlinestatic

This removes the specified flags from the specified cell. Any flags not mentioned in flags are left.

If the linear index matching the specified cell is out of bounds for this grid.

Parameters
[in,out]ogThe PTK_Grid to modify.
[in]xThe integer x cell index to modify.
[in]yThe integer y cell index to modify.
[in]zThe integer z cell index to modify.
[in]bitsThe flags to remove from this cell.

◆ PTK_Grid_reff2d()

static float* PTK_Grid_reff2d ( PTK_Grid og,
uint32_t  x,
uint32_t  y 
)
inlinestatic

Returns a reference to the data of type PTK_GRID_TYPE_FLOAT in the specified cell.

Parameters
[in]ogThe PTK_Grid to reference.
[in]xThe integer x index of the cell to reference.
[in]yThe integer y index of the cell to reference.
Returns
  • A pointer to the contents of the cell, if the linear index is valid.
  • NULL, otherwise.

◆ PTK_Grid_reff3d()

static float* PTK_Grid_reff3d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlinestatic

Returns a reference to the data of type PTK_GRID_TYPE_FLOAT in the specified cell.

Parameters
[in]ogThe PTK_Grid to reference.
[in]xThe integer x index of the cell to reference.
[in]yThe integer y index of the cell to reference.
[in]zThe integer z index of the cell to reference.
Returns
  • A pointer to the contents of the cell, if the linear index is valid.
  • NULL, otherwise.

◆ PTK_Grid_refu2d()

static uint32_t* PTK_Grid_refu2d ( PTK_Grid og,
uint32_t  x,
uint32_t  y 
)
inlinestatic

Returns a reference to the data of type PTK_GRID_TYPE_UINT32 in the specified cell.

Parameters
[in]ogThe PTK_Grid to reference.
[in]xThe integer x index of the cell to reference.
[in]yThe integer y index of the cell to reference.
Returns
  • A pointer to the contents of the cell, if the linear index is valid.
  • NULL, otherwise.

◆ PTK_Grid_refu3d()

static uint32_t* PTK_Grid_refu3d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlinestatic

Returns a reference to the data of type PTK_GRID_TYPE_UINT32 in the specified cell.

Parameters
[in]ogThe PTK_Grid to reference.
[in]xThe integer x index of the cell to reference.
[in]yThe integer y index of the cell to reference.
[in]zThe integer z index of the cell to reference.
Returns
  • A pointer to the contents of the cell, if the linear index is valid.
  • NULL, otherwise.

◆ PTK_Grid_refb2d()

static uint32_t* PTK_Grid_refb2d ( PTK_Grid og,
uint32_t  x,
uint32_t  y 
)
inlinestatic

Returns a reference to the data of type PTK_GRID_TYPE_BITS in the specified cell.

Parameters
[in]ogThe PTK_Grid to reference.
[in]xThe integer x index of the cell to reference.
[in]yThe integer y index of the cell to reference.
Returns
  • A pointer to the contents of the cell, if the linear index is valid.
  • NULL, otherwise.

◆ PTK_Grid_refb3d()

static uint32_t* PTK_Grid_refb3d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlinestatic

Returns a reference to the data of type PTK_GRID_TYPE_BITS in the specified cell.

Parameters
[in]ogThe PTK_Grid to reference.
[in]xThe integer x index of the cell to reference.
[in]yThe integer y index of the cell to reference.
[in]zThe integer z index of the cell to reference.
Returns
  • A pointer to the contents of the cell, if the linear index is valid.
  • NULL, otherwise.

◆ PTK_Grid_refv2d()

static void* PTK_Grid_refv2d ( PTK_Grid og,
uint32_t  x,
uint32_t  y 
)
inlinestatic

Returns a reference to the data of type PTK_GRID_TYPE_USER in the specified cell.

Parameters
[in]ogThe PTK_Grid to reference.
[in]xThe integer x index of the cell to reference.
[in]yThe integer y index of the cell to reference.
Returns
  • A pointer to the contents of the cell, if the linear index is valid.
  • NULL, otherwise.

◆ PTK_Grid_refv3d()

static void* PTK_Grid_refv3d ( PTK_Grid og,
uint32_t  x,
uint32_t  y,
uint32_t  z 
)
inlinestatic

Returns a reference to the data of type PTK_GRID_TYPE_USER in the specified cell.

Parameters
[in]ogThe PTK_Grid to reference.
[in]xThe integer x index of the cell to reference.
[in]yThe integer y index of the cell to reference.
[in]zThe integer z index of the cell to reference.
Returns
  • A pointer to the contents of the cell, if the linear index is valid.
  • NULL, otherwise.

◆ PTK_GridRoi_setDefault()

static void PTK_GridRoi_setDefault ( PTK_GridRoi roi)
inlinestatic

Sets the default values for the ROI. The values are set as follows:

  • xOffset = 0.0f
  • yOffset = 0.0f
  • xWidth = 1.0f
  • yWidth = 1.0f
  • xDir = 1.0f
  • yDir = 0.0f
Parameters
[out]roiROI parameter context.