Class IndexedColorDecoder

java.lang.Object
com.itextpdf.pdfoptimizer.handlers.util.decoders.ColorDecoder
com.itextpdf.pdfoptimizer.handlers.util.decoders.IndexedColorDecoder

public final class IndexedColorDecoder extends ColorDecoder
Class for converting indexed color in an image according to decode array in image stream.
  • Constructor Summary

    Constructors
    Constructor
    Description
    IndexedColorDecoder(double[] decodeArray, int bitsPerComponent)
    Creates an instance of indexed color decoder.
  • Method Summary

    Modifier and Type
    Method
    Description
    double[]
    decode(double[] color)
    Converts color according to decode array.
    double
    decodeComponent(double colorComponent, int componentIndex)
    Converts one color component according to decode array.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 class ColorDecoder
      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 class ColorDecoder
      Parameters:
      colorComponent - a value for color component
      componentIndex - an index of the color component being decoded
      Returns:
      decoded value for color component