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);
 
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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
    getScaledImage(BufferedImage srcImage, int destWidth, int destHeight)
    Scales an image to a different height

    Methods inherited from class com.idrsolutions.image.JDeliImage

    optimiseImage

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • QualityScaler

      public QualityScaler()
  • Method Details

    • getScaledImage

      public static BufferedImage getScaledImage(BufferedImage srcImage, int destWidth, int destHeight)
      Scales an image to a different height
      Parameters:
      srcImage - input image to scale
      destWidth - width to scale image to
      destHeight - 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 scaled
      srcWidth - width of the original image
      srcHeight - height of the original image
      dstWidth - width to scale the image to
      dstHeight - height to scale the image to
      nComp - number of color components
      Returns:
      byte[] containing the scaled image data