fop 0.95

org.apache.fop.render.pdf
Class AbstractImageAdapter

java.lang.Object
  extended by org.apache.fop.render.pdf.AbstractImageAdapter
All Implemented Interfaces:
PDFImage
Direct Known Subclasses:
ImageRawCCITTFaxAdapter, ImageRawJPEGAdapter, ImageRenderedAdapter

public abstract class AbstractImageAdapter
extends java.lang.Object
implements PDFImage

Abstract PDFImage implementation for the PDF renderer.


Field Summary
protected  org.apache.xmlgraphics.image.loader.Image image
          the image
 
Constructor Summary
AbstractImageAdapter(org.apache.xmlgraphics.image.loader.Image image, java.lang.String key)
          Creates a new PDFImage from an Image instance.
 
Method Summary
 int getHeight()
          Get the image height in pixels.
 PDFICCStream getICCStream()
          Get the ICC stream for this image.
protected  java.awt.color.ColorSpace getImageColorSpace()
          Returns the image's color space.
 java.lang.String getKey()
          Key to look up XObject.
 java.lang.String getMask()
          Get the PDF reference for a bitmap mask.
 java.lang.String getSoftMask()
          
 PDFReference getSoftMaskReference()
          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 populateXObjectDictionary(PDFDictionary dict)
          Populates the XObject's dictionary with additional values.
 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
 
Methods inherited from interface org.apache.fop.pdf.PDFImage
getBitsPerComponent, getColorSpace, getFilterHint, getPDFFilter, outputContents
 

Field Detail

image

protected org.apache.xmlgraphics.image.loader.Image image
the image

Constructor Detail

AbstractImageAdapter

public AbstractImageAdapter(org.apache.xmlgraphics.image.loader.Image image,
                            java.lang.String key)
Creates a new PDFImage from an Image instance.

Parameters:
image - the image
key - XObject key
Method Detail

getKey

public java.lang.String getKey()
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

getImageColorSpace

protected java.awt.color.ColorSpace getImageColorSpace()
Returns the image's color space.

Returns:
the color space

setup

public void setup(PDFDocument doc)
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

getWidth

public int getWidth()
Get the image width in pixels.

Specified by:
getWidth in interface PDFImage
Returns:
the image width

getHeight

public int getHeight()
Get the image height in pixels.

Specified by:
getHeight in interface PDFImage
Returns:
the image height

isTransparent

public boolean isTransparent()
Check if this image has a transparent color transparency.

Specified by:
isTransparent in interface PDFImage
Returns:
true if it has transparency

getTransparentColor

public PDFColor getTransparentColor()
Get the transparent color.

Specified by:
getTransparentColor in interface PDFImage
Returns:
the transparent color for this image

getMask

public java.lang.String getMask()
Get the PDF reference for a bitmap mask.

Specified by:
getMask in interface PDFImage
Returns:
the PDF reference for the mask image

getSoftMask

public java.lang.String getSoftMask()


getSoftMaskReference

public PDFReference getSoftMaskReference()
Get the PDF reference for a soft mask.

Specified by:
getSoftMaskReference in interface PDFImage
Returns:
the PDF reference for a soft mask image (or null if there's no soft mask)

isInverted

public boolean isInverted()

Specified by:
isInverted in interface PDFImage
Returns:
true for CMYK images generated by Adobe Photoshop

isPS

public boolean isPS()
Check if this image is a PostScript image.

Specified by:
isPS in interface PDFImage
Returns:
true if this is a PostScript image

getICCStream

public PDFICCStream getICCStream()
Get the ICC stream for this image.

Specified by:
getICCStream in interface PDFImage
Returns:
the ICC stream for this image if any

populateXObjectDictionary

public void populateXObjectDictionary(PDFDictionary dict)
Populates the XObject's dictionary with additional values. The values are added to the dictionary after all the values obtained from other methods from this interface have been put into the dictionary. That allows to override certain values.

Specified by:
populateXObjectDictionary in interface PDFImage
Parameters:
dict - the dictionary to fill

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

fop 0.95

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