|
fop 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.pdf.PDFObject
org.apache.fop.pdf.PDFPathPaint
org.apache.fop.pdf.PDFColor
public class PDFColor
PDF Color object. This is used to output color to a PDF content stream.
Field Summary |
---|
Fields inherited from class org.apache.fop.pdf.PDFPathPaint |
---|
colorSpace |
Fields inherited from class org.apache.fop.pdf.PDFObject |
---|
DATE_FORMAT, log |
Constructor Summary | |
---|---|
PDFColor(java.awt.Color col)
Create a PDF color from a java.awt.Color object. |
|
PDFColor(double theRed,
double theGreen,
double theBlue)
Create a PDF color with double values ranging from 0 to 1 |
|
PDFColor(double theCyan,
double theMagenta,
double theYellow,
double theBlack)
Create a PDF color with CMYK values. |
|
PDFColor(int theRed,
int theGreen,
int theBlue)
Create a PDF color with int values ranging from 0 to 255 |
|
PDFColor(PDFDocument pdfDoc,
java.awt.Color col)
Create PDFColor for the given document and based on the java.awt.Color object In case the java.awt.Color is an instance of the ColorExt class a PDFICCStream is added to the PDFDocument that is being created |
Method Summary | |
---|---|
double |
black()
Get the black component. |
double |
blue()
Get the blue component. |
int |
blue255()
Get the blue integer component. |
protected boolean |
contentEquals(PDFObject obj)
Check if the other PDFObject has the same content as the current object. |
protected void |
convertCMYKtoGRAY()
Convert the color from CMYK to Gray. |
protected void |
convertCMYKtoRGB()
Convert the color from CMYK to RGB. |
protected void |
convertGRAYtoCMYK()
Convert the color from Gray to CMYK. |
protected void |
convertGRAYtoRGB()
Convert the color from Gray to RGB. |
protected void |
convertRGBtoCMYK()
Convert the color from RGB to CMYK. |
protected void |
convertRGBtoGRAY()
Convert the color from RGB to Gray. |
double |
cyan()
Get the cyan component. |
java.lang.String |
getColorSpaceOut(boolean fillNotStroke)
Get the PDF output string for this color. |
java.util.List |
getVector()
Return a vector representation of the color in the appropriate colorspace. |
double |
green()
Get the green component. |
int |
green255()
Get the green integer component. |
double |
magenta()
Get the magenta component. |
double |
red()
Get the red component. |
int |
red255()
Get the red integer component. |
void |
setColorSpace(int theColorSpace)
Set the color space for this color. |
byte[] |
toPDF()
Create pdf. |
double |
yellow()
Get the yellow component. |
Methods inherited from class org.apache.fop.pdf.PDFPathPaint |
---|
getColorSpace |
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, toPDFString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDFColor(double theRed, double theGreen, double theBlue)
theRed
- the red double valuetheGreen
- the green double valuetheBlue
- the blue double valuepublic PDFColor(PDFDocument pdfDoc, java.awt.Color col)
pdfDoc
- PDFDocument that is being createdcol
- Color object from which to create this PDFColorpublic PDFColor(java.awt.Color col)
col
- the java.awt.Color object for which to create a PDFColor objectpublic PDFColor(int theRed, int theGreen, int theBlue)
theRed
- the red integer valuetheGreen
- the green integer valuetheBlue
- the blue integer valuepublic PDFColor(double theCyan, double theMagenta, double theYellow, double theBlack)
theCyan
- the cyan valuetheMagenta
- the magenta valuetheYellow
- the yellow valuetheBlack
- the black valueMethod Detail |
---|
public java.util.List getVector()
public double red()
public double green()
public double blue()
public int red255()
public int green255()
public int blue255()
public double cyan()
public double magenta()
public double yellow()
public double black()
public void setColorSpace(int theColorSpace)
setColorSpace
in class PDFPathPaint
theColorSpace
- the new color spacepublic java.lang.String getColorSpaceOut(boolean fillNotStroke)
getColorSpaceOut
in class PDFPathPaint
fillNotStroke
- whether to return fill or stroke command
protected void convertCMYKtoRGB()
protected void convertRGBtoCMYK()
protected void convertGRAYtoRGB()
protected void convertGRAYtoCMYK()
protected void convertCMYKtoGRAY()
protected void convertRGBtoGRAY()
public byte[] toPDF()
toPDF
in class PDFObject
protected boolean contentEquals(PDFObject obj)
Note: This function has a contract which is less binding than
Object.equals(Object)
. Whereas equals would require all values to be
identical, this method is not required to check everything. In the case
of PDFObjects, this means that the overriding function does not have to
check for PDFObject.getObjectID()
.
contentEquals
in class PDFObject
obj
- object to compare to.
|
fop 1.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |