public class ColorXyz
extends java.lang.Object
Color conversion between CIE XYZ and RGB color models.
The XYZ color space is an international standard
developed by the CIE (Commission Internationale de l’Eclairage). This model is based on three hypothetical
primaries, XYZ, and all visible colors can be represented by using only positive values of X, Y, and Z.
The CIE XYZ primaries are hypothetical because they do not correspond to any real light wavelengths.
The Y primary is intentionally defined to match closely to luminance, while X and Z primaries give
color information. The main advantage of the CIE XYZ space (and any color space based on it) is
that this space is completely device-independent.
The above text is and equations below are copied from [1], which cites [2] as their source.
[1]
Intel IPP Color Models
[2] David Rogers. Procedural Elements for Computer Graphics. McGraw-Hill, 1985.
| Constructor and Description |
|---|
ColorXyz() |
| Modifier and Type | Method and Description |
|---|---|
static void |
rgbToXyz_F32(Planar<GrayF32> rgb,
Planar<GrayF32> xyz)
Convert a 3-channel
Planar image from RGB into XYZ. |
static void |
rgbToXyz_U8(Planar<GrayU8> rgb,
Planar<GrayF32> xyz)
Convert a 3-channel
Planar image from RGB into XYZ. |
static void |
rgbToXyz(int r,
int g,
int b,
double[] xyz)
Conversion from 8-bit RGB into XYZ.
|
static void |
rgbToXyz(int r,
int g,
int b,
float[] xyz)
Conversion from 8-bit RGB into XYZ.
|
static void |
srgbToXyz(double r,
double g,
double b,
double[] xyz)
Conversion from normalized RGB into XYZ.
|
static void |
srgbToXyz(float r,
float g,
float b,
float[] xyz)
Conversion from normalized RGB into XYZ.
|
static void |
xyzToSrgb(double x,
double y,
double z,
double[] srgb)
Conversion from normalized RGB into XYZ.
|
static void |
xyzToSrgb(float x,
float y,
float z,
float[] srgb)
Conversion from normalized RGB into XYZ.
|
public static void rgbToXyz(int r,
int g,
int b,
double[] xyz)
public static void rgbToXyz(int r,
int g,
int b,
float[] xyz)
public static void srgbToXyz(double r,
double g,
double b,
double[] xyz)
public static void srgbToXyz(float r,
float g,
float b,
float[] xyz)
public static void xyzToSrgb(float x,
float y,
float z,
float[] srgb)
public static void xyzToSrgb(double x,
double y,
double z,
double[] srgb)
public static void rgbToXyz_F32(Planar<GrayF32> rgb, Planar<GrayF32> xyz)
Planar image from RGB into XYZ. RGB is assumed
to have a range from 0:255
NOTE: Input and output image can be the same instance.rgb - (Input) RGB encoded imagexyz - (Output) XYZ encoded imagepublic static void rgbToXyz_U8(Planar<GrayU8> rgb, Planar<GrayF32> xyz)
Planar image from RGB into XYZ. RGB is assumed
to have a range from 0:255
NOTE: Input and output image can be the same instance.rgb - (Input) RGB encoded imagexyz - (Output) XYZ encoded image