fop 0.93

org.apache.fop.pdf
Class BitmapImage

java.lang.Object
  extended byorg.apache.fop.pdf.BitmapImage
All Implemented Interfaces:
PDFImage

public class BitmapImage
extends java.lang.Object
implements PDFImage

Bitmap image. This is used to create a bitmap image that will be inserted into pdf.


Constructor Summary
BitmapImage(java.lang.String k, int width, int height, byte[] data, java.lang.String mask)
          Create a bitmap image.
 
Method Summary
 int getBitsPerPixel()
          Get the number of bits per pixel.
 PDFDeviceColorSpace getColorSpace()
          Get the color space for the image data.
 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 height of this image.
 PDFICCStream getICCStream()
          Get the ICC stream.
 java.lang.String getKey()
          Get the key for this image.
 java.lang.String getMask()
          Get the bitmap mask reference for this image.
 PDFFilter getPDFFilter()
          Get the PDF Filter to be applied to the image.
 java.lang.String getSoftMask()
          Get the soft mask reference for this image.
 PDFColor getTransparentColor()
          Get the transparent color for this image.
 int getWidth()
          Get the width of this image.
 boolean isInverted()
           
 boolean isPS()
          Check if this is a postscript image.
 boolean isTransparent()
          Check if this image has a transparent color.
 void outputContents(java.io.OutputStream out)
          Writes the raw, unencoded contents of the image to a given output stream.
 void setColorSpace(PDFDeviceColorSpace cs)
          Set the color space for this image.
 void setTransparent(PDFColor t)
          Set the transparent color for this iamge.
 void setup(PDFDocument doc)
          Setup this image with the pdf document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitmapImage

public BitmapImage(java.lang.String k,
                   int width,
                   int height,
                   byte[] data,
                   java.lang.String mask)
Create a bitmap image. Creates a new bitmap image with the given data.

Parameters:
k - the key to be used to lookup the image
width - the width of the image
height - the height of the image
data - the bitmap data
mask - the transparancy mask reference if any
Method Detail

setup

public void setup(PDFDocument doc)
Setup this image with the pdf document.

Specified by:
setup in interface PDFImage
Parameters:
doc - the pdf document this will be inserted into

getKey

public java.lang.String getKey()
Get the key for this image. This key is used by the pdf document so that it will only insert an image once. All other references to the same image will use the same XObject reference.

Specified by:
getKey in interface PDFImage
Returns:
the unique key to identify this image

getWidth

public int getWidth()
Get the width of this image.

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

getHeight

public int getHeight()
Get the height of this image.

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

setColorSpace

public void setColorSpace(PDFDeviceColorSpace cs)
Set the color space for this image.

Parameters:
cs - the pdf color space

getColorSpace

public PDFDeviceColorSpace getColorSpace()
Get the color space for the image data. Possible options are: DeviceGray, DeviceRGB, or DeviceCMYK

Specified by:
getColorSpace in interface PDFImage
Returns:
the pdf doclor space

getBitsPerPixel

public int getBitsPerPixel()
Get the number of bits per pixel.

Specified by:
getBitsPerPixel in interface PDFImage
Returns:
the number of bits per pixel

setTransparent

public void setTransparent(PDFColor t)
Set the transparent color for this iamge.

Parameters:
t - the transparent color

isTransparent

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

Specified by:
isTransparent in interface PDFImage
Returns:
true if it has a transparent color

getTransparentColor

public PDFColor getTransparentColor()
Get the transparent color for this image.

Specified by:
getTransparentColor in interface PDFImage
Returns:
the transparent color if any

getMask

public java.lang.String getMask()
Get the bitmap mask reference for this image. Current not supported.

Specified by:
getMask in interface PDFImage
Returns:
the bitmap mask reference

getSoftMask

public java.lang.String getSoftMask()
Get the soft mask reference for this image.

Specified by:
getSoftMask in interface PDFImage
Returns:
the soft mask reference if any

isInverted

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

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)

getICCStream

public PDFICCStream getICCStream()
Get the ICC stream.

Specified by:
getICCStream in interface PDFImage
Returns:
always returns null since this has no icc color space

isPS

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

Specified by:
isPS in interface PDFImage
Returns:
always returns false

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()

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()

fop 0.93

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