STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Concurrency::graphics::unorm Class Reference

Represent a unorm number. Each element is a floating point number in the range of [0.0f, 1.0f]. More...

#include <amp_short_vectors.h>

Public Member Functions

 unorm (void) __GPU
 Default constructor. Initialize to 0.0f. More...
 
 unorm (float _V) __GPU
 Constructor. Initialize by clamping _V to the range of [0.0f, 1.0f]. More...
 
 unorm (unsigned int _V) __GPU
 Constructor. Initialize by casting _V to float, then clamping to the range of [0.0f, 1.0f]. More...
 
 unorm (int _V) __GPU
 Constructor. Initialize by casting _V to float, then clamping to the range of [0.0f, 1.0f]. More...
 
 unorm (double _V) __GPU
 Constructor. Initialize by casting _V to float, then clamping to the range of [0.0f, 1.0f]. More...
 
 unorm (const unorm &_Other) __GPU
 Copy constructor. More...
 
 unorm (const norm &_Other) __GPU
 Constructor. Initialize by clamping _Other to the range of [0.0f, 1.0f]. More...
 
unormoperator= (const unorm &_Other) __GPU
 
 operator float (void) const __GPU
 Conversion operator. Convert the unorm number to a floating point value. More...
 
unormoperator+= (const unorm &_Other) __GPU
 
unormoperator-= (const unorm &_Other) __GPU
 
unormoperator*= (const unorm &_Other) __GPU
 
unormoperator/= (const unorm &_Other) __GPU
 
unormoperator++ () __GPU
 
unorm operator++ (int) __GPU
 
unormoperator-- () __GPU
 
unorm operator-- (int) __GPU
 

Private Member Functions

void _Set (float _Val) __CPU_ONLY
 
void _Set (float _Val) __GPU_ONLY
 

Private Attributes

float _Value
 

Friends

class norm
 

Detailed Description

Represent a unorm number. Each element is a floating point number in the range of [0.0f, 1.0f].

Constructor & Destructor Documentation

Concurrency::graphics::unorm::unorm ( void  )
inline

Default constructor. Initialize to 0.0f.

59  {
60  _Value = 0.0f;
61  }
float _Value
Definition: amp_short_vectors.h:41
Concurrency::graphics::unorm::unorm ( float  _V)
inlineexplicit

Constructor. Initialize by clamping _V to the range of [0.0f, 1.0f].

Parameters
_VThe value used to initialize.
70  {
71  _Set(_V);
72  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
Concurrency::graphics::unorm::unorm ( unsigned int  _V)
inlineexplicit

Constructor. Initialize by casting _V to float, then clamping to the range of [0.0f, 1.0f].

Parameters
_VThe value used to initialize.
81  {
82  _Set(static_cast<float>(_V));
83  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
Concurrency::graphics::unorm::unorm ( int  _V)
inlineexplicit

Constructor. Initialize by casting _V to float, then clamping to the range of [0.0f, 1.0f].

Parameters
_VThe value used to initialize.
92  {
93  _Set(static_cast<float>(_V));
94  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
Concurrency::graphics::unorm::unorm ( double  _V)
inlineexplicit

Constructor. Initialize by casting _V to float, then clamping to the range of [0.0f, 1.0f].

Parameters
_VThe value used to initialize.
103  {
104  _Set(static_cast<float>(_V));
105  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
Concurrency::graphics::unorm::unorm ( const unorm _Other)
inline

Copy constructor.

Parameters
_OtherThe object to copy from.
114  {
115  _Value = _Other._Value;
116  }
float _Value
Definition: amp_short_vectors.h:41
Concurrency::graphics::unorm::unorm ( const norm _Other)
inlineexplicit

Constructor. Initialize by clamping _Other to the range of [0.0f, 1.0f].

Parameters
_OtherThe norm object used to initialize.
386  {
387  _Set(_Other._Value);
388  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42

Member Function Documentation

void Concurrency::graphics::unorm::_Set ( float  _Val)
inlineprivate
43  {
44  _Val = _Val < 0.0f ? 0.0f : _Val;
45  _Val = _Val > 1.0f ? 1.0f : _Val;
46  _Value = _Val;
47  }
_In_ int _Val
Definition: vcruntime_string.h:62
float _Value
Definition: amp_short_vectors.h:41
void Concurrency::graphics::unorm::_Set ( float  _Val)
inlineprivate
50  {
52  }
_In_ int _Val
Definition: vcruntime_string.h:62
float _Value
Definition: amp_short_vectors.h:41
float clamp(float _X, float _Min, float _Max) __GPU_ONLY
Clamps _X to the specified _Min and _Max range
Definition: amp.h:7241
Concurrency::graphics::unorm::operator float ( void  ) const
inline

Conversion operator. Convert the unorm number to a floating point value.

136  {
137  return _Value;
138  }
float _Value
Definition: amp_short_vectors.h:41
unorm& Concurrency::graphics::unorm::operator*= ( const unorm _Other)
inline
157  {
158  float _Res = _Value;
159  _Res *= _Other._Value;
160  _Set(_Res);
161  return *this;
162  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
float _Value
Definition: amp_short_vectors.h:41
unorm& Concurrency::graphics::unorm::operator++ ( )
inline
173  {
174  float _Res = _Value;
175  ++_Res;
176  _Set(_Res);
177  return *this;
178  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
float _Value
Definition: amp_short_vectors.h:41
unorm Concurrency::graphics::unorm::operator++ ( int  )
inline
181  {
182  unorm _Res = *this;
183  ++(*this);
184  return _Res;
185  }
unorm(void) __GPU
Default constructor. Initialize to 0.0f.
Definition: amp_short_vectors.h:58
unorm& Concurrency::graphics::unorm::operator+= ( const unorm _Other)
inline
141  {
142  float _Res = _Value;
143  _Res += _Other._Value;
144  _Set(_Res);
145  return *this;
146  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
float _Value
Definition: amp_short_vectors.h:41
unorm& Concurrency::graphics::unorm::operator-- ( )
inline
188  {
189  float _Res = _Value;
190  --_Res;
191  _Set(_Res);
192  return *this;
193  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
float _Value
Definition: amp_short_vectors.h:41
unorm Concurrency::graphics::unorm::operator-- ( int  )
inline
196  {
197  unorm _Res = *this;
198  --(*this);
199  return _Res;
200  }
unorm(void) __GPU
Default constructor. Initialize to 0.0f.
Definition: amp_short_vectors.h:58
unorm& Concurrency::graphics::unorm::operator-= ( const unorm _Other)
inline
149  {
150  float _Res = _Value;
151  _Res -= _Other._Value;
152  _Set(_Res);
153  return *this;
154  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
float _Value
Definition: amp_short_vectors.h:41
unorm& Concurrency::graphics::unorm::operator/= ( const unorm _Other)
inline
165  {
166  float _Res = _Value;
167  _Res /= _Other._Value;
168  _Set(_Res);
169  return *this;
170  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:42
float _Value
Definition: amp_short_vectors.h:41
unorm& Concurrency::graphics::unorm::operator= ( const unorm _Other)
inline
127  {
128  _Value = _Other._Value;
129  return *this;
130  }
float _Value
Definition: amp_short_vectors.h:41

Friends And Related Function Documentation

friend class norm
friend

Member Data Documentation

float Concurrency::graphics::unorm::_Value
private

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