![]() |
Perception Tool Kit (PTK) API Guide
|
![]() |
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_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. 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... | |
#define PTK_GRID_OK ((uint32_t)0) |
Error codes.
Return status OK.
#define PTK_GRID_CELL_INVALID ((uint32_t)-1) |
Invalid value used for any computed cell that does nto fit on the map.
#define PTK_GRID_CONFIG_TYPE_INVALID ((uint32_t)-2) |
Type specidied in the Gird config is not what is expected.
#define PTK_GRID_CELL_COUNT_INVALID ((uint32_t)-3) |
Grid cell count invalid.
enum PTK_GridType |
Grid data type definition.
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.
[in] | config | Configuration to determine memory size for. |
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.
[out] | mem | Externally allocated memory of at PTK_Grid_getSize() bytes. |
[in] | config | Configuration to initialize for Pointer to newly initialized PTK Grid instance. |
|
inlinestatic |
|
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.
[in,out] | og | The PTK Grid to clear. |
[out] | def | The default data to use when resetting each cell. |
|
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.
|
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.
[in] | og | PTK_Grid to compute a cell index for. |
[in] | x | Real x coordinate in meters. |
|
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.
[in] | og | PTK_Grid to compute a cell index for. |
[in] | y | Real y coordinate in meters. |
|
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.
[in] | og | PTK_Grid to compute a cell index for. |
[in] | z | Real z coordinate in meters. |
|
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.
[in] | og | PTK_Grid to compute a linear index for. |
[in] | x | Integer x index. |
[in] | y | Integer y index. |
|
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.
[in] | og | PTK_Grid to compute a linear index for. |
[in] | x | Integer x index. |
[in] | y | Integer y index. |
[in] | z | Integer z index. |
|
inlinestatic |
[in] | og | |
[in] | x |
|
inlinestatic |
[in] | og | |
[in] | y |
|
inlinestatic |
[in] | og | |
[in] | z |
|
inlinestatic |
Sets the data of type PTK_GRID_TYPE_FLOAT in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
[in] | value | The value to be set at the given cell indices. |
|
inlinestatic |
Sets the data of type PTK_GRID_TYPE_UINT32 in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
[in] | value | The value to be set at the given cell indices. |
|
inlinestatic |
Sets the data of type PTK_GRID_TYPE_BITS in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
[in] | bits | The value to be set at the given cell indices. |
|
inlinestatic |
Returns the data of type PTK_GRID_TYPE_FLOAT in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
|
inlinestatic |
Returns the data of type PTK_GRID_TYPE_UINT32 in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
|
inlinestatic |
Returns the data of type PTK_GRID_TYPE_BITS in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
|
inlinestatic |
Sets the data of type PTK_GRID_TYPE_FLOAT in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
[in] | z | The integer z index of the cell to read. |
[in] | value | The value to be set at the given cell indices. |
|
inlinestatic |
Sets the data of type PTK_GRID_TYPE_UINT32 in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
[in] | z | The integer z index of the cell to read. |
[in] | value | The value to be set at the given cell indices. |
|
inlinestatic |
Sets the data of type PTK_GRID_TYPE_BITS in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
[in] | z | The integer z index of the cell to read. |
[in] | bits | The value to be set at the given cell indices. |
|
inlinestatic |
Returns the data of type PTK_GRID_TYPE_FLOAT in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
[in] | z | The integer z index of the cell to read. |
|
inlinestatic |
Returns the data of type PTK_GRID_TYPE_UINT32 in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
[in] | z | The integer z index of the cell to read. |
|
inlinestatic |
Returns the data of type PTK_GRID_TYPE_BITS in the specified cell.
[in] | og | The PTK_Grid to read. |
[in] | x | The integer x index of the cell to read. |
[in] | y | The integer y index of the cell to read. |
[in] | z | The integer z index of the cell to read. |
|
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.
[in] | og | PTK_Grid to check |
[in] | x | The integer x cell index to check |
[in] | y | The integer y cell index to check |
[in] | bits | The flags to check. |
|
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.
[in] | og | PTK_Grid to check |
[in] | x | The integer x cell index to check |
[in] | y | The integer y cell index to check |
[in] | z | The integer z cell index to check |
[in] | bits | The flags to check. |
|
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.
[in] | og | The PTK_Grid to check. |
[in] | x | The integer x cell index to check. |
[in] | y | The integer y cell index to check. |
[in] | bits | The flags to check for. |
|
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.
[in] | og | The PTK_Grid to check. |
[in] | x | The integer x cell index to check. |
[in] | y | The integer y cell index to check. |
[in] | z | The integer z cell index to check. |
[in] | bits | The flags to check for. |
|
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.
[in,out] | og | The PTK_Grid to modify. |
[in] | x | The integer x cell index to modify. |
[in] | y | The integer y cell index to modify. |
[in] | bits | The flags to remove from this cell. |
|
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.
[in,out] | og | The PTK_Grid to modify. |
[in] | x | The integer x cell index to modify. |
[in] | y | The integer y cell index to modify. |
[in] | z | The integer z cell index to modify. |
[in] | bits | The flags to remove from this cell. |
|
inlinestatic |
Returns a reference to the data of type PTK_GRID_TYPE_FLOAT in the specified cell.
[in] | og | The PTK_Grid to reference. |
[in] | x | The integer x index of the cell to reference. |
[in] | y | The integer y index of the cell to reference. |
|
inlinestatic |
Returns a reference to the data of type PTK_GRID_TYPE_FLOAT in the specified cell.
[in] | og | The PTK_Grid to reference. |
[in] | x | The integer x index of the cell to reference. |
[in] | y | The integer y index of the cell to reference. |
[in] | z | The integer z index of the cell to reference. |
|
inlinestatic |
Returns a reference to the data of type PTK_GRID_TYPE_UINT32 in the specified cell.
[in] | og | The PTK_Grid to reference. |
[in] | x | The integer x index of the cell to reference. |
[in] | y | The integer y index of the cell to reference. |
|
inlinestatic |
Returns a reference to the data of type PTK_GRID_TYPE_UINT32 in the specified cell.
[in] | og | The PTK_Grid to reference. |
[in] | x | The integer x index of the cell to reference. |
[in] | y | The integer y index of the cell to reference. |
[in] | z | The integer z index of the cell to reference. |
|
inlinestatic |
Returns a reference to the data of type PTK_GRID_TYPE_BITS in the specified cell.
[in] | og | The PTK_Grid to reference. |
[in] | x | The integer x index of the cell to reference. |
[in] | y | The integer y index of the cell to reference. |
|
inlinestatic |
Returns a reference to the data of type PTK_GRID_TYPE_BITS in the specified cell.
[in] | og | The PTK_Grid to reference. |
[in] | x | The integer x index of the cell to reference. |
[in] | y | The integer y index of the cell to reference. |
[in] | z | The integer z index of the cell to reference. |
|
inlinestatic |
Returns a reference to the data of type PTK_GRID_TYPE_USER in the specified cell.
[in] | og | The PTK_Grid to reference. |
[in] | x | The integer x index of the cell to reference. |
[in] | y | The integer y index of the cell to reference. |
|
inlinestatic |
Returns a reference to the data of type PTK_GRID_TYPE_USER in the specified cell.
[in] | og | The PTK_Grid to reference. |
[in] | x | The integer x index of the cell to reference. |
[in] | y | The integer y index of the cell to reference. |
[in] | z | The integer z index of the cell to reference. |
|
inlinestatic |
Sets the default values for the ROI. The values are set as follows:
[out] | roi | ROI parameter context. |