Imaging Control 4 C++ Library 1.2.0
|
Represents a property of a component, usually a video capture device. More...
Public Types | |
using | NotificationHandler = std::function< void(Property &prop)> |
Function prototype for property notification event handlers. | |
using | NotificationToken = void * |
Represents a registered callback. | |
Public Member Functions | |
Property ()=default | |
Creates an invalid object. | |
bool | is_valid () const noexcept |
Checks whether this property is a valid object. | |
bool | operator== (const Property &other) const noexcept |
Checks whether a property object refers to the same property as another property object. | |
bool | operator!= (const Property &other) const noexcept |
Checks whether a property object refers to a different property as another property object. | |
bool | operator< (const Property &other) const noexcept |
Provides an ordering of property objects. | |
PropType | type (Error &err=Error::Default()) const |
Returns the type of the property. | |
std::string | name (Error &err=Error::Default()) const |
Returns the name of the property. | |
bool | isAvailable (Error &err=Error::Default()) const |
Checks whether a property is currently available. | |
bool | isLocked (Error &err=Error::Default()) const |
Checks whether a property is currently locked. | |
bool | isLikelyLockedByStream (Error &err=Error::Default()) const |
Tries to determine whether a property is locked because a data stream is active. | |
bool | isReadOnly (Error &err=Error::Default()) const |
Checks whether a property is read-only. | |
PropVisibility | visibility (Error &err=Error::Default()) const |
Returns a visibility hint for the property. | |
std::string | displayName (Error &err=Error::Default()) const |
Returns the display name of the property. | |
std::string | tooltip (Error &err=Error::Default()) const |
Returns a tooltip for the property. | |
std::string | description (Error &err=Error::Default()) const |
Returns a description for the property. | |
PropCommand | asCommand (Error &err=Error::Default()) const |
Converts this property into a PropCommand. | |
PropInteger | asInteger (Error &err=Error::Default()) const |
Converts this property into a PropInteger. | |
PropBoolean | asBoolean (Error &err=Error::Default()) const |
Converts this property into a PropBoolean. | |
PropFloat | asFloat (Error &err=Error::Default()) const |
Converts this property into a PropFloat. | |
PropString | asString (Error &err=Error::Default()) const |
Converts this property into a PropString. | |
PropEnumeration | asEnumeration (Error &err=Error::Default()) const |
Converts this property into a PropEnumeration. | |
PropEnumEntry | asEnumEntry (Error &err=Error::Default()) const |
Converts this property into a PropEnumEntry. | |
PropRegister | asRegister (Error &err=Error::Default()) const |
Converts this property into a PropRegister. | |
PropCategory | asCategory (Error &=Error::Default()) const |
Converts this property into a PropCategory. | |
NotificationToken | eventAddNotification (NotificationHandler cb, Error &err=Error::Default()) |
Registers a new property notification event handler. | |
bool | eventRemoveNotification (NotificationToken token, Error &err=Error::Default()) |
Unregisters a previously registered property notification event handler. | |
bool | isSelector (Error &err=Error::Default()) const |
Indicates whether this property's value changes the meaning and/or value of other properties. | |
std::vector< Property > | selectedProperties (Error &err=Error::Default()) const |
Returns the list of properties whose values' meaning depend on this property. | |
Represents a property of a component, usually a video capture device.
All property types are derived from Property, e.g. PropInteger, PropCommand or PropEnumeration.
PropEnumEntry is also derived from Property, even though they are not part of the category tree. Nevertheless, enumeration entries support all standard property operations.
To convert a Property to one of the specialized classes, use one of the designated conversion methods such as Property::asInteger() or Property::asFloat().
All Property objects are copyable value types, and comparable using operator==, operator!= and operator<.
Property objects are created in multiple ways:
The direct get functions and conversion functions can return an invalid property object in case of an error. Check Property::is_valid() or the function's err output parameter. Default-constructed Property objects are also invalid.
Property objects are copyable.
using NotificationHandler = std::function<void(Property& prop)> |
Function prototype for property notification event handlers.
[in] | prop | The property on which the event handler was registered. |
using NotificationToken = void* |
Represents a registered callback.
When a callback function is registered using Property::eventAddNotification, a token is returned.
The token can then be used to remove the callback using Property::eventRemoveNotification at a later time.
|
inline |
Converts this property into a PropBoolean.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Converts this property into a PropCategory.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Converts this property into a PropCommand.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Converts this property into a PropEnumEntry.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Converts this property into a PropEnumeration.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Converts this property into a PropFloat.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Converts this property into a PropInteger.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Converts this property into a PropRegister.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Converts this property into a PropString.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Returns a description for the property.
A property's description is a short text that describes the property, usually in more detail than the tooltip.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Returns the display name of the property.
A property's display name is a text representation of the property that is meant to be displayed in user interfaces. For example, the display name of the ExposureTime
property usually is Exposure Time.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Registers a new property notification event handler.
The property notification handler is called whenever an aspect of the property changes, for example its value or locked status.
[in] | cb | Callback function to be called when an aspect of the property has changed. |
[out] | err | Reference to an error handler. See Error Handling for details. |
nullptr
.
|
inline |
Unregisters a previously registered property notification event handler.
[in] | token | A token that was returned when registering an event handler using Property::eventAddNotification(). |
[out] | err | Reference to an error handler. See Error Handling for details. |
true
on success, otherwise false
.
|
inlinenoexcept |
Checks whether this property is a valid object.
If there is an error in the function creating this property object, and function was not configured to throw on error, an invalid object is created. All member function calls will fail.
true
, if this property object was constructed successfully, otherwise false
.
|
inline |
Checks whether a property is currently available.
If a property is not available, attempts to read or write its value will fail.
A property may become unavailable, if its value does not have a meaning in the current state of the device. The property's availability status can change upon writing to another property.
[out] | err | Reference to an error handler. See Error Handling for details. |
true
, if the property is currently available, otherwise false
. If an error occurred, the function returns false
. Check the err output parameter for error code and error message.
|
inline |
Tries to determine whether a property is locked because a data stream is active.
[out] | err | Reference to an error handler. See Error Handling for details. |
true
, if the property is currently locked, and will likely be unlocked if the data stream is stopped.false
, if the property is not currently locked, or stopping the data stream will probably not lead to the property being unlocked.false
. Check the err output parameter for error code and error message.
|
inline |
Checks whether a property is currently locked.
A locked property can be read, but attempts to write its value will fail.
A property's locked status may change upon writing to another property.
Common examples for locked properties are ExposureTime
or Gain
if ExposureAuto
or GainAuto
are enabled.
[out] | err | Reference to an error handler. See Error Handling for details. |
true
, if the property is currently locked, otherwise false
.false
. Check the err output parameter for error code and error message.
|
inline |
Checks whether a property is read-only.
A read-only property will never be writable, the read-only status will never change.
A Common examples for a read-only property is DeviceTemperature
.
[out] | err | Reference to an error handler. See Error Handling for details. |
true
, if the property is read-only, otherwise false
.false
. Check the err output parameter for error code and error message.
|
inline |
Indicates whether this property's value changes the meaning and/or value of other properties.
[out] | err | Reference to an error handler. See Error Handling for details. |
true
if this property is a selector, otherwise false
.false
. Check the err output parameter for error code and error message.
|
inline |
Returns the name of the property.
[out] | err | Reference to an error handler. See Error Handling for details. |
err
output parameter for details.
|
inlinenoexcept |
Checks whether a property object refers to a different property as another property object.
[in] | other | A property object |
true
, if this property refers to a different as other, otherwise false
.
|
inlinenoexcept |
Provides an ordering of property objects.
The ordering is arbitrary but stable.
other | A property object |
bool
indicating the ordering relation between this
and other
.
|
inlinenoexcept |
Checks whether a property object refers to the same property as another property object.
[in] | other | A property object |
true
, if this property refers to the same property as other, otherwise false
.
|
inline |
Returns the list of properties whose values' meaning depend on this property.
[out] | err | Reference to an error handler. See Error Handling for details. |
std::vector
containing the selected properties.
|
inline |
Returns a tooltip for the property.
A property's tooltip is a text that can be used when a tooltip is required by a user interface. Usually, the tooltip is a very short description of the property.
[out] | err | Reference to an error handler. See Error Handling for details. |
|
inline |
Returns the type of the property.
[out] | err | Reference to an error handler. See Error Handling for details. |
err
output parameter for details.
|
inline |
Returns a visibility hint for the property.
The visibility hint can be used to create user interfaces with different complexities. The most commonly used properties have the beginner visibility, while rarely used or diagnostic features might be tagged guru or even invisible.
[out] | err | Reference to an error handler. See Error Handling for details. |
err
output parameter for details.