org.apache.fop.pdf

Class BitmapImage

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(String k, int width, int height, byte[] data, 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.
String
getFilterHint()
int
getHeight()
Get the height of this image.
PDFICCStream
getICCStream()
Get the ICC stream.
String
getKey()
Get the key for this image.
String
getMask()
Get the bitmap mask reference for this image.
PDFFilter
getPDFFilter()
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(OutputStream out)
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.

Constructor Details

BitmapImage

public BitmapImage(String k,
                   int width,
                   int height,
                   byte[] data,
                   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 Details

getBitsPerPixel

public int getBitsPerPixel()
Get the number of bits per pixel.
Specified by:
getBitsPerPixel in interface PDFImage
Returns:
the number of bits per pixel

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

getFilterHint

public String getFilterHint()
Specified by:
getFilterHint in interface PDFImage

getHeight

public int getHeight()
Get the height of this image.
Specified by:
getHeight in interface PDFImage
Returns:
the height of the image

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

getKey

public 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

getMask

public String getMask()
Get the bitmap mask reference for this image. Current not supported.
Specified by:
getMask in interface PDFImage
Returns:
the bitmap mask reference

getPDFFilter

public PDFFilter getPDFFilter()
Specified by:
getPDFFilter in interface PDFImage

getSoftMask

public String getSoftMask()
Get the soft mask reference for this image.
Specified by:
getSoftMask in interface PDFImage
Returns:
the soft mask reference if any

getTransparentColor

public PDFColor getTransparentColor()
Get the transparent color for this image.
Specified by:
getTransparentColor in interface PDFImage
Returns:
the transparent color if any

getWidth

public int getWidth()
Get the width of this image.
Specified by:
getWidth in interface PDFImage
Returns:
the width of the image

isInverted

public boolean isInverted()
Specified by:
isInverted in interface PDFImage

isPS

public boolean isPS()
Check if this is a postscript image.
Specified by:
isPS in interface PDFImage
Returns:
always returns false

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

outputContents

public void outputContents(OutputStream out)
            throws IOException
Specified by:
outputContents in interface PDFImage

setColorSpace

public void setColorSpace(PDFDeviceColorSpace cs)
Set the color space for this image.
Parameters:
cs - the pdf color space

setTransparent

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

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

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