Class BradfordAdaptation

java.lang.Object
imagingbook.common.color.adapt.BradfordAdaptation
All Implemented Interfaces:
ChromaticAdaptation

public class BradfordAdaptation extends Object implements ChromaticAdaptation

This class represents a linear chromatic adaptation transform, mapping XYZ color coordinates from a source white (reference) point to a target white point. Both white points are passed to the constructor. The actual color mapping is done by method applyTo(float[]). The underlying linear transformation is specified by a 3x3 matrix, which may be retrieved by getAdaptationMatrix()). See Sec. 14.6 of [1] for additional details and examples.

[1] W. Burger, M.J. Burge, Digital Image Processing – An Algorithmic Introduction, 3rd ed, Springer (2022).

Version:
2022/11/14
See Also:
  • Method Details

    • getInstance

      public static BradfordAdaptation getInstance(double[] W1, double[] W2)
      Returns a BradfordAdaptation instance for the specified white point coordinates.
      Parameters:
      W1 - source white point (to map from)
      W2 - target white point (to map to)
      Returns:
      a BradfordAdaptation instance
    • getInstance

      public static BradfordAdaptation getInstance(Illuminant illum1, Illuminant illum2)
      Returns a BradfordAdaptation instance for the specified illuminants (white points).
      Parameters:
      illum1 - source illuminant (white point to map from)
      illum2 - target illuminant (white point to map to)
      Returns:
      a BradfordAdaptation instance
    • getMCAT

      public static double[][] getMCAT()
    • getMCATi

      public static double[][] getMCATi()
    • applyTo

      public float[] applyTo(float[] XYZA)
      Description copied from interface: ChromaticAdaptation
      Transforms the specified XYZ source color coordinates to target coordinates. The specified color coordinates are interpreted relative to (source) white point (W1). Returns a new color adapted to (target) white point W2.
      Specified by:
      applyTo in interface ChromaticAdaptation
      Parameters:
      XYZA - the original color point w.r.t. the source white point (W1)
      Returns:
      the adapted color w.r.t. the target white point (W2).
    • applyTo

      public double[] applyTo(double[] XYZA)
      Description copied from interface: ChromaticAdaptation
      Specified by:
      applyTo in interface ChromaticAdaptation
      Parameters:
      XYZA - the original color point w.r.t. the source white point (W1)
      Returns:
      the adapted color w.r.t. the target white point (W2).
    • getAdaptationMatrix

      public double[][] getAdaptationMatrix()
      Returns the composite color adaptation transformation matrix.
      Returns:
      the color adaptation transformation matrix
    • main

      public static void main(String[] args)