Offset table that describes the position in memory of a logical pixel component in an IImageVPA object's plane. It is returned as a PVPAT, an array of VPAEntry elements, by the GetImageVPA function. The offset is calculated based on the returned base pointer.
A function which returns the pointer to a pixel looks like this (returning nullptr on error):
The use of intptr_t for address calculation and void * for pointer return is intentional. The address calculation is cvbdatatype_t agnostic and therefore is done with byte granularity which is the same as normal integer arithmetic. But it shows nicely that we do not want to dereference this value. To further facilitate this thought we return a void * (with which we cannot do arithmetic). This shows that we only return the pointer to the start of the pixel component.
The cvbdatatype_t defines the data type (and thus size) of the pixel's component. So after we have the address we can cast it to its actual type:
These two functions are very safe and very slow. Normally you would access the image data inside a function and would do all the checking only once.
Note
Pixel access via the VPAT is always done in the pixel coordinate system.
As accessing the pixels via the VPAT always adds one level of indirection (and possibly a cache miss and/or page fault), CVB provides the GetLinearAccess function in the CVCUtilities.dll. See the UtilitiesLibraryReference for additional information.
See also
TCoordinateMap for information on the coordinate systems.