FotoSHOCK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
FotoSHOCKcore::ValueType Class Reference

A class representing a supported format in which pixel data are stored. More...

#include <ValueType.hpp>

Public Types

enum  Enum {
  value_ANY, value_ANYINT, value_ANYFLOAT, value_SAME,
  value_uint1, value_uint8, value_uint16, value_uint32,
  value_uint64, value_float, value_double
}
 Enumeration identifying a type.
 

Public Member Functions

 ValueType ()
 Default constructor. More...
 
 ValueType (const ValueType &other)=default
 Default copy constructor.
 
ValueTypeoperator= (const ValueType &other)=default
 Default assignment operator.
 
bool operator== (const ValueType &other)
 Check if two ValueType objects represent the same type.
 
bool operator!= (const ValueType &other)
 Check if two ValueType objects does not represent the same type.
 
constexpr operator Enum () const
 Conversion operator to ValueType::Enum. More...
 
constexpr unsigned int bits () const
 Maximal number of bits that can be used to store a value.
 
constexpr cmsUInt32Number cmsFormatter () const
 A type-dependent part of the LittleCMS formatter.
 

Protected Member Functions

constexpr ValueType (const Enum v, const unsigned int bit, const cmsUInt32Number formatter)
 Protected constructor used by ValueTypeEnum to create a list of supported formats.
 

Friends

class ValueTypeEnum
 

Detailed Description

A class representing a supported format in which pixel data are stored.

The class ValueType represents a supported pixel value format information, including the type (float, 8-bit int etc.) and some basic information about the format itself, such as how many bits can be used to store the value.

It is designed in a way that it can be easily used in conjunction with templates. If you need to design a template that depends on type that the ValueType represents, you use:

template <ValueType::Enum T>

in the template definition. The template can be instantiated using either ValueType::Enum value or a constant expression of type ValueType (preferred). The supported types in form of a constant expression are provided in the ValueTypeEnum class. This approach is useful when you need to introduce template specializations for specific formats.

Constructor & Destructor Documentation

FotoSHOCKcore::ValueType::ValueType ( )
inline

Default constructor.

Constructs a ValueType of type ANY, with bits and cms formatter set to 0.

Member Function Documentation

constexpr FotoSHOCKcore::ValueType::operator Enum ( ) const
inline

Conversion operator to ValueType::Enum.

This operator allows the constant expressions of type ValueType to be used in place of the ValueType::Enum


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