Class AverageCalculationAlgorithm

java.lang.Object
com.itextpdf.pdfoptimizer.handlers.imagequality.processors.scaling.AverageCalculationAlgorithm
All Implemented Interfaces:
IScalingAlgorithm

public class AverageCalculationAlgorithm extends Object implements IScalingAlgorithm
Scaling algorithm which calculates average color of all pixels of the original image covered by the pixel of resulting image.
  • Constructor Details

    • AverageCalculationAlgorithm

      public AverageCalculationAlgorithm()
  • Method Details

    • scale

      public BitmapImagePixels scale (BitmapImagePixels original, double scaling)
      Scales a bitmap image by calculating average color of all pixels of the original image covered by the pixel of resulting image.
      Specified by:
      scale in interface IScalingAlgorithm
      Parameters:
      original - is an image to scale presented as BitmapImagePixels
      scaling - is a scaling coefficient. Should be in (0, 1] range
      Returns:
      scaled image