Class IndexedColorDecoder
java.lang.Object
com.itextpdf.pdfoptimizer.handlers.util.decoders.ColorDecoder
com.itextpdf.pdfoptimizer.handlers.util.decoders.IndexedColorDecoder
Class for converting indexed color in an image according to decode array in image stream.
-
Constructor Summary
ConstructorDescriptionIndexedColorDecoder
(double[] decodeArray, int bitsPerComponent) Creates an instance of indexed color decoder. -
Method Summary
Modifier and TypeMethodDescriptiondouble[]
decode
(double[] color) Converts color according to decode array.double
decodeComponent
(double colorComponent, int componentIndex) Converts one color component according to decode array.
-
Constructor Details
-
IndexedColorDecoder
public IndexedColorDecoder(double[] decodeArray, int bitsPerComponent) Creates an instance of indexed color decoder.- Parameters:
-
decodeArray
- decode array in image stream -
bitsPerComponent
- Amount of bits representing indexed color
-
-
Method Details
-
decode
public double[] decode(double[] color) Converts color according to decode array.- Overrides:
-
decode
in classColorDecoder
- 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.- Overrides:
-
decodeComponent
in classColorDecoder
- Parameters:
-
colorComponent
- a value for color component -
componentIndex
- an index of the color component being decoded - Returns:
- decoded value for color component
-