com.sun.pdfview.colorspace

Class IndexedColor

public class IndexedColor extends PDFColorSpace

A PDFColorSpace for an IndexedColor model
Field Summary
protected byte[]finalcolors
r,g,and b components of the color table as a single array, for Java's IndexColorModel
Constructor Summary
IndexedColor(PDFColorSpace base, int count, PDFObject stream)
create a new IndexColor PDFColorSpace based on another PDFColorSpace, a count of colors, and a stream of values.
IndexedColor(Color[] table)
create a new IndexColor PDFColorSpace based on a table of colors.
Method Summary
byte[]getColorComponents()
Get the table of color components
intgetCount()
Get the number of indices

Field Detail

finalcolors

protected byte[] finalcolors
r,g,and b components of the color table as a single array, for Java's IndexColorModel

Constructor Detail

IndexedColor

public IndexedColor(PDFColorSpace base, int count, PDFObject stream)
create a new IndexColor PDFColorSpace based on another PDFColorSpace, a count of colors, and a stream of values. Every consecutive n bytes of the stream is interpreted as a color in the base ColorSpace, where n is the number of components in that color space.

Parameters: base the color space in which the data is interpreted count the number of colors in the table stream a stream of bytes. The number of bytes must be count*n, where n is the number of components in the base colorspace.

IndexedColor

public IndexedColor(Color[] table)
create a new IndexColor PDFColorSpace based on a table of colors.

Parameters: table an array of colors

Method Detail

getColorComponents

public byte[] getColorComponents()
Get the table of color components

getCount

public int getCount()
Get the number of indices