|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectutil.ui.GraphicTools
public class GraphicTools
Bundle of graphical utilities for common color and image alterations.
Method Summary | |
---|---|
static BufferedImage |
buffer(Image image)
Creates a buffered instance of the image. |
static BufferedImage |
copy(Image image)
Creates a deep copy of an image. |
static void |
flip(BufferedImage image,
boolean vertical)
Create a mirror image along an axis. |
static Color |
getGradient(Color first,
Color second,
double perPrim,
boolean shiftAlpha)
Returns a blend of two colors, leaning a given degree toward the first. |
static Color |
getNegative(Color color)
Provides the color with the opposite RGB values of a given color, retaining any alpha value. |
static void |
grayscale(BufferedImage image)
Removes all color from an image. |
static void |
outline(BufferedImage image,
Color target,
Color replacement,
int thickness)
Replaces all instances of a color when it borders a different color. |
static void |
outlineGradient(BufferedImage image,
Color target,
Color firstRep,
Color secondRep,
int thickness)
Replaces all instances of a color when it borders a different color. |
static void |
replaceColor(BufferedImage image,
Color target,
Color replacement)
Replaces all instances of one color with another. |
static BufferedImage |
rotateCCW(BufferedImage image)
Creates an instance of the image rotated ninety degrees counter-clockwise. |
static BufferedImage |
rotateCW(BufferedImage image)
Creates an instance of the image rotated ninety degrees clockwise. |
static Color |
setAlpha(Color color,
int alpha)
Provides a color with a given alpha transparency. |
static void |
tint(BufferedImage image,
Color shift,
double percentage,
boolean shiftAlpha)
Shifts the hue (RGB values) of the image toward a certain color. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static BufferedImage buffer(Image image)
image
- picture to be processed
public static BufferedImage copy(Image image)
image
- picture to be processed
public static Color setAlpha(Color color, int alpha)
color
- hue from which to draw the RGB valuesalpha
- transparency (alpha) value ranging 0-255
IllegalArgumentException
- if alpha value is outside valid bounds (0-255)public static Color getNegative(Color color)
color
- hue from which to determine negative
public static Color getGradient(Color first, Color second, double perPrim, boolean shiftAlpha)
first
- color to be blendedsecond
- color to be blendedperPrim
- percentage leniency toward first colorshiftAlpha
- if true alpha values are blended, otherwise the first color's alpha is used
IllegalArgumentException
- if perPrim is greater than one or less than zeropublic static void replaceColor(BufferedImage image, Color target, Color replacement)
image
- picture to be processedtarget
- color to be replacedreplacement
- replacement color to substitutepublic static void tint(BufferedImage image, Color shift, double percentage, boolean shiftAlpha)
image
- picture to be processedshift
- color to which to shift the huepercentage
- percentage to which to shift the RGB valuesshiftAlpha
- if true the alpha values are altered
IllegalArgumentException
- if percentage is greater than one or less than zeropublic static void grayscale(BufferedImage image)
image
- picture to be processedpublic static void outline(BufferedImage image, Color target, Color replacement, int thickness)
image
- picture to be processedtarget
- color to be replacedreplacement
- color of outlinethickness
- width of border by repeated iterationspublic static void outlineGradient(BufferedImage image, Color target, Color firstRep, Color secondRep, int thickness)
image
- picture to be processedtarget
- color to be replacedfirstRep
- initial color of outlinesecondRep
- ending color of outlinethickness
- width of border by repeated iterations
IllegalArgumentException
- if thickness is less than zeropublic static void flip(BufferedImage image, boolean vertical)
image
- picture to be processedvertical
- swaps top/bottom if true, left/right otherwisepublic static BufferedImage rotateCW(BufferedImage image)
image
- picture to be processed
public static BufferedImage rotateCCW(BufferedImage image)
image
- picture to be processed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |