Package com.idrsolutions.image.scale
Class QualityScaler
java.lang.Object
com.idrsolutions.image.JDeliImage
com.idrsolutions.image.scale.QualityScaler
public class QualityScaler
extends com.idrsolutions.image.JDeliImage
Class uses mixed sinc filters to generate good quality scaling Example :
BufferedImage thumbnailImage = QualityScaler.getScaledImage(sourceImage,128,128);
-
Field Summary
Fields inherited from class com.idrsolutions.image.JDeliImage
bb
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
getScaledBytes
(byte[] src, int srcWidth, int srcHeight, int dstWidth, int dstHeight, int nComp) Creates a scaled image in a byte[] from an input byte[] containing the input image datastatic BufferedImage
getScaledImage
(BufferedImage srcImage, int destWidth, int destHeight) Scales an image to a different heightMethods inherited from class com.idrsolutions.image.JDeliImage
optimiseImage
-
Constructor Details
-
QualityScaler
public QualityScaler()
-
-
Method Details
-
getScaledImage
Scales an image to a different height- Parameters:
srcImage
- input image to scaledestWidth
- width to scale image todestHeight
- height to scale image to- Returns:
- BufferedImage of the newly scaled image
-
getScaledBytes
public static byte[] getScaledBytes(byte[] src, int srcWidth, int srcHeight, int dstWidth, int dstHeight, int nComp) Creates a scaled image in a byte[] from an input byte[] containing the input image data- Parameters:
src
- byte[] containing the original image data to be scaledsrcWidth
- width of the original imagesrcHeight
- height of the original imagedstWidth
- width to scale the image todstHeight
- height to scale the image tonComp
- number of color components- Returns:
- byte[] containing the scaled image data
-