public class MutableImage extends AwtImage
This class cannot contain methods that result in a changed canvas size, as there is no way to mutate the size of a raster once created.
Constructor and Description |
---|
MutableImage(java.awt.image.BufferedImage awt) |
Modifier and Type | Method and Description |
---|---|
void |
contrastInPlace(double factor) |
void |
fillInPlace(java.awt.Color color)
Fills all pixels the given color on the existing image.
|
void |
mapInPlace(java.util.function.Function<Pixel,java.awt.Color> mapper)
Maps the pixels of this image into another image by applying the given function to each pixel.
|
void |
overlayInPlace(java.awt.image.BufferedImage overlay,
int x,
int y)
Applies the given image over the current buffer.
|
void |
replaceTransparencyInPlace(java.awt.Color color) |
void |
rescaleInPlace(double factor)
Mutates this image by scaling all pixel values by the given factor (brightness in other words).
|
void |
setColor(int offset,
Color color) |
void |
setColor(int x,
int y,
Color color) |
void |
setPixel(Pixel pixel) |
argb, argb, argbints, average, awt, bottomLeftPixel, bottomRightPixel, bytes, center, centreX, centreY, col, color, colors, colours, contains, count, count, count, dimensions, empty, equals, exists, fastScaleAwt, fastScaleScrimage, forAll, forEach, forWriter, getType, hasAlpha, hashCode, hasTransparency, isFilled, iterator, offset, output, output, output, patch, patches, pixel, pixel, pixels, pixels, points, radius, ratio, rgb, rgb, rotateByRadians, row, scale, stream, subpixel, toImmutableImage, toNewBufferedImage, topLeftPixel, topRightPixel, toString
public void mapInPlace(java.util.function.Function<Pixel,java.awt.Color> mapper)
The function accepts three parameters: x,y,p where x and y are the coordinates of the pixel being transformed and p is the pixel at that location.
mapper
- the function to transform pixel x,y with existing value p into new pixel value p' (p prime)public void replaceTransparencyInPlace(java.awt.Color color)
public void fillInPlace(java.awt.Color color)
public void overlayInPlace(java.awt.image.BufferedImage overlay, int x, int y)
public void setColor(int offset, Color color)
public void setColor(int x, int y, Color color)
public void setPixel(Pixel pixel)
public void rescaleInPlace(double factor)
public void contrastInPlace(double factor)