nCine  2025.04.r498-9d36345
A cross-platform 2D game engine
Public Member Functions | Static Public Attributes | List of all members
ncine::ColorHdr Class Reference

A three channels unclamped float color. More...

#include <ColorHdr.h>

Collaboration diagram for ncine::ColorHdr:
Collaboration graph
[legend]

Public Member Functions

 ColorHdr ()
 Default constructor (white color)
 
 ColorHdr (float red, float green, float blue)
 Three channels constructor.
 
 ColorHdr (const float channels[NumChannels])
 Three channels constructor from an array.
 
 ColorHdr (const Colorf &color)
 Constructor taking a float color.
 
float r () const
 Gets the red channel of the color.
 
float g () const
 Gets the green channel of the color.
 
float b () const
 Gets the blue channel of the color.
 
const float * data () const
 Gets the color array.
 
float * data ()
 Gets the color array.
 
void set (float red, float green, float blue)
 Sets three color channels.
 
void setVec (const float channels[NumChannels])
 Sets four color channels from an array.
 
void clamp ()
 Clamps negative channel values to zero.
 
ColorHdr clamped () const
 Returns a clamped version of this color.
 
ColorHdroperator= (const Colorf &color)
 Assignment operator from a float color.
 
ColorHdroperator+= (const ColorHdr &v)
 
ColorHdroperator-= (const ColorHdr &v)
 
ColorHdroperator*= (const ColorHdr &color)
 
ColorHdroperator*= (float scalar)
 Multiplication by a constant scalar.
 
ColorHdr operator+ (const ColorHdr &color) const
 
ColorHdr operator- (const ColorHdr &color) const
 
ColorHdr operator* (const ColorHdr &color) const
 
ColorHdr operator* (float scalar) const
 Multiplication by a constant scalar.
 

Static Public Attributes

static const int NumChannels = 3
 
static const ColorHdr Black
 
static const ColorHdr White
 
static const ColorHdr Red
 
static const ColorHdr Green
 
static const ColorHdr Blue
 

Detailed Description

A three channels unclamped float color.


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