Package mgui.util

Class Colours

java.lang.Object
mgui.util.Colours

public class Colours
extends java.lang.Object
  • Field Summary

    Fields
    Modifier and Type Field Description
    static int ARGB  
    static int RGB  
    static int RGBA  
  • Constructor Summary

    Constructors
    Constructor Description
    Colours()  
  • Method Summary

    Modifier and Type Method Description
    static java.awt.Color getAwtColor​(org.jogamp.vecmath.Color3f c)  
    static java.awt.Color getAwtColor​(org.jogamp.vecmath.Color4f c)  
    static org.jogamp.vecmath.Color3f getColor3f​(java.awt.Color c)  
    static org.jogamp.vecmath.Color3f getColor3f​(org.jogamp.vecmath.Color4f c)  
    static org.jogamp.vecmath.Color4f getColor4f​(java.awt.Color c)  
    static Colour getColourNf​(Colour c, int dims)  
    static int getDataSize​(java.awt.image.BufferedImage image)
    Returns the size, in bytes, of this image
    static byte getR​(int colour, int format)  
    static Colour4f getRandom()  
    static java.awt.image.BufferedImage getRGBtoRGBA​(java.awt.image.BufferedImage rgb, boolean setAlpha, double cutoff, double exp)  
    static java.awt.image.BufferedImage getRGBtoRGBA​(java.awt.image.BufferedImage rgb, double cutoff, double exp)  
    static Colour getSimplestColour​(Colour c1, Colour c2)  
    static int getTransferType​(DataType type)  
    static double[] getTypeRange​(int transferType)  
    static double[] getTypeRange​(int transferType, java.awt.color.ColorSpace space)  
    static double[] getTypeRange​(java.awt.image.ColorModel model)  
    static double[] getTypeRange​(DataType type)  
    static Colour interpolate​(Colour c1, Colour c2, double iVal)
    Interpolate a colour between c1 and c2, and point iVal (0.0 to 1.0)
    static Colour parse​(java.lang.String s)
    Parses a space-delimited list of numbers, and returns a colour of the appropriate size
    static Colour parse​(java.lang.String s, int n)
    Parses a space-delimited list of numbers, and returns a colour of size n
    static void toBytes​(Colour c, byte[] sample)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Colours

      public Colours()
  • Method Details

    • getR

      public static byte getR​(int colour, int format)
    • getAwtColor

      public static java.awt.Color getAwtColor​(org.jogamp.vecmath.Color3f c)
    • getAwtColor

      public static java.awt.Color getAwtColor​(org.jogamp.vecmath.Color4f c)
    • getColor3f

      public static org.jogamp.vecmath.Color3f getColor3f​(java.awt.Color c)
    • getColor3f

      public static org.jogamp.vecmath.Color3f getColor3f​(org.jogamp.vecmath.Color4f c)
    • getColor4f

      public static org.jogamp.vecmath.Color4f getColor4f​(java.awt.Color c)
    • getRandom

      public static Colour4f getRandom()
    • getRGBtoRGBA

      public static java.awt.image.BufferedImage getRGBtoRGBA​(java.awt.image.BufferedImage rgb, double cutoff, double exp)
    • getRGBtoRGBA

      public static java.awt.image.BufferedImage getRGBtoRGBA​(java.awt.image.BufferedImage rgb, boolean setAlpha, double cutoff, double exp)
    • parse

      public static Colour parse​(java.lang.String s)
      Parses a space-delimited list of numbers, and returns a colour of the appropriate size
      Parameters:
      s -
      Returns:
    • parse

      public static Colour parse​(java.lang.String s, int n)
      Parses a space-delimited list of numbers, and returns a colour of size n
      Parameters:
      s -
      Returns:
    • getDataSize

      public static int getDataSize​(java.awt.image.BufferedImage image)
      Returns the size, in bytes, of this image
      Parameters:
      image -
      Returns:
      int Size in bytes of this image
    • interpolate

      public static Colour interpolate​(Colour c1, Colour c2, double iVal)
      Interpolate a colour between c1 and c2, and point iVal (0.0 to 1.0)
      Parameters:
      c1 - first colour
      c2 - second colour
      iVal - point on continuum 0 to 1 to interpolate
      Returns:
    • toBytes

      public static void toBytes​(Colour c, byte[] sample)
    • getColourNf

      public static Colour getColourNf​(Colour c, int dims)
    • getSimplestColour

      public static Colour getSimplestColour​(Colour c1, Colour c2)
    • getTypeRange

      public static double[] getTypeRange​(DataType type)
    • getTypeRange

      public static double[] getTypeRange​(java.awt.image.ColorModel model)
    • getTypeRange

      public static double[] getTypeRange​(int transferType)
    • getTypeRange

      public static double[] getTypeRange​(int transferType, java.awt.color.ColorSpace space)
    • getTransferType

      public static int getTransferType​(DataType type)