ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::NumericTraits< RGBPixel< T > > Class Template Reference

#include <itkNumericTraitsRGBPixel.h>

Detailed Description

template<typename T>
class itk::NumericTraits< RGBPixel< T > >

Define numeric traits for RGBPixel.

Template Parameters
TComponent type of RGBPixel

We provide here a generic implementation based on creating types of RGBPixel whose components are the types of the NumericTraits from the original RGBPixel components. This implementation require support for partial specializations, since it is based on the concept that: NumericTraits<RGBPixel< T > > is defined piecewise by RGBPixel< NumericTraits< T > >

See also
NumericTraits

Definition at line 43 of file itkNumericTraitsRGBPixel.h.

+ Inheritance diagram for itk::NumericTraits< RGBPixel< T > >:
+ Collaboration diagram for itk::NumericTraits< RGBPixel< T > >:

Public Types

using AbsType
 
using AbsType = RGBPixel<ElementAbsType>
 
using AccumulateType
 
using AccumulateType = RGBPixel<ElementAccumulateType>
 
using FloatType
 
using FloatType = RGBPixel<ElementFloatType>
 
using MeasurementVectorType
 
using MeasurementVectorType = Self
 
using PrintType
 
using PrintType = RGBPixel<ElementPrintType>
 
using RealType
 
using RealType = RGBPixel<ElementRealType>
 
using ScalarRealType
 
using ScalarRealType = ElementRealType
 
using Self = RGBPixel<T>
 
using TraitsType
 
using ValueType
 
using ValueType = T
 

Static Public Member Functions

static void AssignToArray (const Self &v, MeasurementVectorType &mv)
 
template<typename TArray>
static void AssignToArray (const Self &v, TArray &mv)
 
static void AssignToArray (const T &v, TArray &mv)
 
static unsigned int GetLength ()
 
static unsigned int GetLength ()
 
static unsigned int GetLength (const RGBPixel< T > &)
 
static unsigned int GetLength (const T &)
 
static bool IsNegative (Self val)
 
static bool IsNegative (T val)
 
static bool IsNonnegative (Self val)
 
static bool IsNonnegative (T val)
 
static bool IsNonpositive (Self val)
 
static bool IsNonpositive (T val)
 
static bool IsPositive (Self val)
 
static bool IsPositive (T val)
 
static const Self max ()
 
static const Self max (const Self &)
 
static constexpr T max (const T &)
 
static const Self min ()
 
static const Self min (const Self &)
 
static constexpr T min (const T &)
 
static constexpr T NonpositiveMin ()
 
static const Self NonpositiveMin ()
 
static const Self NonpositiveMin (const Self &)
 
static T NonpositiveMin (const T &)
 
static T OneValue ()
 
static const Self OneValue ()
 
static const Self OneValue (const Self &)
 
static T OneValue (const T &)
 
static void SetLength (T &m, const unsigned int s)
 
static T ZeroValue ()
 
static const Self ZeroValue ()
 
static const Self ZeroValue (const Self &)
 
static T ZeroValue (const T &)
 
static void SetLength (RGBPixel< T > &m, const unsigned int s)
 

Static Public Attributes

static constexpr bool IsComplex
 
static constexpr bool IsComplex = NumericTraits<ValueType>::IsComplex
 
static constexpr bool IsInteger
 
static constexpr bool IsInteger = std::is_integral_v<ValueType>
 
static constexpr bool IsSigned
 
static constexpr bool IsSigned = std::is_signed_v<ValueType>
 
static const T ITKCommon_EXPORT One
 
static const Self ITKCommon_EXPORT One
 
static const T ITKCommon_EXPORT Zero
 
static const Self ITKCommon_EXPORT Zero
 

Private Types

using ElementAbsType = typename NumericTraits<T>::AbsType
 
using ElementAccumulateType = typename NumericTraits<T>::AccumulateType
 
using ElementFloatType = typename NumericTraits<T>::FloatType
 
