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
ConstructorsConstructorDescriptionIndexedColorDecoder(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.doubledecodeComponent(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:
-
decodein 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:
-
decodeComponentin classColorDecoder - Parameters:
-
colorComponent- a value for color component -
componentIndex- an index of the color component being decoded - Returns:
- decoded value for color component
-