|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectuk.co.silentsoftware.core.helpers.ColourHelper
public final class ColourHelper
Utility class to provide common colour functionality
| Constructor Summary | |
|---|---|
ColourHelper()
|
|
| Method Summary | |
|---|---|
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 |
private static int |
changePixelBrightness(int pixel,
float amount)
Changes brightness by increasing the pixel value by a given amount |
private static int |
changePixelContrast(int pixel,
float c)
Changes the contrast of an individual pixel by a given amount. |
private static int |
changePixelSaturation(int pixel,
float amount)
Changes the saturation of an individual pixel by the given amount (0-1 range) |
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 |
private static java.awt.image.BufferedImage |
colourAttributes(int xMax,
int yMax,
java.awt.image.BufferedImage output,
java.awt.image.BufferedImage original,
ColourChoiceStrategy colourChoiceStrategy)
Colours the Spectrum attribute blocks by selecting xMax by yMax parts of the output image (i.e. |
(package private) static float |
correctRange(float value,
int low,
int high)
Ensures a value is within a given range. |
private static int |
correctRange(int channel)
Corrects and individual colour channel value's range to 0>channel<255 |
static int |
getClosestBrightGigascreenColour(int rgb)
Retrieves the half bright Gigascreen colour most like the provided rgb colour |
static int |
getClosestBrightSpectrumColour(int rgb)
Retrieves the spectrum bright colour most like the provided rgb colour |
static int |
getClosestBrightSpectrumColour(int rgb,
int excludedRgb)
Retrieves the spectrum bright colour most like the provided rgb colour which is NOT the excluded rgb |
private static int |
getClosestColour(int rgb,
int[] colourSet)
|
private static int |
getClosestColour(int red,
int green,
int blue,
int[] colourSet)
Retrieves the from the colourSet most like the provided rgb colour |
private static int |
getClosestColourWithExclusion(int rgb,
int excludedRgb,
int[] colourSet)
Retrieves the colour from the colourSet most like the provided rgb colour |
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 int |
getClosestHalfBrightGigascreenColour(int rgb)
Retrieves the half bright Gigascreen colour most like the provided rgb colour |
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 |
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)
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ColourHelper()
| Method Detail |
|---|
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,
int excludedRgb)
rgb -
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 getClosestHalfBrightGigascreenColour(int rgb)
rgb -
public static int getClosestBrightGigascreenColour(int rgb)
rgb -
public static int getClosestGigascreenColour(int rgb)
rgb -
private static int getClosestColour(int red,
int green,
int blue,
int[] colourSet)
red - green - blue - colourSet -
private static int getClosestColour(int rgb,
int[] colourSet)
private static int getClosestColourWithExclusion(int rgb,
int excludedRgb,
int[] colourSet)
rgb - colourSet -
public static java.awt.image.BufferedImage colourAttributes(java.awt.image.BufferedImage output,
java.awt.image.BufferedImage original,
ColourChoiceStrategy colourChoiceStrategy)
output - original - colourChoiceStrategy -
private static java.awt.image.BufferedImage colourAttributes(int xMax,
int yMax,
java.awt.image.BufferedImage output,
java.awt.image.BufferedImage original,
ColourChoiceStrategy colourChoiceStrategy)
xMax - yMax - output - colourChoiceStrategy -
public static boolean isBrightSet(int argb)
argb -
public static java.awt.image.BufferedImage changeContrast(java.awt.image.BufferedImage img,
float amount)
img - amount -
private static int changePixelContrast(int pixel,
float c)
pixel - c -
public static java.awt.image.BufferedImage changeBrightness(java.awt.image.BufferedImage img,
float amount)
img - amount -
private static int changePixelBrightness(int pixel,
float amount)
pixel - amount -
public static java.awt.image.BufferedImage changeSaturation(java.awt.image.BufferedImage img,
float amount)
img - amount -
private static int changePixelSaturation(int pixel,
float amount)
pixel - amount -
static float correctRange(float value,
int low,
int high)
value - low - high -
public static int[] intToRgbComponents(int rgb)
public static int intToAlphaRgb(int[] rgb)
rgb -
public static int intToAlphaRgb(int red,
int green,
int blue)
red - green - blue -
private static int correctRange(int channel)
channel -
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 -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||