public final class ColourHelper
extends java.lang.Object
| Constructor and Description |
|---|
ColourHelper() |
| Modifier and Type | Method and Description |
|---|---|
static int |
calculateMostPopularColourWithExclusion(java.lang.Integer excludedColour,
java.util.Map<java.lang.Integer,java.lang.Integer> colourCountTally) |
static java.awt.image.BufferedImage |
changeBrightness(java.awt.image.BufferedImage img,
float amount)
Changes brightness by increasing all pixel values by a given amount
|
static java.awt.image.BufferedImage |
changeContrast(java.awt.image.BufferedImage img,
float amount)
Changes the contrast of an image
|
static java.awt.image.BufferedImage |
changeSaturation(java.awt.image.BufferedImage img,
float amount)
Changes image saturation by a given amount (0-1 range)
|
static java.awt.image.BufferedImage |
colourAttributes(java.awt.image.BufferedImage output,
java.awt.image.BufferedImage original,
ColourChoiceStrategy colourChoiceStrategy)
Colours an entire image using the given colourstrategy based on the
original and output images.
|
static java.awt.image.BufferedImage |
colourMonochromeAttributes(java.awt.image.BufferedImage output,
java.awt.image.BufferedImage original) |
(package private) static float |
correctRange(float value,
int low,
int high)
Ensures a value is within a given range.
|
static int[] |
getBlackAndWhiteFromMonochrome(int[] original)
Returns an array of black and white colours representing the ink (black)
and paper (white) monochrome colours.
|
static int |
getClosestBrightSpectrumColour(int rgb)
Retrieves the spectrum bright colour most like the provided rgb colour
|
static int |
getClosestColour(int rgb,
int[] colourSet) |
static int |
getClosestColour(int red,
int green,
int blue,
int[] colourSet,
boolean preferDetail)
Retrieves the from the colourSet most like the provided rgb colour
|
static int |
getClosestColourDistance(int red,
int green,
int blue,
int[] colourSet) |
static int |
getClosestGigascreenColour(int rgb)
Retrieves the Gigascreen colour most like the provided rgb colour
|
static int |
getClosestGigascreenColour(int red,
int green,
int blue)
Retrieves the Gigascreen colour most like the provided rgb colour
|
static GigaScreenAtrribute.GigaScreenColourCombo |
getClosestGigaScreenCombo(int rgb,
GigaScreenAtrribute colourSet) |
static int |
getClosestHalfBrightSpectrumColour(int rgb)
Retrieves the spectrum half bright colour most like the provided rgb
colour
|
static int |
getClosestHalfBrightSpectrumColour(int rgb,
int excludedRgb)
Retrieves the spectrum half bright colour most like the provided rgb
colour which is NOT the excluded rgb
|
static int |
getClosestReducedHalfBrightSpectrumColour(int rgb)
Retrieves the reduced set spectrum half bright colour most like the
provided rgb colour
|
static int |
getClosestReducedHalfBrightSpectrumColour(int rgb,
int excludedRgb)
Retrieves the reduced set spectrum half bright colour most like the
provided rgb colour which is NOT the excluded rgb
|
static int |
getClosestSpectrumColour(int rgb)
Retrieves the spectrum colour most like the provided rgb colour
|
static int |
getClosestSpectrumColour(int red,
int green,
int blue)
Retrieves the spectrum colour most like the provided rgb colour
|
static int |
getMonochromeColour(int rgb,
int ink,
int paper)
Based on the darkness of the pixel colour determines whether a pixel is
ink or paper and returns that colour.
|
static int |
getMonochromeColour(int red,
int green,
int blue,
int ink,
int paper)
Based on the darkness of the pixel colour determines whether a pixel is
ink or paper and returns that colour.
|
static int |
getMonochromeFromBlackAndWhite(int original) |
static int[] |
getMonochromeFromBlackAndWhite(int[] original)
Returns an array of monochrome (chosen ink and paper) colours based on an
input array of black (ink) and white (paper).
|
static int |
intToAlphaRgb(int[] rgb)
Convert individual RGB components into a 32 bit ARGB value
|
static int |
intToAlphaRgb(int red,
int green,
int blue)
Convert individual RGB components into a 32 bit ARGB value
|
static int[] |
intToRgbComponents(int rgb)
Convert rgb to its components
|
static boolean |
isBlack(int red,
int green,
int blue)
Determines whether a pixel is closer to black (than white)
|
static boolean |
isBrightSet(int argb)
Determines whether the colour is from the Spectrum's bright or half
bright colour set.
|
public static int getClosestSpectrumColour(int rgb)
rgb - public static int getClosestSpectrumColour(int red,
int green,
int blue)
red - green - blue - public static int getClosestBrightSpectrumColour(int rgb)
rgb - public static int getClosestHalfBrightSpectrumColour(int rgb,
int excludedRgb)
rgb - public static int getClosestHalfBrightSpectrumColour(int rgb)
rgb - public static int getClosestReducedHalfBrightSpectrumColour(int rgb,
int excludedRgb)
rgb - public static int getClosestReducedHalfBrightSpectrumColour(int rgb)
rgb - public static int getClosestGigascreenColour(int red,
int green,
int blue)
red - green - blue - public static int getClosestGigascreenColour(int rgb)
rgb - public static int getClosestColour(int red,
int green,
int blue,
int[] colourSet,
boolean preferDetail)
red - green - blue - colourSet - public static GigaScreenAtrribute.GigaScreenColourCombo getClosestGigaScreenCombo(int rgb, GigaScreenAtrribute colourSet)
public static int getClosestColour(int rgb,
int[] colourSet)
public static int getClosestColourDistance(int red,
int green,
int blue,
int[] colourSet)
public static java.awt.image.BufferedImage colourMonochromeAttributes(java.awt.image.BufferedImage output,
java.awt.image.BufferedImage original)
public static java.awt.image.BufferedImage colourAttributes(java.awt.image.BufferedImage output,
java.awt.image.BufferedImage original,
ColourChoiceStrategy colourChoiceStrategy)
output - colourChoiceStrategy - public static int calculateMostPopularColourWithExclusion(java.lang.Integer excludedColour,
java.util.Map<java.lang.Integer,java.lang.Integer> colourCountTally)
public static boolean isBrightSet(int argb)
argb - public static java.awt.image.BufferedImage changeContrast(java.awt.image.BufferedImage img,
float amount)
img - amount - public static java.awt.image.BufferedImage changeBrightness(java.awt.image.BufferedImage img,
float amount)
img - amount - public static java.awt.image.BufferedImage changeSaturation(java.awt.image.BufferedImage img,
float amount)
img - amount - static float correctRange(float value,
int low,
int high)
value - low - high - public static int[] intToRgbComponents(int rgb)
rgb - public static int intToAlphaRgb(int[] rgb)
rgb - public static int intToAlphaRgb(int red,
int green,
int blue)
red - green - blue - public static boolean isBlack(int red,
int green,
int blue)
red - green - blue - public static int getMonochromeColour(int rgb,
int ink,
int paper)
rgb - ink - paper - public static int getMonochromeColour(int red,
int green,
int blue,
int ink,
int paper)
red - green - blue - ink - paper - public static int[] getBlackAndWhiteFromMonochrome(int[] original)
original - public static int[] getMonochromeFromBlackAndWhite(int[] original)
original - public static int getMonochromeFromBlackAndWhite(int original)