struct P1::CameraSdk::PropertySpecification

Overview

A detailed description of a camera property. More…

#include <P1CameraTypes.hpp>

struct PropertySpecification
{
    // fields

    uint32_t mId = kPropertyUndefined;
    PropertyValue mValue;
    std::string mName;
    std::string mGroup;
    bool mReadOnly = false;
    bool mEnabled = true;
    PropertyUserLevel mUserLevel = kPropertyUserLevelUndefined;
    bool mSelectOnly = false;
    bool mDisplayAsHex = false;
    bool mRefreshRequired = false;
    std::string mUnitString;
    std::string mDescription;
    uint32_t mDisplayIndex = 0;
    PropertyValue mDefault;
    PropertyRange mRange;
    std::vector<PropertyValue> mValueList;

    // methods

    std::string ToString() const;
};

Detailed Documentation

A detailed description of a camera property.

This class defines if a property has any restrictions to its valid values, like a range or even a list of allowed values.

All Properties belong to a category or group, have a unit and a visibility level, called the user level. The user level defines if the property is an advanced camera setting, that should probably be hidden from novice users.

To represent the current value of a proerty we use the class PropertyValue. It is also there the type of the property is defined.

You cannot change property specifications, you can change only property values, and only using Camera::SetProperty

You can obtain PropertySpecification objects from Camera::GetPropertySpec

Fields

uint32_t mId = kPropertyUndefined

The assigned id of the property.

All properties are identified uniquely by their Id. You use the Id to reference and look up properties on a camera.

PropertyValue mValue

The current value (and type) of the property.

This is the current assigned value to the property. If the property if not marked as read-only (mReadOnly), this value can be changed using Camera::SetProperty.

std::string mName

The (human readable) name of the property.

This name is localized based on the camera’s UI language setting. However, the default language is english.

This name can be presented to users in a UI

std::string mGroup

The group that this property belongs to.

The group is a string that might contain double colons “::”, to denote subgroups. You can use the group to group related properties in a UI.

bool mReadOnly = false

Indicates if this property is currently read only

Some properties are always read only, but others might be read only as a result of the camera settings. For example, if the exposure program is set to auto, then the ISO, Aperture and shutter properties are read_only. If the exposure program is set to manual, then they are writeable.

PropertyUserLevel mUserLevel = kPropertyUserLevelUndefined

The visibility level of this peroperty.

Some properties are more advanced than others. Use this member to hide the advanced properties from novice users.

uint32_t mDisplayIndex = 0

The sorting order of the property.

Instead of presenting properties as sorted by Id or name, sort by this integer. (Per group.)

PropertyValue mDefault

The default value of the property.

This is the value that the property is restored to, then “reset to default” is triggered, on the camera.

Note : that not all properties have a meaningful default value. (Such as “System clock”)

PropertyRange mRange

The valid range of the property value.

Some properties are restricted to have a valid range of values they can take. If a range is applicable for this property, the PropertyRange::mHas is true. If false, this member can be ignored.

std::vector<PropertyValue> mValueList

List of allowed values, for this property.

Some properties can only take values, from this list of allowed values. If this list is present (size > 0), and you set a value that is not in the list, two things can happen: 1. the camera rejects the value or, 2. the value is truncated to the nearest value in the list.

Methods

std::string ToString() const

Get a human readable description of this PropertySpecification.