24 #pragma warning(disable:4251) 51 x = y = z = std::numeric_limits<float>::quiet_NaN();
61 inline void setRgba(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a)
63 this->rgba =
static_cast<uint32_t
>((a << 24) | (r << 16) | (g << 8) | b);
67 inline void setRgb(
unsigned char r,
unsigned char g,
unsigned char b)
81 this->contrast = value;
87 return (this->rgba >> 24) & 0xff;
91 inline unsigned char red()
const 93 return (this->rgba >> 16) & 0xff;
97 inline unsigned char green()
const 99 return (this->rgba >> 8) & 0xff;
103 inline unsigned char blue()
const 105 return (this->rgba & 0xff);
111 unsigned short r =
red();
112 unsigned short g =
green();
113 unsigned short b =
blue();
114 return static_cast<unsigned char>((r+g+b)/3);
uint32_t rgba
Color (red,green,blue,alpha)
Definition: Point.h:37
unsigned char intensity()
Get the intensity of the point.
Definition: Point.h:109
unsigned char green() const
Get the green color value for the point.
Definition: Point.h:97
void setRgb(unsigned char r, unsigned char g, unsigned char b)
Set the r,g,b color value for the point.
Definition: Point.h:67
float z
Z coordinate.
Definition: Point.h:35
float y
Y coordinate.
Definition: Point.h:34
float x
X coordinate.
Definition: Point.h:33
unsigned char red() const
Get the red color value for the point.
Definition: Point.h:91
Definition: Application.h:19
bool isNaN() const
Check whether the point is valid (Not-a-Number)
Definition: Point.h:55
void setRgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Set the r,g,b and alpha color value for the point.
Definition: Point.h:61
void setNaN()
Invalidate the point (set it to Not-a-Number)
Definition: Point.h:49
unsigned char blue() const
Get the blue color value for the point.
Definition: Point.h:103
void setContrast(float value)
Set the contrast for the point.
Definition: Point.h:79
void setIntensity(unsigned char val)
Set the intensity for the point (sets r,g and b to identical values)
Definition: Point.h:73
A 3D point with contrast and RGBA values.
Definition: Point.h:30
float contrast
Contrast.
Definition: Point.h:36
unsigned char alpha()
Get the alpha value for the point.
Definition: Point.h:85
Point()
Construct a 3D point at (0,0,0) with contrast 0 and color values (r,g,b,a) = (0,0,0,255)
Definition: Point.h:40