1 #ifndef Lumiverse_PIXEL_H
2 #define Lumiverse_PIXEL_H
4 #ifdef USE_ARNOLD_CACHING
21 virtual inline float illum() = 0;
28 class Pixel3 :
public Pixel {
36 Pixel3(
float x,
float y,
float z) {
44 Pixel3 operator *(
float scalar) {
45 return Pixel3(r * scalar, g * scalar, b * scalar);
48 void operator *=(
int scalar) {
54 inline float illum() {
55 return (
float) (0.2126*r + 0.7152*g + 0.0722*b);
63 class Pixel4 :
public Pixel {
72 Pixel4(
float x,
float y,
float z,
float w) {
81 inline float illum() {
82 return (
float) (0.2126*r + 0.7152*g + 0.0722*b);
85 Pixel4 operator *(
float scalar) {
86 return Pixel4(r * scalar, g * scalar, b * scalar, a);
89 void operator *=(
int scalar) {
100 inline int clamp(
float x) {
return x < 0 ? 0 : x > 1 ? 255 : int(x * 255); }
101 inline float clamp(
float x,
float min,
float max) {
return x < min ? min : (x > max) ? max : x; }
105 #endif // USE_ARNOLD_CACHING
107 #endif // Lumiverse_PIXEL_H
double clamp(double val, double min, double max)
Clamps a value between a min and a max.
Definition: LumiverseColorLib.cpp:242
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2