using ElementPrintType = typename NumericTraits<T>::PrintType
 
using ElementRealType = typename NumericTraits<T>::RealType
 

Member Typedef Documentation

◆ AbsType [1/2]

using itk::NumericTraits< T >::AbsType

Return value of itk::Math::abs().

Definition at line 73 of file itkNumericTraits.h.

◆ AbsType [2/2]

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::AbsType = RGBPixel<ElementAbsType>

Unsigned component type

Definition at line 59 of file itkNumericTraitsRGBPixel.h.

◆ AccumulateType [1/2]

using itk::NumericTraits< T >::AccumulateType

Accumulation of addition and multiplication.

Definition at line 76 of file itkNumericTraits.h.

◆ AccumulateType [2/2]

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::AccumulateType = RGBPixel<ElementAccumulateType>

Accumulation of addition and multiplication.

Definition at line 62 of file itkNumericTraitsRGBPixel.h.

◆ ElementAbsType

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::ElementAbsType = typename NumericTraits<T>::AbsType
private

Definition at line 46 of file itkNumericTraitsRGBPixel.h.

◆ ElementAccumulateType

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::ElementAccumulateType = typename NumericTraits<T>::AccumulateType
private

Definition at line 47 of file itkNumericTraitsRGBPixel.h.

◆ ElementFloatType

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::ElementFloatType = typename NumericTraits<T>::FloatType
private

Definition at line 48 of file itkNumericTraitsRGBPixel.h.

◆ ElementPrintType

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::ElementPrintType = typename NumericTraits<T>::PrintType
private

Definition at line 49 of file itkNumericTraitsRGBPixel.h.

◆ ElementRealType

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::ElementRealType = typename NumericTraits<T>::RealType
private

Definition at line 50 of file itkNumericTraitsRGBPixel.h.

◆ FloatType [1/2]

using itk::NumericTraits< T >::FloatType

Typedef for operations that use floating point instead of real precision to save memory

Definition at line 83 of file itkNumericTraits.h.

◆ FloatType [2/2]

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::FloatType = RGBPixel<ElementFloatType>

Typedef for operations that use floating point instead of real precision

Definition at line 66 of file itkNumericTraitsRGBPixel.h.

◆ MeasurementVectorType [1/2]

using itk::NumericTraits< T >::MeasurementVectorType

Measurement vector type

Definition at line 79 of file itkNumericTraits.h.

◆ MeasurementVectorType [2/2]

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::MeasurementVectorType = Self

Measurement vector type

Definition at line 78 of file itkNumericTraitsRGBPixel.h.

◆ PrintType [1/2]

using itk::NumericTraits< T >::PrintType

Return the type that can be printed.

Definition at line 70 of file itkNumericTraits.h.

◆ PrintType [2/2]

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::PrintType = RGBPixel<ElementPrintType>

Return the type that can be printed.

Definition at line 69 of file itkNumericTraitsRGBPixel.h.

◆ RealType [1/2]

using itk::NumericTraits< T >::RealType

Type for real-valued scalar operations.

Definition at line 86 of file itkNumericTraits.h.

◆ RealType [2/2]

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::RealType = RGBPixel<ElementRealType>

Type for real-valued scalar operations.

Definition at line 72 of file itkNumericTraitsRGBPixel.h.

◆ ScalarRealType [1/2]

using itk::NumericTraits< T >::ScalarRealType

Type for real-valued scalar operations.

Definition at line 89 of file itkNumericTraits.h.

◆ ScalarRealType [2/2]

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::ScalarRealType = ElementRealType

Type for real-valued scalar operations.

Definition at line 75 of file itkNumericTraitsRGBPixel.h.

◆ Self

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::Self = RGBPixel<T>

Definition at line 56 of file itkNumericTraitsRGBPixel.h.

◆ TraitsType

using itk::NumericTraits< T >::TraitsType

The type of this limits trait object.

Definition at line 64 of file itkNumericTraits.h.

◆ ValueType [1/2]

