|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfeature_extraction.ImageScaling
public class ImageScaling
This class performs image scaling
Field Summary | |
---|---|
private boolean |
higherQuality
If true, this class will use a multi-step scaling technique that provides higher quality than the usual one-step technique (only useful in downscaling cases and generally only when the BILINEAR hint
is specified) |
private java.lang.Object |
hint
One of the rendering hints that corresponds to RenderingHints.KEY_INTERPOLATION (e.g. |
private int |
targetSize
Depending on the method that will be called for scaling the image, the targetSize corresponds to: a. |
Constructor Summary | |
---|---|
ImageScaling()
Constructor with no arguments, all fields take the default values |
|
ImageScaling(int targetSize)
|
|
ImageScaling(int targetSize,
boolean highQuality,
java.lang.Object hint)
|
|
ImageScaling(java.lang.String scalingTypeParameter,
java.lang.String scalingSizeParameter)
|
Method Summary | |
---|---|
static void |
advancedUse()
|
static void |
main(java.lang.String[] args)
|
java.awt.image.BufferedImage |
maxPixelsScaling(java.awt.image.BufferedImage img)
This method returns a scaled instance of the provided BufferedImage . |
java.awt.image.BufferedImage |
rectScaling(java.awt.image.BufferedImage img)
This method returns a scaled instance of the provided BufferedImage . |
java.awt.image.BufferedImage |
rectScaling(java.lang.String imageFilename)
Same as rectScaling(BufferedImage) but takes the imageFileName instead of a BufferedImage . |
java.awt.image.BufferedImage |
squareScaling(java.awt.image.BufferedImage img)
This method returns a scaled instance of the provided BufferedImage . |
java.awt.image.BufferedImage |
squareScaling(java.lang.String imageFilename)
Same as squareScaling(BufferedImage) but takes the imageFileName instead of a BufferedImage . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private int targetSize
a. The total number of pixels. b. The dimension of a square thumbnail in pixels. c. The larger dimension of a rectangular thumbnail in pixels.
private boolean higherQuality
BILINEAR
hint
is specified)
private java.lang.Object hint
RenderingHints.KEY_INTERPOLATION
(e.g. RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
, RenderingHints.VALUE_INTERPOLATION_BILINEAR
, RenderingHints.VALUE_INTERPOLATION_BICUBIC
)
Constructor Detail |
---|
public ImageScaling()
public ImageScaling(int targetSize)
public ImageScaling(int targetSize, boolean highQuality, java.lang.Object hint)
public ImageScaling(java.lang.String scalingTypeParameter, java.lang.String scalingSizeParameter)
Method Detail |
---|
public java.awt.image.BufferedImage maxPixelsScaling(java.awt.image.BufferedImage img)
BufferedImage
. The image is scaled to a
maximum of targetSize
pixels in total by keeping the aspect ratio.
img
- the original image to be scaled
BufferedImage
or the original image if no scaling was
appliedpublic java.awt.image.BufferedImage squareScaling(java.awt.image.BufferedImage img)
BufferedImage
. The image is scaled so
that its minimum dimension becomes targetSize
pixels and then the larger dimension is cropped,
again to targetSize
pixels to create a square thumbnail.
img
- the original image to be scaled
BufferedImage
or the original image if no scaling was
appliedpublic java.awt.image.BufferedImage squareScaling(java.lang.String imageFilename) throws java.io.IOException
squareScaling(BufferedImage)
but takes the imageFileName instead of a BufferedImage
.
imageFilename
-
java.io.IOException
public java.awt.image.BufferedImage rectScaling(java.awt.image.BufferedImage img)
BufferedImage
. The image is scaled so
that its maximum dimension becomes targetSize
pixels.
img
- the original image to be scaled
BufferedImage
or the original image if no scaling was
appliedpublic java.awt.image.BufferedImage rectScaling(java.lang.String imageFilename) throws java.io.IOException
rectScaling(BufferedImage)
but takes the imageFileName instead of a BufferedImage
.
imageFilename
-
java.io.IOException
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException
public static void advancedUse() throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |