Float Properties
Float properties represent a feature whose value is a floating-point number. More...
Enumerations
enum | IC4_PROPERTY_FLOAT_REPRESENTATION { IC4_PROPFLOATREP_LINEAR
, IC4_PROPFLOATREP_LOGARITHMIC
, IC4_PROPFLOATREP_PURENUMBER
} Defines the possible float property representations. More... |
enum | IC4_PROPERTY_DISPLAY_NOTATION { IC4_PROPDISPNOTATION_AUTOMATIC
, IC4_PROPDISPNOTATION_FIXED
, IC4_PROPDISPNOTATION_SCIENTIFIC
} Defines the possible float property display notations. More... |
Functions
enum IC4_PROPERTY_FLOAT_REPRESENTATION | ic4_prop_float_get_representation (struct IC4_PROPERTY *prop) Returns the suggested represenation for a float property. |
const char * | ic4_prop_float_get_unit (struct IC4_PROPERTY *prop) Returns the unit of a float property. |
enum IC4_PROPERTY_DISPLAY_NOTATION | ic4_prop_float_get_display_notation (struct IC4_PROPERTY *prop) Returns a suggested display notation to use when displaying the float property's value. |
int64_t | ic4_prop_float_get_display_precision (struct IC4_PROPERTY *prop) Returns a suggested number of significant digits to use when displaying the float property's value. |
bool | ic4_prop_float_set_value (struct IC4_PROPERTY *prop, double value) Changes the value of a float property. |
bool | ic4_prop_float_get_value (struct IC4_PROPERTY *prop, double *pValue) Reads the current value of a float property. |
bool | ic4_prop_float_get_min (struct IC4_PROPERTY *prop, double *pMinimum) Returns the minimum value accepted by a float property. |
bool | ic4_prop_float_get_max (struct IC4_PROPERTY *prop, double *pMaximum) Returns the maximum value accepted by a float property. |
enum IC4_PROPERTY_INCREMENT_MODE | ic4_prop_float_get_inc_mode (struct IC4_PROPERTY *prop) Returns how this float property restricts which values are valid between its minimum and maximum value. |
bool | ic4_prop_float_get_inc (struct IC4_PROPERTY *prop, double *pIncrement) Returns the step size for valid values accepted by a float property. |
bool | ic4_prop_float_get_valid_value_set (struct IC4_PROPERTY *prop, double *value_set, size_t *array_size) Returns the set of valid values for a float. |
Detailed Description
Float properties represent a feature whose value is a floating-point number.
Common examples for a float properties are AcquisitionFrameRate
, ExposureTime
or Gain
.
A float property can limit the range of valid values. The range of possible values can be queried by calling ic4_prop_float_get_min() and ic4_prop_float_get_max().
In float property supplies hints that can be useful when creating a user interface:
- A representation (ic4_prop_float_get_representation())
- A unit (ic4_prop_float_get_unit())
- A display notation (ic4_prop_float_get_display_notation())
- Display precision (ic4_prop_float_get_display_precision())
Enumeration Type Documentation
◆ IC4_PROPERTY_DISPLAY_NOTATION
Defines the possible float property display notations.
Each float property has a display notation hint that can help creating more useful user interfaces.
◆ IC4_PROPERTY_FLOAT_REPRESENTATION
Defines the possible float property representations.
Each float property has a representation hint that can help creating more useful user interfaces.
Enumerator | |
---|---|
IC4_PROPFLOATREP_LINEAR | Suggest a slider to edit the value. |
IC4_PROPFLOATREP_LOGARITHMIC | Suggest a slider with logarithmic mapping. |
IC4_PROPFLOATREP_PURENUMBER | Suggest displaying a number. |
Function Documentation
◆ ic4_prop_float_get_display_notation()
enum IC4_PROPERTY_DISPLAY_NOTATION ic4_prop_float_get_display_notation | ( | struct IC4_PROPERTY * | prop | ) |
Returns a suggested display notation to use when displaying the float property's value.
- Parameters
-
[in] prop A float property
- Returns
- A display notation suggestion, or IC4_PROPDISPNOTATION_AUTOMATIC if there is an error.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not a float property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_float_get_display_precision()
int64_t ic4_prop_float_get_display_precision | ( | struct IC4_PROPERTY * | prop | ) |
Returns a suggested number of significant digits to use when displaying the float property's value.
- Parameters
-
[in] prop A float property
- Returns
- The suggested number of significant digits for display, or a default value if there is an error.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not a float property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_float_get_inc()
bool ic4_prop_float_get_inc | ( | struct IC4_PROPERTY * | prop, |
double * | pIncrement | ||
) |
Returns the step size for valid values accepted by a float property.
The increment restricts the set of valid values for a float property. For example, if the property's minimum value is 0.0
, the maximum is 1.0
, and the increment is 0.5
, 1.25
is not a valid value for the property and will be rejected when trying to write it.
- Parameters
-
[in] prop A float property [out] pIncrement Pointer to a double to receive the increment
- Returns
true
on success, otherwisefalse
.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not a float property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
- See also
- ic4_prop_float_get_min
- ic4_prop_float_get_max
- ic4_prop_float_has_inc
◆ ic4_prop_float_get_inc_mode()
enum IC4_PROPERTY_INCREMENT_MODE ic4_prop_float_get_inc_mode | ( | struct IC4_PROPERTY * | prop | ) |
Returns how this float property restricts which values are valid between its minimum and maximum value.
- Parameters
-
[in] prop A float 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.
IC4_PROPINCMODE_NONE, if the property can be set to any value between its minimum and maximum.
If an error occurs, the function returns IC4_PROPINCMODE_NONE and the error value is set.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not a float property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_float_get_max()
bool ic4_prop_float_get_max | ( | struct IC4_PROPERTY * | prop, |
double * | pMaximum | ||
) |
Returns the maximum value accepted by a float property.
- Parameters
-
[in] prop A float property [out] pMaximum Pointer to an double 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 float property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_float_get_min()
bool ic4_prop_float_get_min | ( | struct IC4_PROPERTY * | prop, |
double * | pMinimum | ||
) |
Returns the minimum value accepted by a float property.
- Parameters
-
[in] prop A float property [out] pMinimum Pointer to an double 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 float property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_float_get_representation()
enum IC4_PROPERTY_FLOAT_REPRESENTATION ic4_prop_float_get_representation | ( | struct IC4_PROPERTY * | prop | ) |
Returns the suggested represenation for a float property.
The representation can be used as a hint when creating user interfaces.
- Parameters
-
[in] prop A float 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 a float property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_float_get_unit()
const char * ic4_prop_float_get_unit | ( | struct IC4_PROPERTY * | prop | ) |
Returns the unit of a float property.
- Parameters
-
[in] prop A float property
- Returns
- The unit of the the property. The unit can be an empty string, if there is no unit for the property.
Use ic4_get_last_error() to query error information.
The memory pointed to by the return value is valid as long as the property object exists.
- Remarks
- If
prop
is not a float property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_float_get_valid_value_set()
bool ic4_prop_float_get_valid_value_set | ( | struct IC4_PROPERTY * | prop, |
double * | value_set, | ||
size_t * | array_size | ||
) |
Returns the set of valid values for a float.
- Parameters
-
[in] prop A float 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_float_get_value()
bool ic4_prop_float_get_value | ( | struct IC4_PROPERTY * | prop, |
double * | pValue | ||
) |
Reads the current value of a float property.
- Parameters
-
[in] prop A float property [out] pValue Pointer to a double to receive the current value
- Returns
true
on success, otherwisefalse
.
Use ic4_get_last_error() to query error information.
- Remarks
- If
prop
is not a float property, the function fails and the error value is set to IC4_ERROR_GENICAM_TYPE_MISMATCH.
◆ ic4_prop_float_set_value()
bool ic4_prop_float_set_value | ( | struct IC4_PROPERTY * | prop, |
double | value | ||
) |
Changes the value of a float property.
- Parameters
-
[in] prop A float 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 a float 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.