Package mgui.util
Class Colours
java.lang.Object
mgui.util.Colours
public class Colours
extends java.lang.Object
-
Field Summary
-
Constructor Summary
Constructors Constructor Description Colours() -
Method Summary
Modifier and Type Method Description static java.awt.ColorgetAwtColor(org.jogamp.vecmath.Color3f c)static java.awt.ColorgetAwtColor(org.jogamp.vecmath.Color4f c)static org.jogamp.vecmath.Color3fgetColor3f(java.awt.Color c)static org.jogamp.vecmath.Color3fgetColor3f(org.jogamp.vecmath.Color4f c)static org.jogamp.vecmath.Color4fgetColor4f(java.awt.Color c)static ColourgetColourNf(Colour c, int dims)static intgetDataSize(java.awt.image.BufferedImage image)Returns the size, in bytes, of this imagestatic bytegetR(int colour, int format)static Colour4fgetRandom()static java.awt.image.BufferedImagegetRGBtoRGBA(java.awt.image.BufferedImage rgb, boolean setAlpha, double cutoff, double exp)static java.awt.image.BufferedImagegetRGBtoRGBA(java.awt.image.BufferedImage rgb, double cutoff, double exp)static ColourgetSimplestColour(Colour c1, Colour c2)static intgetTransferType(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 Colourinterpolate(Colour c1, Colour c2, double iVal)Interpolate a colour between c1 and c2, and point iVal (0.0 to 1.0)static Colourparse(java.lang.String s)Parses a space-delimited list of numbers, and returns a colour of the appropriate sizestatic Colourparse(java.lang.String s, int n)Parses a space-delimited list of numbers, and returns a colour of size nstatic voidtoBytes(Colour c, byte[] sample)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
RGB
public static final int RGB- See Also:
- Constant Field Values
-
ARGB
public static final int ARGB- See Also:
- Constant Field Values
-
RGBA
public static final int RGBA- See Also:
- Constant Field Values
-
-
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
-
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
Parses a space-delimited list of numbers, and returns a colour of the appropriate size- Parameters:
s-- Returns:
-
parse
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
Interpolate a colour between c1 and c2, and point iVal (0.0 to 1.0)- Parameters:
c1- first colourc2- second colouriVal- point on continuum 0 to 1 to interpolate- Returns:
-
toBytes
-
getColourNf
-
getSimplestColour
-
getTypeRange
-
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
-