libcamera v0.7.0+1595-4b6c47bd-nvm
Supporting cameras in Linux since 2019
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
libcamera::ipa::Quantized< Traits > Struct Template Reference

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 Quantizedoperator= (float x)
 Assign a floating-point value to the Quantized object.
 
constexpr Quantizedoperator= (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.
 

Detailed Description

template<typename Traits>
struct libcamera::ipa::Quantized< Traits >

Wrapper that stores a value in both quantized and floating-point form.

Template Parameters
TraitsThe 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:

Quantized provides convenient constructors and assignment operators from either representation, as well as comparison and string formatting utilities.

Member Typedef Documentation

◆ QuantizedType

template<typename Traits >
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.

◆ TraitsType

template<typename Traits >
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.

Constructor & Destructor Documentation

◆ Quantized() [1/2]

template<typename Traits >
libcamera::ipa::Quantized< Traits >::Quantized ( float  x)
inlineconstexpr

Construct a Quantized value from a floating-point number.

Parameters
[in]xThe 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.

◆ Quantized() [2/2]

template<typename Traits >
libcamera::ipa::Quantized< Traits >::Quantized ( QuantizedType  x)
inlineconstexpr

Construct a Quantized value from an existing quantized integer.

Parameters
[in]xThe quantized integer value

Converts the quantized integer x to its corresponding floating-point value using the traits policy, and initializes both internal members.

Member Function Documentation

◆ operator!=()

template<typename Traits >
libcamera::ipa::Quantized< Traits >::operator!= ( const Quantized< Traits > &  other) const
inlineconstexpr

Compare two Quantized objects for inequality.

Parameters
[in]otherThe other Quantized object to compare against
Returns
True if the quantized integer values differ

◆ operator=() [1/2]

template<typename Traits >
libcamera::ipa::Quantized< Traits >::operator= ( float  x)
inlineconstexpr

Assign a floating-point value to the Quantized object.

Parameters
[in]xThe floating-point value to assign
Returns
A reference to the updated Quantized object

Converts the floating-point value x to its quantized integer representation using the traits policy and updates both members.

◆ operator=() [2/2]

template<typename Traits >
libcamera::ipa::Quantized< Traits >::operator= ( QuantizedType  x)
inlineconstexpr

Assign a quantized integer value to the Quantized object.

Parameters
[in]xThe quantized integer value to assign
Returns
A reference to the updated Quantized object

Converts the quantized integer x to its corresponding floating-point value using the traits policy and updates both members.

◆ operator==()

template<typename Traits >
libcamera::ipa::Quantized< Traits >::operator== ( const Quantized< Traits > &  other) const
inlineconstexpr

Compare two Quantized objects for equality.

Parameters
[in]otherThe other Quantized object to compare against
Returns
True if both objects have the same quantized integer value

◆ quantized()

template<typename Traits >
libcamera::ipa::Quantized< Traits >::quantized ( ) const
inlineconstexpr

Retrieve the quantized integer representation.

Returns
The quantized integer value

◆ value()

template<typename Traits >
libcamera::ipa::Quantized< Traits >::value ( ) const
inlineconstexpr

Retrieve the floating-point representation.

Returns
The floating-point value corresponding to the quantized value

Friends And Related Symbol Documentation

◆ operator<<

template<typename Traits >
std::ostream & libcamera::ipa::Quantized< Traits >::operator<< ( std::ostream &  out,
const Quantized< Traits > &  q 
)
friend

Insert a text representation of a Quantized into an output stream.

Parameters
[in]outThe output stream
[in]qThe Quantized
Returns
The output stream out

The documentation for this struct was generated from the following files: