public class ColorLab
extends java.lang.Object
Conversion between RGB and CIE LAB color space. LAB color is designed to approximate human vision. L for lightness and a and b for the color-opponent dimensions, The reference white used in the conversions below is D65.
Note:
| Modifier and Type | Field and Description |
|---|---|
static double |
epsilon |
static float |
epsilon_f |
static double |
kappa |
static float |
kappa_f |
static double |
Xr |
static float |
Xr_f |
static double |
Yr |
static float |
Yr_f |
static double |
Zr |
static float |
Zr_f |
| Constructor and Description |
|---|
ColorLab() |
| Modifier and Type | Method and Description |
|---|---|
static void |
rgbToLab_F32(Planar<GrayF32> rgb,
Planar<GrayF32> lab)
Convert a 3-channel
Planar image from RGB into LAB. |
static void |
rgbToLab_U8(Planar<GrayU8> rgb,
Planar<GrayF32> lab)
Convert a 3-channel
Planar image from RGB into LAB. |
static void |
srgbToLab(double r,
double g,
double b,
double[] lab)
Conversion from normalized RGB into LAB.
|
static void |
srgbToLab(float r,
float g,
float b,
float[] lab)
Conversion from normalized RGB into LAB.
|
public static final double epsilon
public static final double kappa
public static final double Xr
public static final double Yr
public static final double Zr
public static final float epsilon_f
public static final float kappa_f
public static final float Xr_f
public static final float Yr_f
public static final float Zr_f
public static void srgbToLab(double r,
double g,
double b,
double[] lab)
public static void srgbToLab(float r,
float g,
float b,
float[] lab)
public static void rgbToLab_U8(Planar<GrayU8> rgb, Planar<GrayF32> lab)
Planar image from RGB into LAB. RGB is assumed
to have a range from 0:255
NOTE: Input and output image can be the same instance.rgb - (Input) RGB encoded imagelab - (Output) LAB encoded image. L = channel 0, A = channel 1, B = channel 2public static void rgbToLab_F32(Planar<GrayF32> rgb, Planar<GrayF32> lab)
Convert a 3-channel Planar image from RGB into LAB. RGB is assumed
to have a range from 0:255
rgb - (Input) RGB encoded imagelab - (Output) LAB encoded image. L = channel 0, A = channel 1, B = channel 2