public final class PDPattern extends PDSpecialColorSpace
Modifier and Type | Field and Description |
---|---|
private static PDColor |
EMPTY_PATTERN
A pattern which leaves no marks on the page.
|
private PDResources |
resources |
private PDColorSpace |
underlyingColorSpace |
array
Constructor and Description |
---|
PDPattern(PDResources resources)
Creates a new pattern color space.
|
PDPattern(PDResources resources,
PDColorSpace colorSpace)
Creates a new uncolored tiling pattern color space.
|
Modifier and Type | Method and Description |
---|---|
float[] |
getDefaultDecode(int bitsPerComponent)
Returns the default decode array for this color space.
|
PDColor |
getInitialColor()
Returns the initial color value for this color space.
|
java.lang.String |
getName()
Returns the name of the color space.
|
int |
getNumberOfComponents()
Returns the number of components in this color space
|
PDAbstractPattern |
getPattern(PDColor color)
Returns the pattern for the given color.
|
PDColorSpace |
getUnderlyingColorSpace()
Returns the underlying color space, if this is an uncolored tiling pattern, otherwise null.
|
float[] |
toRGB(float[] value)
Returns the RGB equivalent of the given color value.
|
java.awt.image.BufferedImage |
toRGBImage(java.awt.image.WritableRaster raster)
Returns the (A)RGB equivalent of the given raster.
|
java.lang.String |
toString() |
getCOSObject
create, create, create, toRGBImageAWT
private static PDColor EMPTY_PATTERN
private final PDResources resources
private PDColorSpace underlyingColorSpace
public PDPattern(PDResources resources)
resources
- The current resources.public PDPattern(PDResources resources, PDColorSpace colorSpace)
resources
- The current resources.colorSpace
- The underlying color space.public java.lang.String getName()
PDColorSpace
getName
in class PDColorSpace
public int getNumberOfComponents()
PDColorSpace
getNumberOfComponents
in class PDColorSpace
public float[] getDefaultDecode(int bitsPerComponent)
PDColorSpace
getDefaultDecode
in class PDColorSpace
bitsPerComponent
- the number of bits per component.public PDColor getInitialColor()
PDColorSpace
getInitialColor
in class PDColorSpace
public float[] toRGB(float[] value)
PDColorSpace
toRGB
in class PDColorSpace
value
- a color value with component values between 0 and 1public java.awt.image.BufferedImage toRGBImage(java.awt.image.WritableRaster raster) throws java.io.IOException
PDColorSpace
toRGBImage
in class PDColorSpace
raster
- the source rasterjava.io.IOException
- if the color conversion failspublic PDAbstractPattern getPattern(PDColor color) throws java.io.IOException
color
- color containing a pattern namejava.io.IOException
- if the pattern name was not found.public PDColorSpace getUnderlyingColorSpace()
public java.lang.String toString()
toString
in class java.lang.Object