Class PDFColorHandler
java.lang.Object
org.apache.fop.pdf.PDFColorHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<String, PDFCIELabColorSpace> private org.apache.commons.logging.Logprivate PDFResourceContextprivate PDFResources -
Constructor Summary
ConstructorsConstructorDescriptionPDFColorHandler(PDFResources resources, PDFResourceContext resourceContext) Create a new instance for the givenPDFResources -
Method Summary
Modifier and TypeMethodDescriptionvoidestablishColor(StringBuffer codeBuffer, Color color, boolean fill, boolean alpha) Generates code to select the given color and handles the registration of color spaces in PDF where necessary.private voidestablishColor(StringBuffer codeBuffer, PDFColorSpace pdfcs, Color color, boolean fill) private booleanestablishColorFromColor(StringBuffer codeBuffer, Color color, boolean fill) private voidestablishDeviceCMYK(StringBuffer codeBuffer, Color color, boolean fill) private voidestablishDeviceRGB(StringBuffer codeBuffer, Color color, boolean fill, boolean alpha) private PDFCIELabColorSpacegetCIELabColorSpace(org.apache.xmlgraphics.java2d.color.CIELabColorSpace labCS) private PDFDocumentprivate PDFICCBasedColorSpaceprivate PDFSeparationColorSpacegetSeparationColorSpace(org.apache.xmlgraphics.java2d.color.NamedColorSpace cs) private voidselectColorSpace(StringBuffer codeBuffer, PDFColorSpace pdfcs, boolean fill) private voidwriteAlpha(Color color, StringBuffer codeBuffer) private voidwriteColor(StringBuffer codeBuffer, float[] comps, int componentCount, String command) private voidwriteColor(StringBuffer codeBuffer, Color color, int componentCount, String command)
-
Field Details
-
log
private org.apache.commons.logging.Log log -
resources
-
resourceContext
-
cieLabColorSpaces
-
-
Constructor Details
-
PDFColorHandler
Create a new instance for the givenPDFResources- Parameters:
resources- the PDF resources
-
-
Method Details
-
getDocument
-
establishColor
Generates code to select the given color and handles the registration of color spaces in PDF where necessary.- Parameters:
codeBuffer- the target buffer to receive the color selection codecolor- the colorfill- true for fill color, false for stroke color
-
establishColorFromColor
-
getICCBasedColorSpace
-
getSeparationColorSpace
private PDFSeparationColorSpace getSeparationColorSpace(org.apache.xmlgraphics.java2d.color.NamedColorSpace cs) -
getCIELabColorSpace
private PDFCIELabColorSpace getCIELabColorSpace(org.apache.xmlgraphics.java2d.color.CIELabColorSpace labCS) -
establishColor
private void establishColor(StringBuffer codeBuffer, PDFColorSpace pdfcs, Color color, boolean fill) -
selectColorSpace
-
establishDeviceRGB
-
writeAlpha
-
establishDeviceCMYK
-
writeColor
-
writeColor
-