refinery
RAW file processor
|
Converts from one color space to another. More...
#include <refinery/color.h>
Public Member Functions | |
template<typename U > | |
ColorConverter (const U(&matrix)[NTo][NFrom]) | |
Constructor. | |
template<typename U , typename V > | |
void | convert (const U(&in)[NFrom], V(&out)[NTo]) |
Convert an input vector to an output one. | |
template<typename U , typename V > | |
void | convert (const U(&in)[NFrom-1], V(&out)[NTo]) |
Convert an undersized input vector to an output one. |
Converts from one color space to another.
Example:
float conversionMatrix[3][4]; // e.g. CMYK to RGB // ... fill in conversionMatrix ... ColorConverter<float, 4, 3> converter(conversionMatrix); CMYKPixel<float>* in; RGBPixel<float>* out; for (in = firstPixel; in < lastPixel; in++, out++) { converter.convert(in->constArray(), out->array()); }
T | Type of conversion matrix (usually float or double). |
NFrom | Arity of source arrays. |
NTo | Arity of destination arrays. |
refinery::ColorConverter< T, NFrom, NTo >::ColorConverter | ( | const U(&) | matrix[NTo][NFrom] | ) | [inline] |
void refinery::ColorConverter< T, NFrom, NTo >::convert | ( | const U(&) | in[NFrom], |
V(&) | out[NTo] | ||
) | [inline] |
void refinery::ColorConverter< T, NFrom, NTo >::convert | ( | const U(&) | in[NFrom-1], |
V(&) | out[NTo] | ||
) | [inline] |
Convert an undersized input vector to an output one.
We need this special case, because we sometimes treat all cameras as having 4-color sensor arrays when they actually have 3, but at other times we optimize away the final element. Usually users won't need to directly specify this method.
U | Datatype of input vector (usually inferred). |
V | Datatype of output vector (usually inferred). |
[in] | in | Vector with NFrom input colors. |
[out] | out | Vector with NTo output colors. |