|
libcamera v0.7.0+1595-4b6c47bd-nvm
Supporting cameras in Linux since 2019
|
Wrapper that stores a value in both quantized and floating-point form. More...
Public Types | |
| using | TraitsType = Traits |
| The traits policy type defining the quantization behaviour. | |
| using | QuantizedType = typename Traits::QuantizedType |
| The integer type used for the quantized representation. | |
Public Member Functions | |
| constexpr | Quantized (float x) |
| Construct a Quantized value from a floating-point number. | |
| constexpr | Quantized (QuantizedType x) |
| Construct a Quantized value from an existing quantized integer. | |
| constexpr Quantized & | operator= (float x) |
| Assign a floating-point value to the Quantized object. | |
| constexpr Quantized & | operator= (QuantizedType x) |
| Assign a quantized integer value to the Quantized object. | |
| constexpr float | value () const |
| Retrieve the floating-point representation. | |
| constexpr QuantizedType | quantized () const |
| Retrieve the quantized integer representation. | |
| constexpr bool | operator== (const Quantized &other) const |
| Compare two Quantized objects for equality. | |
| constexpr bool | operator!= (const Quantized &other) const |
| Compare two Quantized objects for inequality. | |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const Quantized< Traits > &q) |
| Insert a text representation of a Quantized into an output stream. | |
Wrapper that stores a value in both quantized and floating-point form.
| Traits | The traits class defining the quantization behaviour |
The Quantized struct template provides a thin wrapper around a quantized representation of a floating-point value. It uses a traits type Traits to define the conversion policy between the floating-point domain and the quantized integer domain.
Each Quantized instance maintains two synchronized members:
The traits type defines:
fromFloat() and toFloat(), andQuantized provides convenient constructors and assignment operators from either representation, as well as comparison and string formatting utilities.
| libcamera::ipa::Quantized< Traits >::QuantizedType |
The integer type used for the quantized representation.
This alias corresponds to TraitsType::QuantizedType, as defined by the traits class.
| libcamera::ipa::Quantized< Traits >::TraitsType |
The traits policy type defining the quantization behaviour.
Exposes the associated traits type used by this Quantized instance. This allows external code to refer to constants or metadata defined in the traits, such as TraitsType::min or TraitsType::max.
|
inlineconstexpr |
Construct a Quantized value from a floating-point number.
| [in] | x | The floating-point value to be quantized |
Converts the floating-point input x to its quantized integer representation using the associated traits policy, and initializes both the quantized and floating-point members.
|
inlineconstexpr |
Construct a Quantized value from an existing quantized integer.
| [in] | x | The quantized integer value |
Converts the quantized integer x to its corresponding floating-point value using the traits policy, and initializes both internal members.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Retrieve the quantized integer representation.
|
inlineconstexpr |
Retrieve the floating-point representation.
|
friend |