API function definitions for querying the result store. More...
Macros | |
| #define | MV_ResultList_foreach(list, result) |
| Macro for iterating over the results in a list. More... | |
Functions | |
| MVLibExport MVCode_t | MV_GetResultById (MVPlugin_t handle, uint32_t resultId, MVResult_t *pResult) |
| Retrieves a result from the result store based on its ID. More... | |
| MVLibExport MVCode_t | MV_GetResultListFiltered (MVPlugin_t handle, MVResultQuery_t query, MVResultList_t *pList) |
| Retrieves a result list from the result store based on a query. More... | |
| MVLibExport void | MV_ResultList_Clear (MVResultList_t *pList) |
| Destroys a result list. More... | |
| MVLibExport size_t | MV_ResultList_GetSize (MVResultList_t list) |
| Gets the number of results in a result list. More... | |
| MVLibExport MVResult_t | MV_ResultList_Next (MVResultList_t list) |
| Iterates over a result list. More... | |
| MVLibExport MVCode_t | MV_ResultList_Rewind (MVResultList_t list) |
| Resets the built-in pointer to the beginning of a result list. More... | |
| MVLibExport MVCode_t | MV_ResultQuery_Init (MVResultQuery_t *pQuery) |
| Initializes a result query of type MVResultQuery_t. More... | |
| MVLibExport MVCode_t | MV_ResultQuery_SetFilter (MVResultQuery_t query, uint32_t filter, MVValue_t value) |
| Narrows a result query down by setting a filter criterion. More... | |
| MVLibExport void | MV_ResultQuery_Clear (MVResultQuery_t *pQuery) |
| Destroys a result query. More... | |
| MVLibExport MVCode_t | MV_Result_GetParameter (MVResult_t result, uint32_t parameter, MVValue_t *pValue) |
| Gets a parameter value of a given result. More... | |
| MVLibExport MVCode_t | MV_Result_Tuple_GetParameter (MVResult_t result, uint32_t parameter, MVTuple_t *pTuple) |
| Gets a parameter tuple of a result. More... | |
| MVLibExport MVCode_t | MV_Result_GetDataContainerDescriptor (MVResult_t result, MVDataContainerDescriptor_t *pDescriptor) |
| Gets a data container descriptor for the data components of a result. More... | |
| MVLibExport void | MV_Result_Clear (MVResult_t *pResult) |
| Destroys a result. More... | |
API function definitions for querying the result store.
| #define MV_ResultList_foreach | ( | list, | |
| result | |||
| ) |
Macro for iterating over the results in a list.
| MVLibExport MVCode_t MV_GetResultById | ( | MVPlugin_t | handle, |
| uint32_t | resultId, | ||
| MVResult_t * | pResult | ||
| ) |
Retrieves a result from the result store based on its ID.
Note that the result store may only buffer a certain number of past results. This function returns MV_CODE_UNK_RESULT in case the requested result ID is not found in the result store.
| [in] | handle | is the Communicator handle for the plug-in instance. |
| [in] | resultId | is the result ID for which the result is retrieved. |
| [out] | pResult | points to the uninitialized result handle which is initialized with the requested result. |
pResult has been initialized with it. handle is not valid. pResult is NULL. MV_GetResultById has been called from a self-spawned thread and outside of its allowed plug-in lifetime. | MVLibExport MVCode_t MV_GetResultListFiltered | ( | MVPlugin_t | handle, |
| MVResultQuery_t | query, | ||
| MVResultList_t * | pList | ||
| ) |
Retrieves a result list from the result store based on a query.
Note that the result store may only keep a certain number of past results. This may negatively impact the vision system's performance when the query is not very specific and the vision system supports a large result store.
The list can be narrowed down through the query argument. The query must be initialized by way of MV_ResultQuery_Init() and various filtering criteria may be specified through MV_ResultQuery_SetFilter() prior to calling this function. The same query can be reused multiple times before destroying it using MV_ResultQuery_Clear().
Each call to MV_GetResultListFiltered() has to be balanced by a call to MV_ResultList_Clear().
| [in] | handle | is the Communicator handle for the plug-in instance. |
| [in] | query | specifies the criteria according to which the list is filtered. |
| [out] | pList | points to the result list variable that is initialized with the filtered list. |
query has been successfully retrieved and pList has been initialized with it. handle is not valid. pList is NULL. MV_GetResultListFiltered has been called from a self-spawned thread and outside of its allowed plug-in lifetime. | MVLibExport void MV_Result_Clear | ( | MVResult_t * | pResult | ) |
Destroys a result.
Each copy of a result made using MV_GetResultById() must be balanced by a call to MV_Result_Clear().
| [in,out] | pResult | points to the handle to the result that is destroyed. |
| MVLibExport MVCode_t MV_Result_GetDataContainerDescriptor | ( | MVResult_t | result, |
| MVDataContainerDescriptor_t * | pDescriptor | ||
| ) |
Gets a data container descriptor for the data components of a result.
This function provides a data container descriptor which contains data component descriptors for each of the transferable data components (e.g. images) which are available as part of the specified result. The data container descriptor does not hold any image data but simply references and describes the available data. The actual data can be fetched from the vision system by providing the descriptor to MV_FetchDataContainer() to obtain a data container.
The type and parameters of the contained data component descriptors reflect the "native" format, image size, etc., in which the data are present in the vision system. They can be overwritten using the functions provided in mv_data_component.h to request the data suitably to the plug-in.
| [in] | result | is the handle to the result that is queried. |
| [out] | pDescriptor | points to the uninitialized data container descriptor that is initialized. |
pDescriptor has successfully initialized with the data container descriptor. result is not valid or the pointer pDescriptor is NULL. | MVLibExport MVCode_t MV_Result_GetParameter | ( | MVResult_t | result, |
| uint32_t | parameter, | ||
| MVValue_t * | pValue | ||
| ) |
Gets a parameter value of a given result.
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().
The following parameters are available (followed by the type of the correspondingly retrieved MVValue_t):
These parameters and the semantics of their corresponding values mirror those which are available for ResultReady events.
| [in] | result | is the handle to the result that is queried. |
| [in] | parameter | is one of the above MV_PARAM_* defines. |
| [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. result is not valid. pValue is NULL. parameter key does not match any parameters which apply to results. parameter key does apply to the provided result, but the corresponding value is not set. | MVLibExport MVCode_t MV_Result_Tuple_GetParameter | ( | MVResult_t | result, |
| uint32_t | parameter, | ||
| MVTuple_t * | pTuple | ||
| ) |
Gets a parameter tuple of a result.
This function works analogous to MV_Result_GetParameter() but is used to get parameter tuples rather than individual values. Currently, only the result content is tuple-valued and may be accessed through the parameter key MV_PARAM_RESULT_CONTENT.
Refer to mv_tuple.h for the API functions for manipulating tuples.
| [in] | result | is the handle to the result that is queried. |
| [in] | parameter | identifies the parameter which is retrieved. Currently, it must equal MV_PARAM_RESULT_CONTENT. |
| [out] | pTuple | points to a MVTuple_t which is then initialized to a copy of the desired parameter contained in the result. |
pTuple. result is not valid. pValue is NULL. parameter key is different from MV_PARAM_RESULT_CONTENT. | MVLibExport void MV_ResultList_Clear | ( | MVResultList_t * | pList | ) |
Destroys a result list.
Each call to MV_GetResultListFiltered() has to be balanced by a call to MV_ResultList_Clear().
| [in,out] | pList | points to the result list handle that is destroyed. |
| MVLibExport size_t MV_ResultList_GetSize | ( | MVResultList_t | list | ) |
Gets the number of results in a result list.
| [in] | list | is the handle to the result list which is queried. |
| MVLibExport MVResult_t MV_ResultList_Next | ( | MVResultList_t | list | ) |
Iterates over a result list.
Result lists have a built-in pointer to the "current" result. This function returns a handle to the currently pointed-to result and advances the pointer by one. If the end of the result list is reached, the returned result handle will evaluate to false if coerced in a boolean context such as the conditional expression of an if or while statement.
| [in] | list | is the handle to the result list to iterate over. |
| MVLibExport MVCode_t MV_ResultList_Rewind | ( | MVResultList_t | list | ) |
Resets the built-in pointer to the beginning of a result list.
| [in] | list | is the handle to the result list whose internal pointer should be reset. |
list is not valid. | MVLibExport void MV_ResultQuery_Clear | ( | MVResultQuery_t * | pQuery | ) |
Destroys a result query.
Each call to MV_ResultQuery_Init() has to be balanced by a call to MV_ResultQuery_Clear(). Clearing the query does not clear any result lists which may have been obtained through it; these need to be cleared separately using MV_ResultList_Clear().
| [in,out] | pQuery | points to the query that is destroyed. |
| MVLibExport MVCode_t MV_ResultQuery_Init | ( | MVResultQuery_t * | pQuery | ) |
Initializes a result query of type MVResultQuery_t.
Each call to MV_ResultQuery_Init() has to be balanced by a call to MV_ResultQuery_Clear().
| [out] | pQuery | points to the query variable which is initialized. |
pQuery has been successfully initialized with a query matching any result. pQuery is NULL. | MVLibExport MVCode_t MV_ResultQuery_SetFilter | ( | MVResultQuery_t | query, |
| uint32_t | filter, | ||
| MVValue_t | value | ||
| ) |
Narrows a result query down by setting a filter criterion.
Setting a filter criterion using this function has the effect of restricting the results which are included in the list when passing the query to MV_GetResultListFiltered() to only those results whose parameters match the filter. The function can be called multiple times on the same query for different filter parameters to refine it to only those results matching all of the filter criteria.
The following values for the filter argument are applicable:
value.value.value.value.value.| [in] | query | is the query that is refined by the filter. |
| [in] | filter | is one of the filter criteria listed above. |
| [in] | value | is the value which the filtering parameter must be equal to in order for the result to be included in the list. Its value type and data type must be chosen appropriately as documented above. |
query successfully. query is not valid. value is NULL. filter cannot be filtered for. value's type does not match the expectation for the specified filter. value's data type does not match the expectation for the specified filter.