org.apache.fop.pdf

Class PDFICCBasedColorSpace

Implemented Interfaces:
PDFColorSpace, PDFWritable

public class PDFICCBasedColorSpace
extends PDFObject
implements PDFColorSpace

Represents an ICCBased color space in PDF.

Field Summary

Fields inherited from class org.apache.fop.pdf.PDFObject

DATE_FORMAT, log

Constructor Summary

PDFICCBasedColorSpace(String explicitName, PDFICCStream iccStream)
Constructs a the ICCBased color space with an explicit name (ex.
PDFICCBasedColorSpace(PDFICCStream iccStream)
Constructs a the ICCBased color space.

Method Summary

PDFICCStream
getICCStream()
String
getName()
int
getNumComponents()
boolean
isCMYKColorSpace()
boolean
isDeviceColorSpace()
boolean
isGrayColorSpace()
boolean
isRGBColorSpace()
static PDFICCBasedColorSpace
setupsRGBAsDefaultRGBColorSpace(PDFDocument pdfDoc)
Sets sRGB as the DefaultRGB color space in the PDF document.
static PDFICCStream
setupsRGBColorProfile(PDFDocument pdfDoc)
Sets up the sRGB color profile in the PDF document.
static PDFICCBasedColorSpace
setupsRGBColorSpace(PDFDocument pdfDoc)
Installs the sRGB color space in the PDF document.
protected String
toPDFString()

Methods inherited from class org.apache.fop.pdf.PDFObject

encode, encodeBinaryToHexString, encodeString, encodeText, formatDateTime, formatDateTime, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, output, outputInline, referencePDF, setDocument, setObjectNumber, setParent, toPDF, toPDFString

Constructor Details

PDFICCBasedColorSpace

public PDFICCBasedColorSpace(String explicitName,
                             PDFICCStream iccStream)
Constructs a the ICCBased color space with an explicit name (ex. "DefaultRGB").
Parameters:
explicitName - an explicit name or null if a name should be generated
iccStream - the ICC stream to associate with this color space

PDFICCBasedColorSpace

public PDFICCBasedColorSpace(PDFICCStream iccStream)
Constructs a the ICCBased color space.
Parameters:
iccStream - the ICC stream to associate with this color space

Method Details

getICCStream

public PDFICCStream getICCStream()
Returns:
the ICC stream associated with this color space

getName

public String getName()
Specified by:
getName in interface PDFColorSpace

getNumComponents

public int getNumComponents()
Specified by:
getNumComponents in interface PDFColorSpace

isCMYKColorSpace

public boolean isCMYKColorSpace()
Specified by:
isCMYKColorSpace in interface PDFColorSpace

isDeviceColorSpace

public boolean isDeviceColorSpace()
Specified by:
isDeviceColorSpace in interface PDFColorSpace

isGrayColorSpace

public boolean isGrayColorSpace()
Specified by:
isGrayColorSpace in interface PDFColorSpace

isRGBColorSpace

public boolean isRGBColorSpace()
Specified by:
isRGBColorSpace in interface PDFColorSpace

setupsRGBAsDefaultRGBColorSpace

public static PDFICCBasedColorSpace setupsRGBAsDefaultRGBColorSpace(PDFDocument pdfDoc)
Sets sRGB as the DefaultRGB color space in the PDF document.
Parameters:
pdfDoc - the PDF document
Returns:
the newly installed color space object

setupsRGBColorProfile

public static PDFICCStream setupsRGBColorProfile(PDFDocument pdfDoc)
Sets up the sRGB color profile in the PDF document. It does so by trying to install a very small ICC profile (~4KB) instead of the very big one (~140KB) the Sun JVM uses.
Parameters:
pdfDoc - the PDF document
Returns:
the ICC stream with the sRGB profile

setupsRGBColorSpace

public static PDFICCBasedColorSpace setupsRGBColorSpace(PDFDocument pdfDoc)
Installs the sRGB color space in the PDF document.
Parameters:
pdfDoc - the PDF document
Returns:
the newly installed color space object

toPDFString

protected String toPDFString()
Overrides:
toPDFString in interface PDFObject

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.