Class ColorDecoder
java.lang.Object
com.itextpdf.pdfoptimizer.handlers.util.decoders.ColorDecoder
- Direct Known Subclasses:
-
BlankColorDecoder,CmykColorDecoder,IndexedColorDecoder,RgbColorDecoder
Class for converting color in an image according to decode array in image stream.
-
Constructor Summary
ConstructorsConstructorDescriptionColorDecoder(double[] decodeArray, double maxComponentValue) Creates an instance of color decoder. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]decode(double[] color) Converts color according to decode array.doubledecodeComponent(double colorComponent, int componentIndex) Converts one color component according to decode array.
-
Constructor Details
-
ColorDecoder
public ColorDecoder(double[] decodeArray, double maxComponentValue) Creates an instance of color decoder.- Parameters:
-
decodeArray- decode array in image stream -
maxComponentValue- maximum value for the color component, 1 in most cases
-
-
Method Details
-
decode
public double[] decode(double[] color) Converts color according to decode array.- Parameters:
-
color- an array representing the color - Returns:
- decoded array representing the color
-
decodeComponent
public double decodeComponent(double colorComponent, int componentIndex) Converts one color component according to decode array.- Parameters:
-
colorComponent- a value for color component -
componentIndex- an index of the color component being decoded - Returns:
- decoded value for color component
-