fop 0.94

org.apache.fop.render.pdf
Class FopPDFImage

java.lang.Object
  extended by org.apache.fop.render.pdf.FopPDFImage
All Implemented Interfaces:
PDFImage

public class FopPDFImage
extends java.lang.Object
implements PDFImage

PDFImage implementation for the PDF renderer.


Constructor Summary
FopPDFImage(FopImage image, java.lang.String key)
          Creates a new PDFImage from a FopImage
 
Method Summary
 int getBitsPerPixel()
          Get the bits per pixel for this image.
 PDFDeviceColorSpace getColorSpace()
          Get the color space for this image.
 java.lang.String getFilterHint()
          Returns a hint in form of a String (Possible values from PDFFilterList) indicating which filter setup should be used to encode the object.
 int getHeight()
          Get the image height in pixels.
 PDFICCStream getICCStream()
          Get the ICC stream for this image.
 java.lang.String getKey()
          Key to look up XObject.
 java.lang.String getMask()
          Get the PDF reference for a bitmap mask.
 PDFFilter getPDFFilter()
          Get the PDF Filter to be applied to the image.
 java.lang.String getSoftMask()
          Get the PDF reference for a soft mask.
 PDFColor getTransparentColor()
          Get the transparent color.
 int getWidth()
          Get the image width in pixels.
 boolean isInverted()
           
 boolean isPS()
          Check if this image is a PostScript image.
 boolean isTransparent()
          Check if this image has a transparent color transparency.
 void outputContents(java.io.OutputStream out)
          Writes the raw, unencoded contents of the image to a given output stream.
protected  void outputPostScriptContents(java.io.OutputStream out)
          Serializes an EPS image to an OutputStream.
 void setup(PDFDocument doc)
          Setup the PDF image for the current document.
static PDFDeviceColorSpace toPDFColorSpace(java.awt.color.ColorSpace cs)
          Converts a ColorSpace object to a PDFColorSpace object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FopPDFImage

public FopPDFImage(FopImage image,
                   java.lang.String key)
Creates a new PDFImage from a FopImage

Parameters:
image - Image
key - XObject key
Method Detail

getKey

public java.lang.String getKey()
Description copied from interface: PDFImage
Key to look up XObject. This should be a unique key to refer to the image.

Specified by:
getKey in interface PDFImage
Returns:
the key for this image
See Also:
PDFImage.getKey()

setup

public void setup(PDFDocument doc)
Description copied from interface: PDFImage
Setup the PDF image for the current document. Some image formats may need to access the document (for example to add an ICC profile to the document).

Specified by:
setup in interface PDFImage
Parameters:
doc - the PDF parent document (todo) Remove this and delegate to the XObject
See Also:
PDFImage.setup(PDFDocument)

getWidth

public int getWidth()
Description copied from interface: PDFImage
Get the image width in pixels.

Specified by:
getWidth in interface PDFImage
Returns:
the image width
See Also:
PDFImage.getWidth()

getHeight

public int getHeight()
Description copied from interface: PDFImage
Get the image height in pixels.

Specified by:
getHeight in interface PDFImage
Returns:
the image height
See Also:
PDFImage.getHeight()

getColorSpace

public PDFDeviceColorSpace getColorSpace()
Description copied from interface: PDFImage
Get the color space for this image. Possible results are: DeviceGray, DeviceRGB, or DeviceCMYK

Specified by:
getColorSpace in interface PDFImage
Returns:
the color space
See Also:
PDFImage.getColorSpace()

getBitsPerPixel

public int getBitsPerPixel()
Description copied from interface: PDFImage
Get the bits per pixel for this image.

Specified by:
getBitsPerPixel in interface PDFImage
Returns:
the bits per pixel
See Also:
PDFImage.getBitsPerPixel()

isTransparent

public boolean isTransparent()
Description copied from interface: PDFImage
Check if this image has a transparent color transparency.

Specified by:
isTransparent in interface PDFImage
Returns:
true if it has transparency
See Also:
PDFImage.isTransparent()

getTransparentColor

public PDFColor getTransparentColor()
Description copied from interface: PDFImage
Get the transparent color.

Specified by:
getTransparentColor in interface PDFImage
Returns:
the transparent color for this image
See Also:
PDFImage.getTransparentColor()

getMask

public java.lang.String getMask()
Description copied from interface: PDFImage
Get the PDF reference for a bitmap mask.

Specified by:
getMask in interface PDFImage
Returns:
the PDF reference for the mask image
See Also:
PDFImage.getMask()

getSoftMask

public java.lang.String getSoftMask()
Description copied from interface: PDFImage
Get the PDF reference for a soft mask.

Specified by:
getSoftMask in interface PDFImage
Returns:
the PDF reference for a soft mask image
See Also:
PDFImage.getSoftMask()

isInverted

public boolean isInverted()
Specified by:
isInverted in interface PDFImage
Returns:
true for CMYK images generated by Adobe Photoshop

isPS

public boolean isPS()
Description copied from interface: PDFImage
Check if this image is a PostScript image.

Specified by:
isPS in interface PDFImage
Returns:
true if this is a PostScript image
See Also:
PDFImage.isPS()

getPDFFilter

public PDFFilter getPDFFilter()
Description copied from interface: PDFImage
Get the PDF Filter to be applied to the image.

Specified by:
getPDFFilter in interface PDFImage
Returns:
the PDF Filter or null
See Also:
PDFImage.getPDFFilter()

outputContents

public void outputContents(java.io.OutputStream out)
                    throws java.io.IOException
Description copied from interface: PDFImage
Writes the raw, unencoded contents of the image to a given output stream.

Specified by:
outputContents in interface PDFImage
Parameters:
out - OutputStream to write to
Throws:
java.io.IOException - if there creating stream
See Also:
PDFImage.outputContents(OutputStream)

outputPostScriptContents

protected void outputPostScriptContents(java.io.OutputStream out)
                                 throws java.io.IOException
Serializes an EPS image to an OutputStream.

Parameters:
out - OutputStream to write to
Throws:
java.io.IOException - in case of an I/O problem

getICCStream

public PDFICCStream getICCStream()
Description copied from interface: PDFImage
Get the ICC stream for this image.

Specified by:
getICCStream in interface PDFImage
Returns:
the ICC stream for this image if any
See Also:
PDFImage.getICCStream()

toPDFColorSpace

public static PDFDeviceColorSpace toPDFColorSpace(java.awt.color.ColorSpace cs)
Converts a ColorSpace object to a PDFColorSpace object.

Parameters:
cs - ColorSpace instance
Returns:
PDFColorSpace new converted object

getFilterHint

public java.lang.String getFilterHint()
Description copied from interface: PDFImage
Returns a hint in form of a String (Possible values from PDFFilterList) indicating which filter setup should be used to encode the object.

Specified by:
getFilterHint in interface PDFImage
Returns:
the filter setup hint
See Also:
PDFImage.getFilterHint()

fop 0.94

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