Integer Properties
Integer properties represent a feature whose value is an integer number. More...
Enumerations
enum | IC4_PROPERTY_INT_REPRESENTATION { IC4_PROPINTREP_LINEAR , IC4_PROPINTREP_LOGARITHMIC , IC4_PROPINTREP_BOOLEAN , IC4_PROPINTREP_PURENUMBER , IC4_PROPINTREP_HEXNUMBER , IC4_PROPINTREP_IPV4ADDRESS , IC4_PROPINTREP_MACADDRESS } Defines the possible integer property representations. More... |
Functions
enum IC4_PROPERTY_INT_REPRESENTATION | ic4_prop_integer_get_representation (struct IC4_PROPERTY *prop) Returns the suggested representation for an integer property. |
const char * | ic4_prop_integer_get_unit (struct IC4_PROPERTY *prop) Returns the unit of an integer property. |
bool | ic4_prop_integer_set_value (struct IC4_PROPERTY *prop, int64_t value) Changes the value of an integer property. |
bool | ic4_prop_integer_get_value (struct IC4_PROPERTY *prop, int64_t *pValue) Reads the current value of an integer property. |
bool | ic4_prop_integer_get_min (struct IC4_PROPERTY *prop, int64_t *pMinimum) Returns the minimum value accepted by an integer property. |
bool | ic4_prop_integer_get_max (struct IC4_PROPERTY *prop, int64_t *pMaximum) Returns the maximum value accepted by an integer property. |
bool | ic4_prop_integer_get_inc (struct IC4_PROPERTY *prop, int64_t *pIncrement) Returns the step size for valid values accepted by an integer property. |
enum IC4_PROPERTY_INCREMENT_MODE | ic4_prop_integer_get_inc_mode (struct IC4_PROPERTY *prop) Returns how this integer property restricts which values are valid between its minimum and maximum value. |
bool | ic4_prop_integer_get_valid_value_set (struct IC4_PROPERTY *prop, int64_t *value_set, size_t *array_size) Returns the set of valid values for an integer. |
Detailed Description
Integer properties represent a feature whose value is an integer number.
Common examples for a integer properties are Width
or Height
.
An integer property can limit the range of valid values. The range of possible values can be queried by calling ic4_prop_integer_get_min() and ic4_prop_integer_get_max().
In integer property supplies hints that can be useful when creating a user interface:
- A representation (ic4_prop_integer_get_representation())
- A unit (ic4_prop_integer_get_unit())
Enumeration Type Documentation
◆ IC4_PROPERTY_INT_REPRESENTATION
Defines the possible integer property representations.
Each integer property has a representation hint that can help creating more useful user interfaces.
Function Documentation
◆ ic4_prop_integer_get_inc()
bool ic4_prop_integer_get_inc | ( | struct IC4_PROPERTY * | prop, |
int64_t * | pIncrement | ||
) |
Returns the step size for valid values accepted by an integer property.
The increment restricts the set of valid values for an integer property. For example, if the property's minimum value is 0
, the maximum is 10
, and the increment is 2
, 5
is not a valid value for the property and will be rejected when trying to write it.
- Parameters
-
[in] prop An integer property [out] pIncrement Pointer to an integer to receive the increment
- Returns
true
on success, otherwisefalse
.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not an integer property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_integer_get_inc_mode()
enum IC4_PROPERTY_INCREMENT_MODE ic4_prop_integer_get_inc_mode | ( | struct IC4_PROPERTY * | prop | ) |
Returns how this integer property restricts which values are valid between its minimum and maximum value.
- Parameters
-
[in] prop An integer property
- Returns
- IC4_PROPINCMODE_INCREMENT if the property has a fixed step size between valid values.
IC4_PROPINCMODE_VALUESET, if the property has a set of valid values.
If an error occurs, the function returns IC4_PROPINCMODE_INCREMENT and the error value is set.
Use ic4_get_last_error() to query error information.
◆ ic4_prop_integer_get_max()
bool ic4_prop_integer_get_max | ( | struct IC4_PROPERTY * | prop, |
int64_t * | pMaximum | ||
) |
Returns the maximum value accepted by an integer property.
- Parameters
-
[in] prop An integer property [out] pMaximum Pointer to an integer to receive the maximum value
- Returns
true
on success, otherwisefalse
.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not an integer property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_integer_get_min()
bool ic4_prop_integer_get_min | ( | struct IC4_PROPERTY * | prop, |
int64_t * | pMinimum | ||
) |
Returns the minimum value accepted by an integer property.
- Parameters
-
[in] prop An integer property [out] pMinimum Pointer to an integer to receive the minimum value
- Returns
true
on success, otherwisefalse
.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not an integer property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_integer_get_representation()
enum IC4_PROPERTY_INT_REPRESENTATION ic4_prop_integer_get_representation | ( | struct IC4_PROPERTY * | prop | ) |
Returns the suggested representation for an integer property.
The representation can be used as a hint when creating user interfaces.
- Parameters
-
[in] prop An integer property
- Returns
- The suggested representation for the property, or a default representation in case of an error.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not an integer property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
- See also
- IC4_PROPERTY_INT_REPRESENTATION
◆ ic4_prop_integer_get_unit()
const char * ic4_prop_integer_get_unit | ( | struct IC4_PROPERTY * | prop | ) |
Returns the unit of an integer property.
- Parameters
-
[in] prop An integer property
- Returns
- The unit of the the property. The unit can be an empty string, if there is no unit for the property.
The memory pointed to by the return value is valid as long as the property object exists.
If an error occurs, the function returnsNULL
. Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not an integer property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_integer_get_valid_value_set()
bool ic4_prop_integer_get_valid_value_set | ( | struct IC4_PROPERTY * | prop, |
int64_t * | value_set, | ||
size_t * | array_size | ||
) |
Returns the set of valid values for an integer.
- Parameters
-
[in] prop An integer property restricted to a set of values [out] value_set An array to receive the set of valid values [in,out] array_size Pointer to a size_t
indicating the length ofvalue_set
.
After the call, this contains the number of entries in this property's set of valid values.
- Returns
true
on success, otherwisefalse
.
Use ic4_get_last_error() to query error information.
- Note
- If
value_set
is notNULL
and array_size isNULL
, the function fails and the error value is set to IC4_ERROR_INVALID_PARAM_VAL. If*array_size
is lower than the number of entries in this property's set of valid values, the function fails the error value is set to IC4_ERROR_BUFFER_TOO_SMALL. Ifprop
is not restricted by a set of valid values, the function fails and the error value is set to IC4_ERROR_GENICAM_NOT_IMPLEMENTED.
◆ ic4_prop_integer_get_value()
bool ic4_prop_integer_get_value | ( | struct IC4_PROPERTY * | prop, |
int64_t * | pValue | ||
) |
Reads the current value of an integer property.
- Parameters
-
[in] prop An integer property [out] pValue Pointer to an integer to receive the current value
- Returns
true
on success, otherwisefalse
.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not an integer property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_integer_set_value()
bool ic4_prop_integer_set_value | ( | struct IC4_PROPERTY * | prop, |
int64_t | value | ||
) |
Changes the value of an integer property.
- Parameters
-
[in] prop An integer property [in] value The new value to set
- Returns
true
on success, otherwisefalse
.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not an integer property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
If the device or component rejected the value, the function fails and the error value is set to IC4_ERROR_GENICAM_VALUE_ERROR.
If the value is currently not writable, the function fails and the error value is set to IC4_ERROR_GENICAM_ACCESS_DENIED.