Class IndexedColorSpace

java.lang.Object
com.datalogics.PDFL.ColorSpace
com.datalogics.PDFL.IndexedColorSpace

public class IndexedColorSpace extends ColorSpace
Indexed color spaces are used to reduce the amount of memory used for processing images. Indexed color spaces are used when a limited number of colors are needed.

Commonly, an image with an indexed color space can be one third the size of the same image with a standard color space, because the indexed image uses a smaller palette of colors.

  • Constructor Details

    • IndexedColorSpace

      public IndexedColorSpace(ColorSpace base, int hival, List<Integer> lookup)
      Create a Indexed color space.

      Parameters:
      base - The base color space in which the values in the color table are to be interpreted. It can be any device or CIE-based color space or (in PDF 1.3) a Separation or DeviceN space, but not a Pattern space or another Indexed space.
      hival - an integer that specifies the maximum valid index value. In other words, the color table is to be indexed by integers in the range 0 to hival. hival can be no greater than 255.
      lookup - a list of integers in the range 0..255. There must be m * (hival + 1) values, where m is the number of components of the base color space.
  • Method Details

    • delete

      public void delete()
      Overrides:
      delete in class ColorSpace
    • getBase

      public ColorSpace getBase()
      The base color space in which the values in the color table are to be interpreted. It can be any device or CIE-based color space or (in PDF 1.3) a Separation or DeviceN space, but not a Pattern space or another Indexed space.
    • getHiVal

      public int getHiVal()
      an integer that specifies the maximum valid index value. In other words, the color table is to be indexed by integers in the range 0 to hival. hival can be no greater than 255.
    • getLookup

      public List<Integer> getLookup()
      A list of integers in the range 0..255. There must be m * (hival + 1) values, where m is the number of components of the base color space.