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 Detail

      • QualityScaler

        public QualityScaler()
    • Method Detail

      • 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 -
        Returns:
        byte[] containing the scaled image data