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.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 imagestatic 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 sizestatic Colour
parse(java.lang.String s, int n)
Parses a space-delimited list of numbers, and returns a colour of size nstatic 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
-
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
-