|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.coobird.thumbnailator.filters.Canvas
public class Canvas
An ImageFilter
which will enclose an image into a specified
enclosing image.
The intended use of this ImageFilter
is to take an image and place
it inside of a larger image, creating a border around the original image.
This can be useful when the dimensions of a thumbnail must always be the
same dimensions, and the original images are of differing dimensions.
The fill color used for the enclosing image can be specified, along with whether or not to crop an image if it is larger than the enclosing image.
Constructor Summary | |
---|---|
Canvas(int width,
int height,
Position position)
Instantiates a Canvas filter. |
|
Canvas(int width,
int height,
Position position,
boolean crop)
Instantiates a Canvas filter. |
|
Canvas(int width,
int height,
Position position,
boolean crop,
Color fillColor)
Instantiates a Canvas filter. |
|
Canvas(int width,
int height,
Position position,
Color fillColor)
Instantiates a Canvas filter. |
Method Summary | |
---|---|
BufferedImage |
apply(BufferedImage img)
Applies a image filtering operation on an image. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Canvas(int width, int height, Position position)
Canvas
filter.
No fill color will be applied to the filtered image. If the image to filter does not have a transparency channel, the image will be filled black.
Crops the enclosed image if the enclosing image is smaller.
width
- The width of the filtered image.height
- The height of the filtered image.position
- The position to place the enclosed image.public Canvas(int width, int height, Position position, boolean crop)
Canvas
filter.
No fill color will be applied to the filtered image. If the image to filter does not have a transparency channel, the image will be filled black.
width
- The width of the filtered image.height
- The height of the filtered image.position
- The position to place the enclosed image.crop
- Whether or not to crop the enclosed image if the
enclosed image has dimensions which are larger than
the specified width
and height
.public Canvas(int width, int height, Position position, Color fillColor)
Canvas
filter.
Crops the enclosed image if the enclosing image is smaller.
width
- The width of the filtered image.height
- The height of the filtered image.position
- The position to place the enclosed image.fillColor
- The color to fill portions of the image which is
not covered by the enclosed image. Portions of the
image which is transparent will be filled with
the specified color as well.public Canvas(int width, int height, Position position, boolean crop, Color fillColor)
Canvas
filter.
width
- The width of the filtered image.height
- The height of the filtered image.position
- The position to place the enclosed image.crop
- Whether or not to crop the enclosed image if the
enclosed image has dimensions which are larger than
the specified width
and height
.fillColor
- The color to fill portions of the image which is
not covered by the enclosed image. Portions of the
image which is transparent will be filled with
the specified color as well.Method Detail |
---|
public BufferedImage apply(BufferedImage img)
ImageFilter
apply
in interface ImageFilter
img
- The image to apply the filtering on.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |