Class AverageCalculationAlgorithm
java.lang.Object
com.itextpdf.pdfoptimizer.handlers.imagequality.processors.scaling.AverageCalculationAlgorithm
- All Implemented Interfaces:
-
IScalingAlgorithm
Scaling algorithm which calculates average color of all pixels of the original image covered by the pixel of resulting image.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionscale
(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.
-
Constructor Details
-
AverageCalculationAlgorithm
public AverageCalculationAlgorithm()
-
-
Method Details
-
scale
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 interfaceIScalingAlgorithm
- Parameters:
-
original
- is an image to scale presented asBitmapImagePixels
-
scaling
- is a scaling coefficient. Should be in (0, 1] range - Returns:
- scaled image
-