template struct P1::ImageSdk::ValueRange

Overview

A structure defining a minimum, maximum and default values. To be used for numeric properties. More…

#include <P1ImageConvertConfig.hpp>

template <typename T>
struct ValueRange
{
    // fields

    const T minValue;
    const T maxValue;
    const T defaultValue;

    // construction

    ValueRange(T min, T max, T def);

    // methods

    T TrimmedValue(T input) const;
    bool IsDefaultValue(T input) const;
};

Detailed Documentation

A structure defining a minimum, maximum and default values. To be used for numeric properties.

Fields

const T minValue

The minimum value.

const T maxValue

The maximum value.

const T defaultValue

The default value.

Construction

ValueRange(T min, T max, T def)

The constructor.

Methods

T TrimmedValue(T input) const

Return a clamped value of the input.

bool IsDefaultValue(T input) const

Return true if the input matches the default value.