Class 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
      QualityScaler()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      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
      static java.awt.image.BufferedImage getScaledImage​(java.awt.image.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 Detail

      • QualityScaler

        public QualityScaler()
    • Method Detail

      • getScaledImage

        public static java.awt.image.BufferedImage getScaledImage​(java.awt.image.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 -
        Returns:
        byte[] containing the scaled image data