public final class ImageSupport extends Object
Color
instances and applies effects to WritableImage
s.Modifier and Type | Method and Description |
---|---|
static void |
copy(WritableImage sourceImage,
WritableImage targetImage,
int sx,
int sy,
int dx,
int dy,
int width,
int height)
Copys pixels from an image to another image.
|
static Color |
fromHSB(double hue,
double saturation,
double brightness,
double alpha)
Create a color from HSB values.
|
static float[] |
gaussian1D(double theta,
int size) |
static int[] |
gaussian1DScaled(double theta,
int size) |
static void |
gaussianBlur(WritableImage bitmap,
double theta,
int size) |
static void |
gaussianBlur(WritableImage bitmap,
int[] intkernel) |
static WritableImage |
getCroppedImage(WritableImage sourceImage,
int x,
int y,
int width,
int height)
Returns an image that is the cropped version of the given image with the coordinates of the pixels from (x,y)
to (x+width, y+height).
|
static Color |
mix(Color color0,
Color color1,
double ratio)
Mixes two colors using the provided ratio.
|
static double[] |
toHSB(Color color)
Converts an RGB color value to HSB values.
|
public static void copy(WritableImage sourceImage, WritableImage targetImage, int sx, int sy, int dx, int dy, int width, int height)
sourceImage
- the image to copy the pixels from.targetImage
- the image to copy the pixels to.sx
- the x-coordinate of the first pixel in the sourceImage to copy.sy
- the y-coordinate of the first pixel in the sourceImage to copy.dx
- the x-coordinate of the first pixel in the targetImage to copy.dy
- the y-coordinate of the first pixel in the targetImage to copy.width
- the number of pixels to copy for each row.height
- the number of rows to copy.public static final Color fromHSB(double hue, double saturation, double brightness, double alpha)
public static final float[] gaussian1D(double theta, int size)
public static final int[] gaussian1DScaled(double theta, int size)
public static final void gaussianBlur(WritableImage bitmap, double theta, int size)
public static final void gaussianBlur(WritableImage bitmap, int[] intkernel)
public static final WritableImage getCroppedImage(WritableImage sourceImage, int x, int y, int width, int height)
sourceImage
- the source image.x
- the x-coordinate of the first pixel in the source image to crop (pixels to the left are cropped).y
- the y-coordinate of the first pixel in the source image to crop (pixels above are cropped).width
- the width of the cropped image, starting at x
(pixels to the right of x+width
are cropped).height
- the height of the cropped image, starting at y
(pixels below y+height
are cropped).WritableImage
that is width
wide and height
tall,
and contains the pixels of the source image in the area that is defined by x
, y
,
width
and height
.public static final Color mix(Color color0, Color color1, double ratio)
public static final double[] toHSB(Color color)
color
- The color.