#include <Pt/Gfx/Color.h>
Floating-point RGBA color. More...
Static Public Member Functions | |
| static float | toChannelF (Pt::uint8_t c) |
| Converts an 8-bit channel to the unit interval. | |
| static Pt::uint8_t | toChannel8 (float c) |
| Converts a unit-interval channel to 8-bit. | |
ColorF is a working color with four float channels in RGBA memory order. It is not a pixel buffer. Channels use the range [0, 1]; values greater than 1 are allowed for HDR. Alpha is straight, not premultiplied. ImageF uses this type as its working color through the same runtime ImageFormat as Image.
Convert to and from Color with the converting constructors. toChannel8() clamps values below 0 to 0 and values of 1 or greater to 255.
|
static |
Values below 0 become 0. Values of 1 or greater become 255.