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:

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.

Enumerator
IC4_PROPINTREP_LINEAR 

Suggest a slider to edit the value.

IC4_PROPINTREP_LOGARITHMIC 

Suggest a slider with logarithmic mapping.

IC4_PROPINTREP_BOOLEAN 

Suggest a checkbox.

IC4_PROPINTREP_PURENUMBER 

Suggest displaying a decimal number.

IC4_PROPINTREP_HEXNUMBER 

Suggest displaying a hexadecimal number.

IC4_PROPINTREP_IPV4ADDRESS 

Suggest treating the integer as a IPV4 address.

IC4_PROPINTREP_MACADDRESS 

Suggest treating the integer as a MAC address.

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]propAn integer property
[out]pIncrementPointer to an integer to receive the increment
Returns
true on success, otherwise false.
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_prop_integer_get_min
ic4_prop_integer_get_max

◆ 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]propAn 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.
See also
ic4_prop_integer_get_inc
ic4_prop_integer_get_valid_value_set

◆ 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]propAn integer property
[out]pMaximumPointer to an integer to receive the maximum value
Returns
true on success, otherwise false.
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_prop_integer_get_min
ic4_prop_integer_get_inc

◆ 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]propAn integer property
[out]pMinimumPointer to an integer to receive the minimum value
Returns
true on success, otherwise false.
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_prop_integer_get_max
ic4_prop_integer_get_inc

◆ 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]propAn 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]propAn 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 returns NULL. 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]propAn integer property restricted to a set of values
[out]value_setAn array to receive the set of valid values
[in,out]array_sizePointer to a size_t indicating the length of value_set.
After the call, this contains the number of entries in this property's set of valid values.
Returns
true on success, otherwise false.
Use ic4_get_last_error() to query error information.
Note
If value_set is not NULL and array_size is NULL, 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. If prop 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]propAn integer property
[out]pValuePointer to an integer to receive the current value
Returns
true on success, otherwise false.
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]propAn integer property
[in]valueThe new value to set
Returns
true on success, otherwise false.
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.
See also
ic4_prop_integer_get_min
ic4_prop_integer_get_max
ic4_prop_integer_get_inc