20template<
typename Traits>
24 static_assert(std::is_arithmetic_v<QuantizedType>,
25 "Quantized: QuantizedType must be arithmetic");
31 : Quantized(Traits::fromFloat(x))
36 : quantized_(x), value_(Traits::toFloat(x))
52 constexpr float value()
const {
return value_; }
57 return quantized_ == other.quantized_;
62 return !(*
this == other);
66 const Quantized<Traits> &q)
69 <<
":" << q.
value() <<
"]";
The IPA (Image Processing Algorithm) namespace.
Definition af.cpp:58
Top-level libcamera namespace.
Definition backtrace.h:17
constexpr Quantized & operator=(QuantizedType x)
Assign a quantized integer value to the Quantized object.
Definition quantized.h:46
constexpr Quantized(QuantizedType x)
Construct a Quantized value from an existing quantized integer.
Definition quantized.h:35
typename FixedPointQTraits< I, F, decltype(details::qtype< I+F >())>::QuantizedType QuantizedType
Definition quantized.h:23
FixedPointQTraits< I, F, decltype(details::qtype< I+F >())> TraitsType
Definition quantized.h:22
constexpr Quantized & operator=(float x)
Assign a floating-point value to the Quantized object.
Definition quantized.h:40
constexpr bool operator!=(const Quantized &other) const
Compare two Quantized objects for inequality.
Definition quantized.h:60
friend std::ostream & operator<<(std::ostream &out, const Quantized< Traits > &q)
Insert a text representation of a Quantized into an output stream.
Definition quantized.h:65
constexpr Quantized(float x)
Construct a Quantized value from a floating-point number.
Definition quantized.h:30
constexpr bool operator==(const Quantized &other) const
Compare two Quantized objects for equality.
Definition quantized.h:55
constexpr float value() const
Retrieve the floating-point representation.
Definition quantized.h:52
constexpr QuantizedType quantized() const
Retrieve the quantized integer representation.
Definition quantized.h:53
Miscellaneous utility functions.
details::hex hex(T value, unsigned int width=details::hex_width< T >())
Write an hexadecimal value to an output string.
Definition utils.h:108