Imaging Control 4 C Library 1.2.0
Loading...
Searching...
No Matches
Enumeration Properties

Enumeration properties represent a feature whose value is selected from a list of named entries. More...

Functions

bool ic4_prop_enum_get_entries (struct IC4_PROPERTY *prop, struct IC4_PROPERTY_LIST **ppList)
 Returns the list of entries in this enumeration property.
 
bool ic4_prop_enum_find_entry_by_name (struct IC4_PROPERTY *prop, const char *entry_name, struct IC4_PROPERTY **ppEntry)
 Finds the enumeration entry with a given name in this enumeration property.
 
bool ic4_prop_enum_find_entry_by_value (struct IC4_PROPERTY *prop, int64_t entry_value, struct IC4_PROPERTY **ppEntry)
 Finds the enumeration entry with a given value in this enumeration property.
 
bool ic4_prop_enum_set_value (struct IC4_PROPERTY *prop, const char *entry_name)
 Sets the enumeration's selected entry by name.
 
const char * ic4_prop_enum_get_value (struct IC4_PROPERTY *prop)
 Returns the name of the currently selected entry of the enumeration.
 
bool ic4_prop_enum_set_selected_entry (struct IC4_PROPERTY *prop, struct IC4_PROPERTY *entry)
 Sets the enumeration's selected entry.
 
bool ic4_prop_enum_get_selected_entry (struct IC4_PROPERTY *prop, struct IC4_PROPERTY **ppEntry)
 Returns the currently selected entry of this enumeration property.
 
bool ic4_prop_enum_set_int_value (struct IC4_PROPERTY *prop, int64_t entry_value)
 Selects the currently selected entry of this enumeration property by specifying the entry's value.
 
bool ic4_prop_enum_get_int_value (struct IC4_PROPERTY *prop, int64_t *pValue)
 Returns the value of the currently selected entry of an enumeration property.
 
bool ic4_prop_enumentry_get_int_value (struct IC4_PROPERTY *prop, int64_t *pValue)
 Returns the value of an enumeration entry.
 

Detailed Description

Enumeration properties represent a feature whose value is selected from a list of named entries.

Common examples for an enumeration properties are PixelFormat, TriggerMode or ExposureAuto.

The value of an enumeration property can be get or set by both a enumeration entry's name or value.

Enumeration entries are represented by IC4_PROPERTY objects; a call to ic4_prop_enum_get_entries() returns the list of possible enumeration entries as a IC4_PROPERTY_LIST.

Function Documentation

◆ ic4_prop_enum_find_entry_by_name()

bool ic4_prop_enum_find_entry_by_name ( struct IC4_PROPERTY prop,
const char *  entry_name,
struct IC4_PROPERTY **  ppEntry 
)

Finds the enumeration entry with a given name in this enumeration property.

Parameters
[in]propAn enumeration property
[in]entry_nameThe name of one of this enumeration property's enumeration entries
[out]ppEntryA pointer to a property receiving the requested enumeration entry.
When the enumeration entry is no longer required, release the object reference using ic4_prop_unref().
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not an enumeration property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
See also
ic4_prop_enum_find_entry_by_value

◆ ic4_prop_enum_find_entry_by_value()

bool ic4_prop_enum_find_entry_by_value ( struct IC4_PROPERTY prop,
int64_t  entry_value,
struct IC4_PROPERTY **  ppEntry 
)

Finds the enumeration entry with a given value in this enumeration property.

Parameters
[in]propAn enumeration property
[in]entry_valueThe value of one of this enumeration property's enumeration entries
[out]ppEntryA pointer to a property receiving the requested enumeration entry.
When the enumeration entry is no longer required, release the object reference using ic4_prop_unref().
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not an enumeration property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
See also
ic4_prop_enum_find_entry_by_name

◆ ic4_prop_enum_get_entries()

bool ic4_prop_enum_get_entries ( struct IC4_PROPERTY prop,
struct IC4_PROPERTY_LIST **  ppList 
)