using itk::NumericTraits< T >::ValueType

Return the type of this native type.

Definition at line 67 of file itkNumericTraits.h.

◆ ValueType [2/2]

template<typename T>
using itk::NumericTraits< RGBPixel< T > >::ValueType = T

Return the type of the native component type.

Definition at line 54 of file itkNumericTraitsRGBPixel.h.

Member Function Documentation

◆ AssignToArray() [1/3]

template<typename T>
static void itk::NumericTraits< RGBPixel< T > >::AssignToArray ( const Self & v,
MeasurementVectorType & mv )
inlinestatic

Definition at line 207 of file itkNumericTraitsRGBPixel.h.

◆ AssignToArray() [2/3]

template<typename T>
template<typename TArray>
static void itk::NumericTraits< RGBPixel< T > >::AssignToArray ( const Self & v,
TArray & mv )
inlinestatic

Definition at line 214 of file itkNumericTraitsRGBPixel.h.

◆ AssignToArray() [3/3]

static void itk::NumericTraits< T >::AssignToArray ( const T & v,
TArray & mv )
inlinestatic

assign the value to an array

Definition at line 245 of file itkNumericTraits.h.

◆ GetLength() [1/4]

static unsigned int itk::NumericTraits< T >::GetLength ( )
inlinestatic

Return the length of the scalar: 1. Array types can return a different value

Definition at line 210 of file itkNumericTraits.h.

◆ GetLength() [2/4]

template<typename T>
static unsigned int itk::NumericTraits< RGBPixel< T > >::GetLength ( )
inlinestatic

Return the dimensionality of the pixel. Always returns 3.

Definition at line 201 of file itkNumericTraitsRGBPixel.h.

◆ GetLength() [3/4]

template<typename T>
static unsigned int itk::NumericTraits< RGBPixel< T > >::GetLength ( const RGBPixel< T > & )
inlinestatic

Return the dimensionality of the pixel. Always returns 3.

Definition at line 194 of file itkNumericTraitsRGBPixel.h.

◆ GetLength() [4/4]

static unsigned int itk::NumericTraits< T >::GetLength ( const T & )
inlinestatic

Return the length of the scalar. This API is needed for VariableLengthVector because its length is only known at run-time. Specializations of the VariableLengthVector will provide a different implementation where a vector of the correct size is built.

Definition at line 203 of file itkNumericTraits.h.

◆ IsNegative() [1/2]

template<typename T>
static bool itk::NumericTraits< RGBPixel< T > >::IsNegative ( Self val)
inlinestatic

Is a given value negative?

Definition at line 161 of file itkNumericTraitsRGBPixel.h.

References itk::RGBPixel< TComponent >::GetLuminance(), and itk::NumericTraits< T >::IsNegative().

◆ IsNegative() [2/2]

static bool itk::NumericTraits< T >::IsNegative ( T val)
inlinestatic

Is a given value negative?

Definition at line 120 of file itkNumericTraits.h.

◆ IsNonnegative() [1/2]

template<typename T>
static bool itk::NumericTraits< RGBPixel< T > >::IsNonnegative ( Self val)
inlinestatic

Is a given value nonnegative?

Definition at line 168 of file itkNumericTraitsRGBPixel.h.

References itk::RGBPixel< TComponent >::GetLuminance(), and itk::NumericTraits< T >::IsNonnegative().

◆ IsNonnegative() [2/2]

static bool itk::NumericTraits< T >::IsNonnegative ( T val)
inlinestatic

Is a given value nonnegative?

Definition at line 127 of file itkNumericTraits.h.

◆ IsNonpositive() [1/2]

template<typename T>
static bool itk::NumericTraits< RGBPixel< T > >::IsNonpositive ( Self val)
inlinestatic

Is a given value nonpositive?

Definition at line 154 of file itkNumericTraitsRGBPixel.h.

References itk::RGBPixel< TComponent >::GetLuminance(), and itk::NumericTraits< T >::IsNonpositive().

