API function definitions for data components. More...
Functions | |
| MVLibExport MVCode_t | MV_DataComponentDescriptor_GetParameter (MVDataComponentDescriptor_t descriptor, uint32_t parameter, MVValue_t *pValue) |
| Gets the value of a parameter of a data component descriptor. More... | |
| MVLibExport MVCode_t | MV_DataComponentDescriptor_SetParameter (MVDataComponentDescriptor_t descriptor, uint32_t parameter, MVValue_t value) |
| Sets a parameter of a data component descriptor to a given value. More... | |
| MVLibExport MVDataComponentType_t | MV_DataComponentDescriptor_GetType (MVDataComponentDescriptor_t descriptor) |
| Gets the type of a data component descriptor. More... | |
| MVLibExport MVCode_t | MV_DataComponentDescriptor_SetType (MVDataComponentDescriptor_t descriptor, MVDataComponentType_t type) |
| Sets a new type for a data component descriptor. More... | |
| MVLibExport bool | MV_DataComponentDescriptor_Equal (MVDataComponentDescriptor_t lhsDescriptor, MVDataComponentDescriptor_t rhsDescriptor) |
| Checks whether two data component descriptors refer to the same data component. More... | |
| MVLibExport MVDataComponentType_t | MV_DataComponent_GetType (MVDataComponent_t component) |
| Gets the type of a data component. More... | |
| MVLibExport MVCode_t | MV_DataComponent_GetErrorCode (MVDataComponent_t component) |
| Gets the error code of an erroneous data component. More... | |
| MVLibExport MVCode_t | MV_DataComponent_GetErrorMessage (MVDataComponent_t component, MVValue_t *pValue) |
| Gets the error message of an erroneous data component. More... | |
| MVLibExport size_t | MV_DataComponent_GetByteCount (MVDataComponent_t component) |
| Gets the size of the data component's internal data in bytes. More... | |
| MVLibExport const void * | MV_DataComponent_GetPtr (MVDataComponent_t component, size_t *byteCount) |
| Gets a pointer to the data component's internal data and the size of the data in bytes. More... | |
| MVLibExport MVCode_t | MV_DataComponent_CopyTo (MVDataComponent_t component, void *dest, size_t destSize, size_t offset, size_t *pCount) |
| Copies the internal data of the data component to a pre-allocated buffer. More... | |
API function definitions for data components.
| MVLibExport MVCode_t MV_DataComponent_CopyTo | ( | MVDataComponent_t | component, |
| void * | dest, | ||
| size_t | destSize, | ||
| size_t | offset, | ||
| size_t * | pCount | ||
| ) |
Copies the internal data of the data component to a pre-allocated buffer.
This function copies the data represented by the data component into an existing buffer. In case of large data components, it may be preferable for certain applications to process it in smaller chunks. For this purpose, an offset can be provided which can be successively incremented by the buffer size until the end of the data component is reached.
| [in] | component | is the handle to the data component whose data to copy. |
| [in,out] | dest | is the pre-allocated destination buffer to hold the internal data of the data component. |
| [in] | destSize | is the size of the destination buffer in bytes. |
| [in] | offset | is the number of bytes to be skipped prior to copying. |
| [out] | pCount | can point to a variable which will be set to the number of bytes which have actually been copied. This can be left as a NULL pointer if it is not of interest. |
offset position, has successfully been copied to the dest buffer. dest buffer has successfully been filled with data but was not sufficient to hold all of it. The remainder can be copied by advancing the offset position by destSize and repeating this as necessary. component is not valid. dest pointer is NULL or the destSize is zero. A non-empty buffer is required. offset is past the end of the data. | MVLibExport size_t MV_DataComponent_GetByteCount | ( | MVDataComponent_t | component | ) |
Gets the size of the data component's internal data in bytes.
| [in] | component | is the handle to the data component that is queried. |
| MVLibExport MVCode_t MV_DataComponent_GetErrorCode | ( | MVDataComponent_t | component | ) |
Gets the error code of an erroneous data component.
When the vision system cannot comply with the type and parameters requested by a data component descriptor, or the data is not longer available in the system, the vision system will send a data component of type eMVDataComponentType_Error instead. This function can be used to obtain an error code which explains the absence of a proper data component.
| [in] | component | is the handle to the data component that is queried. |
component is not actually an error. component handle is invalid. | MVLibExport MVCode_t MV_DataComponent_GetErrorMessage | ( | MVDataComponent_t | component, |
| MVValue_t * | pValue | ||
| ) |
Gets the error message of an erroneous data component.
In addition to the error code accompanying a data component of type eMVDataComponentType_Error, the component may also store a decorating error message that further describes the error. This function can be used to obtain such a message.
| [in] | component | is the handle to the data component that is queried. |
| [out] | pValue | points to the value handle that is initialized with a copy of the decorating error message. |
component is an error and the accompanying message has been stored at the given pValue. component handle is invalid. pValue is NULL. component is not an error. | MVLibExport const void* MV_DataComponent_GetPtr | ( | MVDataComponent_t | component, |
| size_t * | byteCount | ||
| ) |
Gets a pointer to the data component's internal data and the size of the data in bytes.
This function grants access to the data represented by the data component. The byteCount will hold the number of bytes which can safely be read, starting from the returned pointer. Note that the internal data must not be accessed after MV_DataContainer_Clear() has been called on the underlying data container.
Plug-ins may use this function to minimize copies of the data, particularly when interfacing with third-party libraries. If the data merely ought to be copied into a separate buffer, prefer using MV_DataComponent_CopyTo().
| [in] | component | is the handle to the data component that is queried. |
| [out] | byteCount | can point to a variable which will be set to the size of the data component in bytes. This can be left as a NULL pointer if the size is not of interest or already known. |
NULL if there is no data or the component is invalid. | MVLibExport MVDataComponentType_t MV_DataComponent_GetType | ( | MVDataComponent_t | component | ) |
Gets the type of a data component.
| [in] | component | is the handle to the data component that is queried. |
component is invalid. | MVLibExport bool MV_DataComponentDescriptor_Equal | ( | MVDataComponentDescriptor_t | lhsDescriptor, |
| MVDataComponentDescriptor_t | rhsDescriptor | ||
| ) |
Checks whether two data component descriptors refer to the same data component.
Equality is defined regarding the data component on the vision system. It does neither take any differences in the specified type or parameters into account, nor does it consider which data container descriptor it is associated to.
For example, two data component descriptors which have been obtained independently from one another through MV_Event_GetDataContainerDescriptor() and MV_Result_GetDataContainerDescriptor(), respectively, will be considered equal and this will continue to hold after either one has been modified through MV_DataComponentDescriptor_SetType() or MV_DataComponentDescriptor_SetParameter(), respectively.
| lhsDescriptor | is a handle to one of the data component descriptors. |
| rhsDescriptor | is a handle to the other data component descriptor. |
| MVLibExport MVCode_t MV_DataComponentDescriptor_GetParameter | ( | MVDataComponentDescriptor_t | descriptor, |
| uint32_t | parameter, | ||
| MVValue_t * | pValue | ||
| ) |
Gets the value of a parameter of a data component descriptor.
Initializes a new MVValue_t with a copy of the requested parameter. It is the caller's responsibility to destroy this copy by way of MV_Value_Clear().
See mv_data_component_def.h for a table of applicable parameters.
| [in] | descriptor | is a handle to the data component descriptor that is queried. |
| [in] | parameter | is one of the parameter keys listed in mv_data_component_def.h. |
| [out] | pValue | points to the value handle that is initialized with a copy of the value of the queried parameter. |
parameter key was successfully used to initialize the value pointed to by pValue. descriptor is not valid. pValue is NULL. parameter key does not match any parameters which apply to the data component descriptor. | MVLibExport MVDataComponentType_t MV_DataComponentDescriptor_GetType | ( | MVDataComponentDescriptor_t | descriptor | ) |
Gets the type of a data component descriptor.
| [in] | descriptor | is a handle to the data component descriptor. |
| MVLibExport MVCode_t MV_DataComponentDescriptor_SetParameter | ( | MVDataComponentDescriptor_t | descriptor, |
| uint32_t | parameter, | ||
| MVValue_t | value | ||
| ) |
Sets a parameter of a data component descriptor to a given value.
Depending on the current type of the data component descriptor, it is parametrized in different ways. The parameter is identified by numeric constants. See mv_data_component_def.h for a table of applicable parameters.
| [in] | descriptor | is a handle to the data component descriptor whose parameter is set. |
| [in] | parameter | identifies the parameter that is set; must match one of the parameters supported by a data component of the given type. |
| [in] | value | is the MVValue_t that is copied into the data component descriptor. |
value was successfully stored in the data component descriptor for the given parameter. value may now be cleared. descriptor handle is invalid. value is invalid. Either it is not properly initialized or its numeric value is out of range for the given parameter. parameter does not apply to the descriptor type. See mv_data_component_def.h for a table of supported parameters. value's type does not match the expectation for the specified parameter. value's data type does not match the expectation for the specified parameter. | MVLibExport MVCode_t MV_DataComponentDescriptor_SetType | ( | MVDataComponentDescriptor_t | descriptor, |
| MVDataComponentType_t | type | ||
| ) |
Sets a new type for a data component descriptor.
Overwrites the current type of a data component descriptor. When the corresponding data container descriptor is used to fetch the data container from the vision system, it will try to convert the data to the specified type. Note that the vision system may not be able to comply with this request and will instead send a data component of type eMVDataComponentType_Error.
| [in] | descriptor | is a handle to the data component descriptor. |
| [in] | type | is the new type which is to be set. |
type was successfully set. descriptor handle is invalid. type is invalid.