API function definitions for data containers. More...
Macros | |
| #define | MV_DataContainerDescriptor_foreach(containerDesc, componentDesc) |
| Macro for iterating over the data component descriptors in a data container descriptor. More... | |
| #define | MV_DataContainer_foreach(container, component) |
| Macro for iterating over the data components of a structured data container. More... | |
Functions | |
| MVLibExport MVCode_t | MV_DataContainerDescriptor_Init (MVDataContainerDescriptor_t *pDescriptor, MVDataContainerType_t type) |
| Initializes a new data container descriptor. More... | |
| MVLibExport MVCode_t | MV_DataContainerDescriptor_AddComponent (MVDataContainerDescriptor_t descriptor, MVDataComponentDescriptor_t component) |
| Adds a data component descriptor to a data container descriptor. More... | |
| MVLibExport void | MV_DataContainerDescriptor_Clear (MVDataContainerDescriptor_t *pDescriptor) |
| Destroys a data container descriptor. More... | |
| MVLibExport MVCode_t | MV_DataContainerDescriptor_SetType (MVDataContainerDescriptor_t descriptor, MVDataContainerType_t type) |
| Sets the type of a requested data container. More... | |
| MVLibExport MVDataContainerType_t | MV_DataContainerDescriptor_GetType (MVDataContainerDescriptor_t descriptor) |
| Gets the type of a requested data container. More... | |
| MVLibExport size_t | MV_DataContainerDescriptor_GetSize (MVDataContainerDescriptor_t descriptor) |
| Gets the number of data component descriptors contained in the given data container descriptor. More... | |
| MVLibExport MVDataComponentDescriptor_t | MV_DataContainerDescriptor_Next (MVDataContainerDescriptor_t descriptor) |
| Iterates over the data component descriptors in a data container descriptor. More... | |
| MVLibExport MVCode_t | MV_DataContainerDescriptor_Rewind (MVDataContainerDescriptor_t descriptor) |
| Resets the built-in pointer to the beginning of a data container descriptor. More... | |
| MVLibExport MVCode_t | MV_FetchDataContainer (MVPlugin_t handle, MVDataContainerDescriptor_t containerDesc, MVDataContainer_t *pContainer) |
| Obtains a data container from the vision system. More... | |
| MVLibExport void | MV_DataContainer_Clear (MVDataContainer_t *pContainer) |
| Destroys a data container. More... | |
| MVLibExport MVDataContainerType_t | MV_DataContainer_GetType (MVDataContainer_t container) |
| Gets the type of a data container. More... | |
| MVLibExport size_t | MV_DataContainer_GetSize (MVDataContainer_t container) |
| Gets the number of data components contained in the given structured data container. More... | |
| MVLibExport MVDataComponent_t | MV_DataContainer_Next (MVDataContainer_t container) |
| Iterates over the data components of a given structured data container. More... | |
| MVLibExport MVCode_t | MV_DataContainer_Rewind (MVDataContainer_t container) |
| Resets the built-in pointer to the beginning of a structured data container. More... | |
API function definitions for data containers.
| #define MV_DataContainer_foreach | ( | container, | |
| component | |||
| ) |
Macro for iterating over the data components of a structured data container.
| #define MV_DataContainerDescriptor_foreach | ( | containerDesc, | |
| componentDesc | |||
| ) |
Macro for iterating over the data component descriptors in a data container descriptor.
| MVLibExport void MV_DataContainer_Clear | ( | MVDataContainer_t * | pContainer | ) |
Destroys a data container.
Each handle to a data container obtained through MV_FetchDataContainer() must be balanced by a call to MV_DataContainer_Clear().
| [in,out] | pContainer | points to the handle to the data container that is destroyed. |
| MVLibExport size_t MV_DataContainer_GetSize | ( | MVDataContainer_t | container | ) |
Gets the number of data components contained in the given structured data container.
| [in] | container | is the handle to the structured data container that is queried. |
| MVLibExport MVDataContainerType_t MV_DataContainer_GetType | ( | MVDataContainer_t | container | ) |
Gets the type of a data container.
Presently, only "structured" data containers are supported. See MVDataContainerType_t for details.
| [in] | container | is the handle to the data container that is queried. |
| MVLibExport MVDataComponent_t MV_DataContainer_Next | ( | MVDataContainer_t | container | ) |
Iterates over the data components of a given structured data container.
Structured data containers have a built-in pointer to the "current" data component. This function returns a handle to the currently pointed-to data component and advances the pointer by one. If the end of the data container is reached, the returned data component handle will evaluate to false if coerced in a boolean context such as the conditional expression of an if or while statement.
| [in] | container | is the handle to the structured data container that is iterated over. |
| MVLibExport MVCode_t MV_DataContainer_Rewind | ( | MVDataContainer_t | container | ) |
Resets the built-in pointer to the beginning of a structured data container.
| [in] | container | is the handle to the structured data container whose internal pointer should be reset. |
container is not valid. container is not of the "structured" type. | MVLibExport MVCode_t MV_DataContainerDescriptor_AddComponent | ( | MVDataContainerDescriptor_t | descriptor, |
| MVDataComponentDescriptor_t | component | ||
| ) |
Adds a data component descriptor to a data container descriptor.
This function can be used to append a copy of an existing data component descriptor to a data container descriptor. This may be used in order to aggregate multiple component descriptors into a single data container descriptor in order to defer fetching all those data components "in bulk" as a single data container. It may also be useful to duplicate data component descriptors within the same data container descriptor in order to request the same data component in different formats (e.g. the original image and a scaled-down PNG thumbnail).
| [in] | descriptor | is the handle to the data container descriptor to which the component should be added. |
| [in] | component | is a handle to a MVDataComponentDescriptor_t. The descriptor referenced by this handle is copied and appended to the container descriptor. |
descriptor is not valid. component descriptor is not valid. | MVLibExport void MV_DataContainerDescriptor_Clear | ( | MVDataContainerDescriptor_t * | pDescriptor | ) |
Destroys a data container descriptor.
Each handle to a data container descriptor created through MV_DataContainerDescriptor_Init() or obtained through MV_Event_GetDataContainerDescriptor() or MV_Result_GetDataContainerDescriptor(), respectively, must be destroyed by a call to MV_DataContainerDescriptor_Clear().
| [in,out] | pDescriptor | points to the handle to the data container descriptor that is destroyed. |
| MVLibExport size_t MV_DataContainerDescriptor_GetSize | ( | MVDataContainerDescriptor_t | descriptor | ) |
Gets the number of data component descriptors contained in the given data container descriptor.
| [in] | descriptor | is the handle to the data container descriptor that is queried. |
| MVLibExport MVDataContainerType_t MV_DataContainerDescriptor_GetType | ( | MVDataContainerDescriptor_t | descriptor | ) |
Gets the type of a requested data container.
Presently, only "structured" data containers are supported. See MVDataContainerType_t for details.
| [in] | descriptor | is the handle to the data container descriptor that is queried. |
| MVLibExport MVCode_t MV_DataContainerDescriptor_Init | ( | MVDataContainerDescriptor_t * | pDescriptor, |
| MVDataContainerType_t | type | ||
| ) |
Initializes a new data container descriptor.
Creates an empty data container descriptor which may subsequently be filled with component descriptors using MV_DataContainerDescriptor_AddComponent(). This function is intended to be used when only a subset of data components that are available as part of a result are of interest, or to build a new data container descriptor which combines components from multiple results; otherwise data container descriptors may be obtained through MV_Event_GetDataContainerDescriptor() or MV_Result_GetDataContainerDescriptor(), respectively.
| [out] | pDescriptor | points to the handle of the data container descriptor that is initialized. |
| [in] | type | specifies which type of data container should be fetched. Currently, only "structured" data containers are supported. |
pDescriptor is NULL. Provide a pointer to a variable of type MVDataContainerDescriptor_t which is to be initialized. type is not supported. | MVLibExport MVDataComponentDescriptor_t MV_DataContainerDescriptor_Next | ( | MVDataContainerDescriptor_t | descriptor | ) |
Iterates over the data component descriptors in a data container descriptor.
Data container descriptors have a built-in pointer to the "current" data component descriptor. This function returns a handle to the currently pointed-to data component descriptor and advances the pointer by one. If the end of the data container descriptor is reached, the returned data component descriptor handle will evaluate to false if coerced in a boolean context such as the conditional expression of an if or while statement.
| [in] | descriptor | is the handle to the data container descriptor that is iterated over. |
| MVLibExport MVCode_t MV_DataContainerDescriptor_Rewind | ( | MVDataContainerDescriptor_t | descriptor | ) |
Resets the built-in pointer to the beginning of a data container descriptor.
| [in] | descriptor | is the handle to the data container descriptor whose internal pointer should be reset. |
descriptor is not valid. | MVLibExport MVCode_t MV_DataContainerDescriptor_SetType | ( | MVDataContainerDescriptor_t | descriptor, |
| MVDataContainerType_t | type | ||
| ) |
Sets the type of a requested data container.
Presently, only "structured" data containers are supported. See MVDataContainerType_t for details.
| [in] | descriptor | is the handle to the data container descriptor whose type is to be changed. |
| [in] | type | is an enumerator of type MVDataContainerType_t corresponding to the type of the data container which is to be fetched. |
type was successfully changed. descriptor is not valid. type is not supported. | MVLibExport MVCode_t MV_FetchDataContainer | ( | MVPlugin_t | handle, |
| MVDataContainerDescriptor_t | containerDesc, | ||
| MVDataContainer_t * | pContainer | ||
| ) |
Obtains a data container from the vision system.
This function requests a data container from the vision system based on the provided data container descriptor. It will block the current thread until a response has been received. The resulting data container will contain one data component per data component descriptor. The vision system will try to cater to the requested type and parameters specified in the corresponding data component descriptors. If this is not possible to satisfy, e.g., because a requested data component is no longer available inside the vision system or because the conversion to the requested data component type is either not possible or not supported, a data component of type "Error" will take its place in the data container. See mv_data_component.h for function to extract information from data containers and components.
| [in] | handle | is the Communicator handle for the plug-in instance. |
| [in] | request | is the Communicator handle for the plug-in instance. |
| [out] | pContainer | points to the uninitialized recipe list handle that is initialized with the current recipe list. |
pContainer has been initialized with it. handle is not valid. pContainer is NULL.