◆ IsNonpositive() [2/2]

static bool itk::NumericTraits< T >::IsNonpositive ( T val)
inlinestatic

Is a given value nonpositive?

Definition at line 113 of file itkNumericTraits.h.

◆ IsPositive() [1/2]

template<typename T>
static bool itk::NumericTraits< RGBPixel< T > >::IsPositive ( Self val)
inlinestatic

Is a given value positive?

Definition at line 147 of file itkNumericTraitsRGBPixel.h.

References itk::RGBPixel< TComponent >::GetLuminance(), and itk::NumericTraits< T >::IsPositive().

◆ IsPositive() [2/2]

static bool itk::NumericTraits< T >::IsPositive ( T val)
inlinestatic

Is a given value positive?

Definition at line 106 of file itkNumericTraits.h.

◆ max() [1/3]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::max ( )
inlinestatic

Definition at line 98 of file itkNumericTraitsRGBPixel.h.

References itk::MakeFilled(), and itk::NumericTraits< T >::max().

◆ max() [2/3]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::max ( const Self & )
inlinestatic

Component wise defined element

Note
minimum value for floating pointer types is defined as minimum positive normalize value.

Definition at line 86 of file itkNumericTraitsRGBPixel.h.

References itk::MakeFilled(), and itk::NumericTraits< T >::max().

◆ max() [3/3]

static constexpr T itk::NumericTraits< T >::max ( const T & )
inlinestaticconstexpr

Definition at line 169 of file itkNumericTraits.h.

◆ min() [1/3]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::min ( )
inlinestatic

◆ min() [2/3]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::min ( const Self & )
inlinestatic

Definition at line 92 of file itkNumericTraitsRGBPixel.h.

References itk::MakeFilled(), and itk::NumericTraits< T >::min().

◆ min() [3/3]

static constexpr T itk::NumericTraits< T >::min ( const T & )
inlinestaticconstexpr

Definition at line 174 of file itkNumericTraits.h.

◆ NonpositiveMin() [1/4]

static constexpr T itk::NumericTraits< T >::NonpositiveMin ( )
inlinestaticconstexpr

Smallest (most nonpositive) value

Definition at line 99 of file itkNumericTraits.h.

◆ NonpositiveMin() [2/4]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::NonpositiveMin ( )
inlinestatic

◆ NonpositiveMin() [3/4]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::NonpositiveMin ( const Self & )
inlinestatic

◆ NonpositiveMin() [4/4]

static T itk::NumericTraits< T >::NonpositiveMin ( const T & )
inlinestatic

Smallest (most nonpositive) value. This API is needed for VariableLengthVector because its length is only known at run-time.

Definition at line 219 of file itkNumericTraits.h.

◆ OneValue() [1/4]

static T itk::NumericTraits< T >::OneValue ( )
inlinestatic

Return one value. This function should be used to support RGBPixel type and standard types (not vectors)

Definition at line 158 of file itkNumericTraits.h.

◆ OneValue() [2/4]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::OneValue ( )
inlinestatic

◆ OneValue() [3/4]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::OneValue ( const Self & )
inlinestatic

Definition at line 140 of file itkNumericTraitsRGBPixel.h.

References itk::NumericTraits< T >::OneValue().

◆ OneValue() [4/4]

static T itk::NumericTraits< T >::OneValue ( const T & )
inlinestatic

One value. This API is needed for VariableLengthVector because its length is only known at run-time.

Definition at line 237 of file itkNumericTraits.h.

◆ SetLength() [1/2]

template<typename T>
static void itk::NumericTraits< RGBPixel< T > >::SetLength ( RGBPixel< T > & m,
const unsigned int s )
inlinestatic

RGB pixels must have 3 components, so the size cannot be set to anything besides 3. If called with size of 3, this function will fill the pixel with zeros.

Definition at line 181 of file itkNumericTraitsRGBPixel.h.

References itk::FixedArray< TValue, VLength >::Fill().

◆ SetLength() [2/2]

