Groovy Documentation

src.groovy.pl.burningice.plugins.image.engines.scale
Class ImageMagickAccurateScaleEngine

java.lang.Object
  src.groovy.pl.burningice.plugins.image.engines.scale.ImageMagickScaleEngine
      src.groovy.pl.burningice.plugins.image.engines.scale.ImageMagickApproximateScaleEngine
          src.groovy.pl.burningice.plugins.image.engines.scale.ImageMagickAccurateScaleEngine

class ImageMagickAccurateScaleEngine
extends ImageMagickApproximateScaleEngine

Class allows to scale image with accurate width and height. Result image will contain exact width and height gave by user, if original size of image not fit to user width and height, image will be scaled to shortest side and cropped on center

author:
Pawel Gdula


Property Summary
private static int SIZE_CORRECTION

Specify image size correction for scaling Sometimes during scaling there are situations when one of the sides don't match requested size (is lover by one px) Can be fixed by adding this 1px to image size before scale calculations.

 
Constructor Summary
ImageMagickAccurateScaleEngine()

 
Method Summary
protected def evaluateScale(Dimension currentSize, Dimension requestedSize)

protected byte[] scaleImage(byte[] image, Dimension currentSize, Dimension requestedSize)

 
Methods inherited from class ImageMagickApproximateScaleEngine
evaluateScale, scaleImage
 
Methods inherited from class ImageMagickScaleEngine
bytesToBufferedImage, execute, scaleImage
 

Property Detail

SIZE_CORRECTION

private static final int SIZE_CORRECTION
Specify image size correction for scaling Sometimes during scaling there are situations when one of the sides don't match requested size (is lover by one px) Can be fixed by adding this 1px to image size before scale calculations. This is not important during approximate scaling, but required during accurate scaling to match exactly requested image size.


 
Constructor Detail

ImageMagickAccurateScaleEngine

ImageMagickAccurateScaleEngine()


 
Method Detail

evaluateScale

protected def evaluateScale(Dimension currentSize, Dimension requestedSize)


scaleImage

protected byte[] scaleImage(byte[] image, Dimension currentSize, Dimension requestedSize)


 

Groovy Documentation