Returns the list of entries in this enumeration property.

Parameters
[in]propAn enumeration property
[out]ppListA pointer to a property list receiving the list of enumeration entries.
When the property list is no longer required, release the object reference using ic4_proplist_unref().
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not an enumeration property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.

◆ ic4_prop_enum_get_int_value()

bool ic4_prop_enum_get_int_value ( struct IC4_PROPERTY prop,
int64_t *  pValue 
)

Returns the value of the currently selected entry of an enumeration property.

Parameters
[in]propAn enumeration property
[out]pValueA pointer to a double receiving the currently selected enumeration entry's value
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not an enumeration property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
See also
ic4_prop_enum_get_selected_entry
ic4_prop_enum_set_int_value

◆ ic4_prop_enum_get_selected_entry()

bool ic4_prop_enum_get_selected_entry ( struct IC4_PROPERTY prop,
struct IC4_PROPERTY **  ppEntry 
)

Returns the currently selected entry of this enumeration property.

Parameters
[in]propAn enumeration property
[out]ppEntryA pointer to a property receiving the currently selected enumeration entry.
When the enumeration entry is no longer required, release the object reference using ic4_prop_unref().
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not an enumeration property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
See also
ic4_prop_enum_get_int_value

◆ ic4_prop_enum_get_value()

const char * ic4_prop_enum_get_value ( struct IC4_PROPERTY prop)

Returns the name of the currently selected entry of the enumeration.

Parameters
propAn enumeration property
Returns
The name of the enumeration's currently selected entry, or NULL in case of an error.
Use ic4_get_last_error() to query error information.
The memory pointed to by the return value is valid at least as the property object exists, or until the next call to ic4_prop_enum_get_value on this enumeration.
Remarks
If prop is not an enumeration property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.

◆ ic4_prop_enum_set_int_value()

bool ic4_prop_enum_set_int_value ( struct IC4_PROPERTY prop,
int64_t  entry_value 
)

Selects the currently selected entry of this enumeration property by specifying the entry's value.

This method can be useful to directly set a known enumeration entry, for example setting the PixelFormat to IC4_PIXEL_FORMAT_Mono8.

Parameters
[in]propAn enumeration property
[in]entry_valueThe value of an enumeration entry of prop.
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not an enumeration property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
See also
ic4_prop_enum_set_selected_entry
ic4_prop_enum_get_int_value

◆ ic4_prop_enum_set_selected_entry()

bool ic4_prop_enum_set_selected_entry ( struct IC4_PROPERTY prop,
struct IC4_PROPERTY entry 
)

Sets the enumeration's selected entry.

Parameters
[in]propAn enumeration property
[in]entryAn enumeration entry of prop.
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not an enumeration property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
If entry is not an enumeration entry property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
If entry is not an enumeration entry of prop, the function fails and the error value is set to IC4_ERROR_GENICAM_VALUE_ERROR.
See also
ic4_prop_enum_set_value
ic4_prop_enum_set_int_value

◆ ic4_prop_enum_set_value()

bool ic4_prop_enum_set_value ( struct IC4_PROPERTY prop,
const char *  entry_name 
)

Sets the enumeration's selected entry by name.

Parameters
[in]propAn enumeration property
[in]entry_nameThe name of an enumeration entry of prop.
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not an enumeration property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
If entry_name is not the name of an entry of prop, the function fails and the error value is set to IC4_ERROR_GENICAM_VALUE_ERROR.
See also
ic4_prop_enum_set_selected_entry
ic4_prop_enum_set_int_value

◆ ic4_prop_enumentry_get_int_value()

bool ic4_prop_enumentry_get_int_value ( struct IC4_PROPERTY prop,
int64_t *  pValue 
)

Returns the value of an enumeration entry.

Parameters
[in]propAn enumeration entry
[out]pValueA pointer to a double receiving the value of the enumeration entry
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Remarks
If prop is not an enumeration entry, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
See also
ic4_prop_enum_get_entries