org.pdfbox.pdmodel.graphics.color
Class PDIndexed
- COSObjectable
This class represents an Indexed color space.
static String | ABBREVIATED_NAME - The abbreviated name of this color space.
|
static String | NAME - The name of this color space.
|
ColorModel | createColorModel(int bpc) - Create a Java color model for this colorspace.
|
ColorSpace | createColorSpace() - Create a Java colorspace for this colorspace.
|
PDColorSpace | getBaseColorSpace() - This will get the color space that acts as the index for this color space.
|
int | getHighValue() - Get the highest value for the lookup.
|
String | getName() - This will return the name of the color space.
|
int | getNumberOfComponents() - This will return the number of color components.
|
int | lookupColor(int componentNumber, int lookupIndex) - This will perform a lookup into the color lookup table.
|
void | setBaseColorSpace(PDColorSpace base) - This will set the base color space.
|
void | setHighValue(int high) - This will set the highest value that is allowed.
|
void | setLookupColor(int componentNumber, int lookupIndex, int color) - This will set a color in the color lookup table.
|
ABBREVIATED_NAME
public static final String ABBREVIATED_NAME
The abbreviated name of this color space.
NAME
public static final String NAME
The name of this color space.
PDIndexed
public PDIndexed()
Constructor, default DeviceRGB, hival 255.
PDIndexed
public PDIndexed(COSArray indexedArray)
Constructor.
indexedArray
- The array containing the indexed parameters
createColorModel
public ColorModel createColorModel(int bpc)
throws IOException
Create a Java color model for this colorspace.
- createColorModel in interface PDColorSpace
bpc
- The number of bits per component.
- A color model that can be used for Java AWT operations.
createColorSpace
public ColorSpace createColorSpace()
throws IOException
Create a Java colorspace for this colorspace.
- createColorSpace in interface PDColorSpace
- A color space that can be used for Java AWT operations.
getBaseColorSpace
public PDColorSpace getBaseColorSpace()
throws IOException
This will get the color space that acts as the index for this color space.
getHighValue
public int getHighValue()
Get the highest value for the lookup.
getName
public String getName()
This will return the name of the color space.
- getName in interface PDColorSpace
- The name of the color space.
getNumberOfComponents
public int getNumberOfComponents()
throws IOException
This will return the number of color components. This will return the
number of color components in the base color.
- getNumberOfComponents in interface PDColorSpace
- The number of components in this color space.
lookupColor
public int lookupColor(int componentNumber,
int lookupIndex)
throws IOException
This will perform a lookup into the color lookup table.
componentNumber
- The component number, probably 1,2,3,3.lookupIndex
- The zero-based index into the table, should not exceed the high value.
- The value that was from the lookup table.
setBaseColorSpace
public void setBaseColorSpace(PDColorSpace base)
This will set the base color space.
base
- The base color space to use as the index.
setHighValue
public void setHighValue(int high)
This will set the highest value that is allowed. This cannot be higher
than 255.
high
- The highest value for the lookup table.
setLookupColor
public void setLookupColor(int componentNumber,
int lookupIndex,
int color)
throws IOException
This will set a color in the color lookup table.
componentNumber
- The component number, probably 1,2,3,3.lookupIndex
- The zero-based index into the table, should not exceed the high value.color
- The color that will go into the table.