Represents a single CVB plane. More...
Typedefs | |
typedef void * | CVPLANE |
CVB plane handle. More... | |
typedef void(* | PFFINALRELEASE) (void *pBufferBase, void *pPrivate) |
Release callback for plane created with CVCCreatePlaneFromPointer. More... | |
Enumerations | |
enum | { CVCD_X = 0 , CVCD_Y = 1 , CVCD_Z = 2 } |
enum | CVCPlaneRole { CVCPR_Undefined = -1 , CVCPR_PixMono = 0 , CVCPR_PixRGB_R , CVCPR_PixRGB_G , CVCPR_PixRGB_B , CVCPR_PixYUV_Y , CVCPR_PixYUV_U , CVCPR_PixYUV_V , CVCPR_PixHSV_H , CVCPR_PixHSV_S , CVCPR_PixHSV_V , CVCPR_PixLAB_L , CVCPR_PixLAB_A , CVCPR_PixLAB_B , CVCPR_PixConfidence , CVCPR_PixRGB_RGB , CVCPR_CoordCartesian_X = 0x1000 , CVCPR_CoordCartesian_Y , CVCPR_CoordCartesian_Z , CVCPR_CoordCartesian_W , CVCPR_CoordPolar_Rho , CVCPR_CoordPolar_Phi , CVCPR_CoordCylindrical_Rho , CVCPR_CoordCylindrical_Phi , CVCPR_CoordCylindrical_Z , CVCPR_CoordSpherical_Rho , CVCPR_Normal_X = 0x1100 , CVCPR_Normal_Y , CVCPR_Normal_Z , CVCPR_Point_Planarity , CVCPR_Point_Variation , CVCPR_Point_Sphericity , CVCPR_Point_Linearity , CVCPR_Point_Curvature , CVCPR_Custom = 0x10000000 } |
Roles for planes. More... | |
Functions | |
cvbres_t | CVCCreatePlaneFromPointer (cvbdatatype_t DataType, CVCPlaneRole Role, void *pBase, cvbdim_t Dimension, cvbint64_t Lengths[], intptr_t Increments[], PFFINALRELEASE OnRelease, void *pPrivate, CVPLANE &hPlane) |
Creates a plane from user memory. More... | |
cvbbool_t | CVCIsPlane (CVPLANE hPlane) |
Tests whether the given hPlane handle is a valid plane object. More... | |
cvbres_t | CVCPlaneGetBasePtr (CVPLANE hPlane, void *&pBase) |
Gets the pointer to the first element of the given hPlane. More... | |
cvbres_t | CVCPlaneGetDataType (CVPLANE hPlane, cvbdatatype_t &DataType) |
Gets the CVB data type of the given hPlane. More... | |
cvbres_t | CVCPlaneGetIncrement (CVPLANE hPlane, cvbdim_t Dimension, intptr_t &Increment) |
Gets the offset in bytes to move to the next element in the given Dimension. More... | |
cvbres_t | CVCPlaneGetLength (CVPLANE hPlane, cvbdim_t Dimension, cvbint64_t &Length) |
Gets the number of elements in the given Dimension. More... | |
cvbres_t | CVCPlaneGetPixelPointer (OBJ hObj, cvbdim_t PlaneIndex, void *&pScan0, intptr_t &XInc, intptr_t &YInc) |
Gets access to the image data if it is linear. More... | |
cvbres_t | CVCPlaneGetRank (CVPLANE hPlane, cvbdim_t &Rank) |
Gets the number of dimensions the given hPlane spans over. More... | |
cvbres_t | CVCPlaneGetRole (CVPLANE hPlane, CVCPlaneRole &Role) |
Gets the role of the plane. More... | |
Represents a single CVB plane.
An IPlane is a linear (not necessary contiguous) data plane (see CVCImg library documentation for an explanation of CVB's plane concept). For a description on what linear means see CVCPlaneGetPixelPointer.
A plane has a certain role (see CVCPlaneRole) which describes the image component's interpretation. This combined with its DataType enables correct component access.
To navigate inside an IPlane you can first use the BasePtr to access the logical first component. The Rank describes the number of **Dimension**s in the plane. For example:
2: | standard 2D images |
1: | 3D point clouds (array of x,y,z points) |
And for each Dimension the Length and the Increment to the next element are given. For a 2D image (Rank is two):
0 (CVCD_X): | Length means width in pixels and Increment is the X-increment in bytes |
1 (CVCD_Y): | Length means height in pixels and Increment is the Y-increment in bytes |
CVB plane handle.
The CVPLANE is a reference counted OBJ handle. CVPLANE objects at least implement the IPlane interface.
typedef void(* PFFINALRELEASE)(void *pBufferBase, void *pPrivate) |
Release callback for plane created with CVCCreatePlaneFromPointer.
In this callback, the implementer can take the necessary steps to e.g. clean up memory or other resources allocated for a CVCCreatePlaneFromPointer call.
[in] | pBufferBase | The base pointer of the buffer to be released. |
[in] | pPrivate | User context pointer given to the function CVCCreatePlaneFromPointer. |
anonymous enum |
enum CVCPlaneRole |
Roles for planes.
A plane role describes the components of the plane. They can coarsely be separated in 4 sets:
Enumerator | |
---|---|
CVCPR_Undefined | Unknown/undefined value. |
CVCPR_PixMono | Monochromatic, linear luminance value. |
CVCPR_PixRGB_R | Red channel value. |
CVCPR_PixRGB_G | Green channel value. |
CVCPR_PixRGB_B | Blue channel value. |
CVCPR_PixYUV_Y | Same as CVCPR_PixMono, but to distinguish YUV model. |
CVCPR_PixYUV_U | Blue chrominance channel. |
CVCPR_PixYUV_V | Red chrominance channel. |
CVCPR_PixHSV_H | Hue channel value. |
CVCPR_PixHSV_S | Saturation channel value. |
CVCPR_PixHSV_V | Value (luminance) channel value. |
CVCPR_PixLAB_L | Lightness channel value. |
CVCPR_PixLAB_A | Green-red chrominance channel. |
CVCPR_PixLAB_B | Blue-yellow chrominance channel. |
CVCPR_PixConfidence | Confidence (probability density/percentage) or consistency (Boolean) value. |
CVCPR_PixRGB_RGB | Red-green-blue channel value. |
CVCPR_CoordCartesian_X | Cartesian X axis component. |
CVCPR_CoordCartesian_Y | Cartesian Y axis component. |
CVCPR_CoordCartesian_Z | Cartesian Z axis component. |
CVCPR_CoordCartesian_W | Cartesian W axis component (homogeneous coordinates). |
CVCPR_CoordPolar_Rho | Polar radius component. |
CVCPR_CoordPolar_Phi | Polar azimuth angle component. |
CVCPR_CoordCylindrical_Rho | Cylindrical radius component. |
CVCPR_CoordCylindrical_Phi | Cylindrical azimuth angle component. |
CVCPR_CoordCylindrical_Z | Cylindrical Z axis component. |
CVCPR_CoordSpherical_Rho | Spherical radius component. |
CVCPR_Normal_X | Normal in X. |
CVCPR_Normal_Y | Normal in Y. |
CVCPR_Normal_Z | Normal in Z. |
CVCPR_Point_Planarity | Planarity of point. This is a measure for the planarity of the point considering neighboring points. The range of values is [0;1]. |
CVCPR_Point_Variation | Variation of point. This is a measure for the variation of the point considering neighboring points. The range of values is [0;1]. |
CVCPR_Point_Sphericity | Sphericity of point. This is a measure for the sphericity of the point considering neighboring points. The range of values is [0;1]. |
CVCPR_Point_Linearity | Linearity of point. This is a measure for the linearity of the point considering neighboring points. A high linearity means, that the points lie on one line. The range of values is [0;1]. |
CVCPR_Point_Curvature | Curvature of point. |
CVCPR_Custom | Not generically defined use case. |
cvbres_t CVCCreatePlaneFromPointer | ( | cvbdatatype_t | DataType, |
CVCPlaneRole | Role, | ||
void * | pBase, | ||
cvbdim_t | Dimension, | ||
cvbint64_t | Lengths[], | ||
intptr_t | Increments[], | ||
PFFINALRELEASE | OnRelease, | ||
void * | pPrivate, | ||
CVPLANE & | hPlane | ||
) |
Creates a plane from user memory.
[in] | DataType | The type identifier for the data in the plane. |
[in] | Role | The meaning of this plane. |
[in] | pBase | The base pointer of the plane. |
[in] | Dimension | The dimension of the plane. |
[in] | Lengths | The lengths of the plane for each dimension. |
[in] | Increments | The increments of the plane for each dimension. |
[in] | OnRelease | The pointer to a function that is called when the plane is released. |
[in] | pPrivate | The pointer to an arbitrary object; it will be passed to OnRelease when it is called. The pointer can be NULL . |
[out] | hPlane | The created plane. |
cvbbool_t CVCIsPlane | ( | CVPLANE | hPlane | ) |
Tests whether the given hPlane handle is a valid plane object.
[in] | hPlane | Plane handle to test. |
cvbres_t CVCPlaneGetBasePtr | ( | CVPLANE | hPlane, |
void *& | pBase | ||
) |
Gets the pointer to the first element of the given hPlane.
This then means if you have a RGB8 buffer and you have the CVCPR_PixRGB_B plane object, then the returned pBase has a two byte offset to the buffer's base pointer (see CVCBufferGetBasePtr).
[in] | hPlane | Plane handle to query. |
[out] | pBase | Variable to receive the base pointer of the plane. |
cvbres_t CVCPlaneGetDataType | ( | CVPLANE | hPlane, |
cvbdatatype_t & | DataType | ||
) |
Gets the CVB data type of the given hPlane.
The data type identifier defines whether the component value is e.g. an (unsigned) integer or floating point number and its bit-size. Other types are also encoded.
[in] | hPlane | Plane handle to query. |
[out] | DataType | Variable to receive the CVB data type of the plane. |
cvbres_t CVCPlaneGetIncrement | ( | CVPLANE | hPlane, |
cvbdim_t | Dimension, | ||
intptr_t & | Increment | ||
) |
Gets the offset in bytes to move to the next element in the given Dimension.
For a normal image the Increment of Dimension 0 is the X-increment; Dimension 1 refers to the Y-increment respectively.
These values are normally equal to the values returned by CVCBufferGetIncrement as only the base pointers are different. Notable differences are in compressed formats like YUV422_8.
[in] | hPlane | Plane handle to query. |
[in] | Dimension | Dimension to access the increment for. |
[out] | Increment | Variable to receive the offset in bytes to the next element in the given Dimension. |
cvbres_t CVCPlaneGetLength | ( | CVPLANE | hPlane, |
cvbdim_t | Dimension, | ||
cvbint64_t & | Length | ||
) |
Gets the number of elements in the given Dimension.
For a normal image the Length of Dimension 0 is the width; Dimension 1 refers to the height respectively.
These values are normally equal to the values returned by CVCBufferGetLength as the number of components in one pixel is constant. Notable differences are in compressed formats like YUV422_8 where the length Dimension 0 for CVCPR_PixYUV_U and CVCPR_PixYUV_V is half of CVCPR_PixYUV_Y.
[in] | hPlane | Plane handle to query. |
[in] | Dimension | Dimension to access the increment for. |
[out] | Length | Variable to receive the number of elements in the given Dimension. |
cvbres_t CVCPlaneGetPixelPointer | ( | OBJ | hObj, |
cvbdim_t | PlaneIndex, | ||
void *& | pScan0, | ||
intptr_t & | XInc, | ||
intptr_t & | YInc | ||
) |
Gets access to the image data if it is linear.
An image plane is linear for this function if there are exactly one x-increment (offset to the next pixel in line) and y-increment (offset to the next line) value for the whole plane.
If linear access is not possible, you must access image data via CVCImage.dll's GetImageVPA function.
[in] | hObj | IPlaneEnum or IImageVPA object to query. |
[in] | PlaneIndex | Plane index to get access to. |
[out] | pScan0 | Variable to receive the pointer to the first pixel in the first scan line. |
[out] | XInc | Variable to receive the offset to the next pixel in scan line (in bytes). |
[out] | YInc | Variable to receive the offset to the next line (in bytes). |
cvbres_t CVCPlaneGetRank | ( | CVPLANE | hPlane, |
cvbdim_t & | Rank | ||
) |
Gets the number of dimensions the given hPlane spans over.
A normal image has a rank of 2 (width and height dimension). A point cloud has a rank of 1 (array of X, Y, or Z components).
[in] | hPlane | Plane handle to query. |
[out] | Rank | Variable to receive the number of dimensions in the given hPlane. |
cvbres_t CVCPlaneGetRole | ( | CVPLANE | hPlane, |
CVCPlaneRole & | Role | ||
) |
Gets the role of the plane.
Roles specify the meaning of plane (which addresses one component in a buffer), e.g CVCPR_PixMono for a 2d monochrome image or CVCPR_CoordCartesian_X in a point cloud.
[in] | hPlane | Plane handle to query. |
[out] | Role | Variable to receive the role of the plane. |