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::norm Class Reference

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

#include <amp_short_vectors.h>

Public Member Functions

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

Private Member Functions

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

Private Attributes

float _Value
 

Friends

class unorm
 

Detailed Description

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

Constructor & Destructor Documentation

Concurrency::graphics::norm::norm ( void  )
inline

Default constructor. Initialize to 0.0f.

230  {
231  _Value = 0.0f;
232  }
float _Value
Definition: amp_short_vectors.h:212
Concurrency::graphics::norm::norm ( float  _V)
inlineexplicit

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

Parameters
_VThe value used to initialize.
241  {
242  _Set(_V);
243  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
Concurrency::graphics::norm::norm ( unsigned int  _V)
inlineexplicit

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

Parameters
_VThe value used to initialize.
252  {
253  _Set(static_cast<float>(_V));
254  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
Concurrency::graphics::norm::norm ( int  _V)
inlineexplicit

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

Parameters
_VThe value used to initialize.
263  {
264  _Set(static_cast<float>(_V));
265  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
Concurrency::graphics::norm::norm ( double  _V)
inlineexplicit

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

Parameters
_VThe value used to initialize.
274  {
275  _Set(static_cast<float>(_V));
276  }
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
Concurrency::graphics::norm::norm ( const norm _Other)
inline

Copy constructor.

Parameters
_OtherThe object to copy from.
285  {
286  _Value = _Other._Value;
287  }
float _Value
Definition: amp_short_vectors.h:212
Concurrency::graphics::norm::norm ( const unorm _Other)
inline

Constructor.

Parameters
_OtherThe object used to initialize.
296  {
297  _Value = _Other._Value;
298  }
float _Value
Definition: amp_short_vectors.h:212

Member Function Documentation

void Concurrency::graphics::norm::_Set ( float  _Val)
inlineprivate
214  {
215  _Val = _Val < -1.0f ? -1.0f : _Val;
216  _Val = _Val > 1.0f ? 1.0f : _Val;
217  _Value = _Val;
218  }
float _Value
Definition: amp_short_vectors.h:212
_In_ int _Val
Definition: vcruntime_string.h:62
void Concurrency::graphics::norm::_Set ( float  _Val)
inlineprivate
221  {
222  _Value = Concurrency::direct3d::clamp(_Val, -1.0f, 1.0f);
223  }
float _Value
Definition: amp_short_vectors.h:212
_In_ int _Val
Definition: vcruntime_string.h:62
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::norm::operator float ( void  ) const
inline

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

310  {
311  return _Value;
312  }
float _Value
Definition: amp_short_vectors.h:212
norm& Concurrency::graphics::norm::operator*= ( const norm _Other)
inline
331  {
332  float _Res = _Value;
333  _Res *= _Other._Value;
334  _Set(_Res);
335  return *this;
336  }
float _Value
Definition: amp_short_vectors.h:212
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
norm& Concurrency::graphics::norm::operator++ ( )
inline
347  {
348  float _Res = _Value;
349  ++_Res;
350  _Set(_Res);
351  return *this;
352  }
float _Value
Definition: amp_short_vectors.h:212
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
norm Concurrency::graphics::norm::operator++ ( int  )
inline
355  {
356  norm _Res = *this;
357  ++(*this);
358  return _Res;
359  }
norm(void) __GPU
Default constructor. Initialize to 0.0f.
Definition: amp_short_vectors.h:229
norm& Concurrency::graphics::norm::operator+= ( const norm _Other)
inline
315  {
316  float _Res = _Value;
317  _Res += _Other._Value;
318  _Set(_Res);
319  return *this;
320  }
float _Value
Definition: amp_short_vectors.h:212
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
norm Concurrency::graphics::norm::operator- ( void  ) const
inline
377  {
378  norm _Ret;
379  _Ret._Value = -_Value;
380  return _Ret;
381  }
float _Value
Definition: amp_short_vectors.h:212
norm(void) __GPU
Default constructor. Initialize to 0.0f.
Definition: amp_short_vectors.h:229
norm& Concurrency::graphics::norm::operator-- ( )
inline
362  {
363  float _Res = _Value;
364  --_Res;
365  _Set(_Res);
366  return *this;
367  }
float _Value
Definition: amp_short_vectors.h:212
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
norm Concurrency::graphics::norm::operator-- ( int  )
inline
370  {
371  norm _Res = *this;
372  --(*this);
373  return _Res;
374  }
norm(void) __GPU
Default constructor. Initialize to 0.0f.
Definition: amp_short_vectors.h:229
norm& Concurrency::graphics::norm::operator-= ( const norm _Other)
inline
323  {
324  float _Res = _Value;
325  _Res -= _Other._Value;
326  _Set(_Res);
327  return *this;
328  }
float _Value
Definition: amp_short_vectors.h:212
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
norm& Concurrency::graphics::norm::operator/= ( const norm _Other)
inline
339  {
340  float _Res = _Value;
341  _Res /= _Other._Value;
342  _Set(_Res);
343  return *this;
344  }
float _Value
Definition: amp_short_vectors.h:212
void _Set(float _Val) __CPU_ONLY
Definition: amp_short_vectors.h:213
norm& Concurrency::graphics::norm::operator= ( const norm _Other)
inline
301  {
302  _Value = _Other._Value;
303  return *this;
304  }
float _Value
Definition: amp_short_vectors.h:212

Friends And Related Function Documentation

friend class unorm
friend

Member Data Documentation

float Concurrency::graphics::norm::_Value
private

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