static void itk::NumericTraits< T >::SetLength ( T & m,
const unsigned int s )
inlinestatic

Scalars cannot be resized, so an exception will be thrown if the input size is not 1. If the size is valid the will be zeros. This API is needed for VariableLengthVector because its length is only known at run-time. Specializations of the VariableLengthVector will provide a different implementation where a vector of the correct size is built.

Definition at line 187 of file itkNumericTraits.h.

◆ ZeroValue() [1/4]

static T itk::NumericTraits< T >::ZeroValue ( )
inlinestatic

Return zero value. This function should be used to support RGBPixel type and standard types (not vectors)

Definition at line 150 of file itkNumericTraits.h.

◆ ZeroValue() [2/4]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::ZeroValue ( )
inlinestatic

Definition at line 116 of file itkNumericTraitsRGBPixel.h.

◆ ZeroValue() [3/4]

template<typename T>
static const Self itk::NumericTraits< RGBPixel< T > >::ZeroValue ( const Self & )
inlinestatic

Definition at line 134 of file itkNumericTraitsRGBPixel.h.

References itk::NumericTraits< T >::ZeroValue().

◆ ZeroValue() [4/4]

static T itk::NumericTraits< T >::ZeroValue ( const T & )
inlinestatic

Zero value. This API is needed for VariableLengthVector because its length is only known at run-time.

Definition at line 228 of file itkNumericTraits.h.

Member Data Documentation

◆ IsComplex [1/2]

bool itk::NumericTraits< T >::IsComplex
staticconstexpr

Is a given type complex? – default is no. For uniform array data types in ITK, the value of IsComplex is determined by the component elements of the array.

Definition at line 145 of file itkNumericTraits.h.

◆ IsComplex [2/2]

template<typename T>
bool itk::NumericTraits< RGBPixel< T > >::IsComplex = NumericTraits<ValueType>::IsComplex
staticconstexpr

Definition at line 175 of file itkNumericTraitsRGBPixel.h.

◆ IsInteger [1/2]

bool itk::NumericTraits< T >::IsInteger
staticconstexpr

Is a given type an integer? – default is no. For uniform array data types in ITK, the value of IsInteger is determined by the component elements of the array.

Definition at line 140 of file itkNumericTraits.h.

◆ IsInteger [2/2]

template<typename T>
bool itk::NumericTraits< RGBPixel< T > >::IsInteger = std::is_integral_v<ValueType>
staticconstexpr

Definition at line 174 of file itkNumericTraitsRGBPixel.h.

◆ IsSigned [1/2]

bool itk::NumericTraits< T >::IsSigned
staticconstexpr

Is a given type signed? – default is no. For uniform array data types in ITK, the value of IsSigned is determined by the component elements of the array.

Definition at line 135 of file itkNumericTraits.h.

◆ IsSigned [2/2]

template<typename T>
bool itk::NumericTraits< RGBPixel< T > >::IsSigned = std::is_signed_v<ValueType>
staticconstexpr

Definition at line 173 of file itkNumericTraitsRGBPixel.h.

◆ One [1/2]

const T ITKCommon_EXPORT itk::NumericTraits< T >::One
static

Multiplicative identity.

Definition at line 95 of file itkNumericTraits.h.

◆ One [2/2]

template<typename T>
const Self ITKCommon_EXPORT itk::NumericTraits< RGBPixel< T > >::One
static

Definition at line 226 of file itkNumericTraitsRGBPixel.h.

◆ Zero [1/2]

const T ITKCommon_EXPORT itk::NumericTraits< T >::Zero
static

Additive identity.

Definition at line 92 of file itkNumericTraits.h.

◆ Zero [2/2]

template<typename T>
const Self ITKCommon_EXPORT itk::NumericTraits< RGBPixel< T > >::Zero
static
Note
: the functions are preferred over the member variables as they are defined for all partial specialization

Definition at line 225 of file itkNumericTraitsRGBPixel.h.


The documentation for this class was generated from the following file: