Nebula
Loading...
Searching...
No Matches
Util::Colour Class Reference

#include <colour.h>

Detailed Description

For now just a wrapper around Math::vec4 for type safety.

Inherits Math::vec4.

Public Member Functions

 Colour ()=default
 
 Colour (const Colour &c)=default
 
 Colour (float r, float g, float b, float a)
 
 Colour (const Math::vec4 &v)
 copy constructor from vec4
 
 Colour (const Math::vec3 &v)
 copy constructor from vec3, alpha is set to 1
 
 Colour (uint32_t argb)
 converts byte order A|R|G|B to 0..1 floats
 
 Colour (uint8_t r, uint8_t g, uint8_t b, uint8_t a)
 
- Public Member Functions inherited from Math::vec4
 vec4 ()=default
 default constructor, NOTE: does NOT setup components!
 
 vec4 (scalar x, scalar y, scalar z, scalar w)
 construct from values
 
 vec4 (scalar v)
 construct from single value
 
 vec4 (const vec4 &rhs)=default
 copy constructor
 
 vec4 (const vec3 &rhs, float w)
 copy constructor from vec3
 
 vec4 (const __m128 &rhs)
 construct from SSE 128 byte float array
 
void operator= (const __m128 &rhs)
 assign an vmVector4
 
void operator+= (const vec4 &rhs)
 inplace add
 
void operator-= (const vec4 &rhs)
 inplace sub
 
void operator*= (scalar s)
 inplace scalar multiply
 
void operator*= (const vec4 &rhs)
 muliply by a vector component-wise
 
void operator/= (const vec4 &rhs)
 divide by a vector component-wise
 
bool operator== (const vec4 &rhs) const
 equality operator
 
bool operator!= (const vec4 &rhs) const
 inequality operator
 
void load (const scalar *ptr)
 load content from 16-byte-aligned memory
 
void loadu (const scalar *ptr)
 load content from unaligned memory
 
void store (scalar *ptr) const
 write content to 16-byte-aligned memory through the write cache
 
void storeu (scalar *ptr) const
 write content to unaligned memory through the write cache
 
void store3 (scalar *ptr) const
 write content to 16-byte-aligned memory through the write cache
 
void storeu3 (scalar *ptr) const
 write content to unaligned memory through the write cache
 
void stream (scalar *ptr) const
 stream content to 16-byte-aligned memory circumventing the write-cache
 
void load_float3 (const void *ptr, float w)
 load 3 floats into x,y,z from unaligned memory
 
void load_ubyte4n (const void *ptr)
 load from UByte4N packed vector
 
void load_byte4n (const void *ptr)
 load from Byte4N packed vector
 
void set (scalar x, scalar y, scalar z, scalar w)
 set content
 
template<int X, int Y, int Z, int W>
vec4 swizzle (const vec4 &v)
 swizzle vector
 
scalaroperator[] (const int index)
 read-only access to indexed component
 
scalar operator[] (const int index) const
 read-only access to indexed component
 

Additional Inherited Members

- Public Attributes inherited from Math::vec4
union { 
 
   struct { 
 
      float   x 
 
      float   y 
 
      float   z 
 
      float   w 
 
   }  
 
   __m128   vec 
 
   float   v [4] 
 
};  
 

Constructor & Destructor Documentation

◆ Colour() [1/7]

Util::Colour::Colour ( )
default

◆ Colour() [2/7]

Util::Colour::Colour ( const Colour & c)
default

◆ Colour() [3/7]

__forceinline Util::Colour::Colour ( float r,
float g,
float b,
float a )

◆ Colour() [4/7]

__forceinline Util::Colour::Colour ( const Math::vec4 & v)

copy constructor from vec4

◆ Colour() [5/7]

__forceinline Util::Colour::Colour ( const Math::vec3 & v)

copy constructor from vec3, alpha is set to 1

◆ Colour() [6/7]

__forceinline Util::Colour::Colour ( uint32_t argb)

converts byte order A|R|G|B to 0..1 floats

◆ Colour() [7/7]

__forceinline Util::Colour::Colour ( uint8_t r,
uint8_t g,
uint8_t b,
uint8_t a )

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