Class PatternSpace
java.lang.Object
org.loboevolution.pdfview.colorspace.PDFColorSpace
org.loboevolution.pdfview.colorspace.PatternSpace
A PatternSpace fills with a pattern, the name of which is
specified in the call to getPaint(). This pattern is
read from the resources of the current page. The pattern space
may also have a base color space which the pattern is defined in.
-
Field Summary
Fields inherited from class org.loboevolution.pdfview.colorspace.PDFColorSpace
COLORSPACE_CMYK, COLORSPACE_GRAY, COLORSPACE_PATTERN, COLORSPACE_RGB
-
Constructor Summary
ConstructorDescriptionConstructor for PatternSpace.PatternSpace
(PDFColorSpace base) Create a pattern space with the given color space as a base -
Method Summary
Modifier and TypeMethodDescriptiongetBase()
Get the base color spaceint
get the number of components expected in the getPaint commandgetPaint
(float[] components) get the PDFPaint representing the color described by the given color componentsGet the paint representing a pattern, optionally with the given base paint.Methods inherited from class org.loboevolution.pdfview.colorspace.PDFColorSpace
getColorSpace, getColorSpace, getColorSpace
-
Constructor Details
-
PatternSpace
public PatternSpace()Constructor for PatternSpace.
-
PatternSpace
Create a pattern space with the given color space as a base- Parameters:
base
- aPDFColorSpace
object.
-
-
Method Details
-
getBase
Get the base color space- Returns:
- a
PDFColorSpace
object.
-
getNumComponents
public int getNumComponents()get the number of components expected in the getPaint commandGet the number of components we want
- Overrides:
getNumComponents
in classPDFColorSpace
- Returns:
- a
Integer
object.
-
getPaint
get the PDFPaint representing the color described by the given color componentsget the PDFPaint representing the color described by the given color components
- Overrides:
getPaint
in classPDFColorSpace
- Parameters:
components
- the color components corresponding to the given colorspace- Returns:
- a PDFPaint object representing the closest Color to the given components.
-
getPaint
public PDFPaint getPaint(PDFObject patternObj, float[] components, Map resources) throws IOException Get the paint representing a pattern, optionally with the given base paint.- Parameters:
patternObj
- the pattern to rendercomponents
- the components of the base paintresources
- aMap
object.- Returns:
- a
PDFPaint
object. - Throws:
IOException
- if any.
-