public class IndexedColor extends PDFColorSpace
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
finalcolors
r,g,and b components of the color table as a single array, for
Java's IndexColorModel
|
COLORSPACE_CMYK, COLORSPACE_GRAY, COLORSPACE_PATTERN, COLORSPACE_RGB| Constructor and Description |
|---|
IndexedColor(Color[] table)
create a new IndexColor PDFColorSpace based on a table of colors.
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getColorComponents()
Get the table of color components
|
int |
getCount()
Get the number of indices
|
int |
getNumComponents()
get the number of components of this colorspace (1)
|
PDFPaint |
getPaint(float[] components)
get the color represented by the index.
|
getColorSpace, getColorSpace, getColorSpaceprotected byte[] finalcolors
public IndexedColor(PDFColorSpace base, int count, PDFObject stream) throws IOException
base - the color space in which the data is interpretedcount - the number of colors in the tablestream - a stream of bytes. The number of bytes must be count*n,
where n is the number of components in the base colorspace.IOExceptionpublic IndexedColor(Color[] table) throws IOException
table - an array of colorsIOExceptionpublic int getCount()
public byte[] getColorComponents()
public int getNumComponents()
getNumComponents in class PDFColorSpacepublic PDFPaint getPaint(float[] components)
getPaint in class PDFColorSpacecomponents - an array of exactly one integer number whose
value is between 0 and the size of the color table - 1.Copyright © 2024. All rights reserved.