org.apache.fop.pdf
Class PDFColor
- PDFWritable
PDF Color object.
This is used to output color to a PDF content stream.
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(java.awt.Color col) - Create a PDF color from a java.awt.Color object.
|
PDFColor(PDFDocument pdfDoc, 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
|
double | black() - Get the black component.
|
double | blue() - Get the blue component.
|
int | blue255() - Get the blue integer component.
|
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.
|
boolean | equals(Object obj) - Check for equality of color with another object.
|
String | getColorSpaceOut(boolean fillNotStroke) - Get the PDF output string for this color.
|
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.
|
encode , encodeBinaryToHexString , encodeString , encodeText , formatDateTime , formatDateTime , formatObject , getDocument , getDocumentSafely , getGeneration , getObjectID , getObjectNumber , getParent , hasObjectNumber , makeReference , output , outputInline , referencePDF , setDocument , setObjectNumber , setParent , toPDF , toPDFString |
PDFColor
public PDFColor(double theRed,
double theGreen,
double theBlue)
Create a PDF color with double values ranging from 0 to 1
theRed
- the red double valuetheGreen
- the green double valuetheBlue
- the blue double value
PDFColor
public PDFColor(double theCyan,
double theMagenta,
double theYellow,
double theBlack)
Create a PDF color with CMYK values.
theCyan
- the cyan valuetheMagenta
- the magenta valuetheYellow
- the yellow valuetheBlack
- the black value
PDFColor
public PDFColor(int theRed,
int theGreen,
int theBlue)
Create a PDF color with int values ranging from 0 to 255
theRed
- the red integer valuetheGreen
- the green integer valuetheBlue
- the blue integer value
PDFColor
public PDFColor(java.awt.Color col)
Create a PDF color from a java.awt.Color object.
Different Color objects are handled differently. Cases recognized are.
1. CMYK color
2. ColorExt color
3. 'Normal' java.awt.Color (RGB case assumed)
col
- the java.awt.Color object for which to create a PDFColor object
PDFColor
public PDFColor(PDFDocument pdfDoc,
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
pdfDoc
- PDFDocument that is being createdcol
- Color object from which to create this PDFColor
black
public double black()
Get the black component.
blue
public double blue()
Get the blue component.
blue255
public int blue255()
Get the blue integer component.
convertCMYKtoGRAY
protected void convertCMYKtoGRAY()
Convert the color from CMYK to Gray.
convertCMYKtoRGB
protected void convertCMYKtoRGB()
Convert the color from CMYK to RGB.
convertGRAYtoCMYK
protected void convertGRAYtoCMYK()
Convert the color from Gray to CMYK.
convertGRAYtoRGB
protected void convertGRAYtoRGB()
Convert the color from Gray to RGB.
convertRGBtoCMYK
protected void convertRGBtoCMYK()
Convert the color from RGB to CMYK.
convertRGBtoGRAY
protected void convertRGBtoGRAY()
Convert the color from RGB to Gray.
cyan
public double cyan()
Get the cyan component.
equals
public boolean equals(Object obj)
Check for equality of color with another object.
obj
- the object to compare
getColorSpaceOut
public String getColorSpaceOut(boolean fillNotStroke)
Get the PDF output string for this color.
This returns the string to be inserted into PDF for setting
the current color.
- getColorSpaceOut in interface PDFPathPaint
fillNotStroke
- whether to return fill or stroke command
- the PDF string for setting the fill/stroke color
getVector
public List getVector()
Return a vector representation of the color
in the appropriate colorspace.
- a list containing the Double values of the color
green
public double green()
Get the green component.
green255
public int green255()
Get the green integer component.
magenta
public double magenta()
Get the magenta component.
red
public double red()
Get the red component.
red255
public int red255()
Get the red integer component.
setColorSpace
public void setColorSpace(int theColorSpace)
Set the color space for this color.
If the new color space is different the values are converted
to the new color space.
- setColorSpace in interface PDFPathPaint
theColorSpace
- the new color space
toPDF
public byte[] toPDF()
Create pdf.
Not used for this object.
- toPDF in interface PDFObject
yellow
public double yellow()
Get the yellow component.
Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.