类 ColourUtil

java.lang.Object
com.tlcsdm.core.util.ColourUtil

public class ColourUtil extends Object
Conversion tool for RGB, color temperature and coordinates.
作者:
unknowIfGuestInDream
  • 字段详细资料

  • 构造器详细资料

    • ColourUtil

      private ColourUtil()
  • 方法详细资料

    • linerRgb2Xyz

      public static double[] linerRgb2Xyz(int red, int green, int blue)
      Translate liner-RGB to XYZ.
      参数:
      red - R [0, 255]
      green - G [0, 255]
      blue - B [0, 255]
      返回:
      XYZ [0, 1]
    • linerRgb2Coor

      public static double[] linerRgb2Coor(int red, int green, int blue)
      Translate liner-RGB to XY-coordinate.
      参数:
      red - R [0, 255]
      green - G [0, 255]
      blue - B [0, 255]
      返回:
      XY-coordinate [0, 1]
    • linerRgb2Tc

      public static double linerRgb2Tc(int red, int green, int blue)
      Translate liner-RGB to Tc.
      参数:
      red - R [0, 255]
      green - G [0, 255]
      blue - B [0, 255]
      返回:
      Tc (K) [1000, 40000]
    • calculateForLinerRgbFromCoor

      public static double[] calculateForLinerRgbFromCoor(double coorX, double coorY)
      Calculate liner-sRGB from xy-coordinate.
      参数:
      coorX - X [0, 1]
      coorY - Y [0, 1]
      返回:
      liner-RGB [0, 1]
    • linerRgb2sRgb

      public static float[] linerRgb2sRgb(double[] liner)
      Translate liner-sRGB to sRGB.
      参数:
      liner - liner-sRGB [0, 1]
      返回:
      sRGB [0, 1]
    • coor2LinerRgb

      public static int[] coor2LinerRgb(double coorX, double coorY)
      Translate XY to liner-RGB.
      参数:
      coorX - X [0, 1]
      coorY - Y [0, 1]
      返回:
      liner-RGB [0, 255]
    • coor2sRgb

      public static float[] coor2sRgb(double coorX, double coorY)
      Translate XY to sRGB.
      参数:
      coorX - X [0, 1]
      coorY - Y [0, 1]
      返回:
      sRGB [0, 1]
    • coor2Tc

      public static double coor2Tc(double coorX, double coorY)
      Translate XY to Tc.
      参数:
      coorX - X [0, 1]
      coorY - Y [0, 1]
      返回:
      Tc (K) [1000, 40000]
    • tc2LinerRgb

      public static int[] tc2LinerRgb(double tc)
      Translate Tc to liner-RGB.
      参数:
      tc - (K) [1000, 40000]
      返回:
      liner-RGB [0, 255]
    • tc2sRgb

      public static float[] tc2sRgb(double tc)
      Translate Tc to sRGB.
      参数:
      tc - (K) [1000, 40000]
      返回:
      sRGB [0, 1]
    • tcK2Mirek

      public static double tcK2Mirek(double tc)
      Translate tc K to Mirek.
      参数:
      tc - (K)
      返回:
      (Mirek)
    • tc2Coor

      public static double[] tc2Coor(double tc)
      Translate Tc to XY.
      参数:
      tc - (K) [1000, 40000]
      返回:
      XY-coordinate [0, 1]
    • getTcXyList

      private static List<ColourUtil.TcXyData> getTcXyList()
    • initializeTcXyData

      private static void initializeTcXyData()