Class ColorXyz
- java.lang.Object
-
- boofcv.alg.color.ColorXyz
-
public class ColorXyz extends java.lang.ObjectColor 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 Summary
Constructors Constructor and Description ColorXyz()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidrgbToXyz_F32(Planar<GrayF32> rgb, Planar<GrayF32> xyz)Convert a 3-channelPlanarimage from RGB into XYZ.static voidrgbToXyz_U8(Planar<GrayU8> rgb, Planar<GrayF32> xyz)Convert a 3-channelPlanarimage from RGB into XYZ.static voidrgbToXyz(int r, int g, int b, double[] xyz)Conversion from 8-bit RGB into XYZ.static voidrgbToXyz(int r, int g, int b, float[] xyz)Conversion from 8-bit RGB into XYZ.static voidsrgbToXyz(double r, double g, double b, double[] xyz)Conversion from normalized RGB into XYZ.static voidsrgbToXyz(float r, float g, float b, float[] xyz)Conversion from normalized RGB into XYZ.static voidxyzToSrgb(double x, double y, double z, double[] srgb)Conversion from normalized RGB into XYZ.static voidxyzToSrgb(float x, float y, float z, float[] srgb)Conversion from normalized RGB into XYZ.
-
-
-
Method Detail
-
rgbToXyz
public static void rgbToXyz(int r, int g, int b, double[] xyz)Conversion from 8-bit RGB into XYZ.
-
rgbToXyz
public static void rgbToXyz(int r, int g, int b, float[] xyz)Conversion from 8-bit RGB into XYZ.
-
srgbToXyz
public static void srgbToXyz(double r, double g, double b, double[] xyz)Conversion from normalized RGB into XYZ. Normalized RGB values have a range of 0:1
-
srgbToXyz
public static void srgbToXyz(float r, float g, float b, float[] xyz)Conversion from normalized RGB into XYZ. Normalized RGB values have a range of 0:1
-
xyzToSrgb
public static void xyzToSrgb(float x, float y, float z, float[] srgb)Conversion from normalized RGB into XYZ. Normalized RGB values have a range of 0:1
-
xyzToSrgb
public static void xyzToSrgb(double x, double y, double z, double[] srgb)Conversion from normalized RGB into XYZ. Normalized RGB values have a range of 0:1
-
rgbToXyz_F32
public static void rgbToXyz_F32(Planar<GrayF32> rgb, Planar<GrayF32> xyz)
Convert a 3-channelPlanarimage from RGB into XYZ. RGB is assumed to have a range from 0:255 NOTE: Input and output image can be the same instance.- Parameters:
rgb- (Input) RGB encoded imagexyz- (Output) XYZ encoded image
-
rgbToXyz_U8
public static void rgbToXyz_U8(Planar<GrayU8> rgb, Planar<GrayF32> xyz)
Convert a 3-channelPlanarimage from RGB into XYZ. RGB is assumed to have a range from 0:255 NOTE: Input and output image can be the same instance.- Parameters:
rgb- (Input) RGB encoded imagexyz- (Output) XYZ encoded image
-
-
DataMelt 3.0 © DataMelt by jWork.ORG