org.apache.fop.image
Class AbstractFopImage

Direct Known Subclasses:
BmpImage, GifJpegImage, JimiImage, SVGImage

public abstract class AbstractFopImage
implements FopImage

Base class to implement the FopImage interface.

Author:
Eric SCHAEFFER
See Also: FopImage

Constructor Summary
AbstractFopImage(URL href)
          Constructor.
AbstractFopImage(URL href, ImageReader imgReader)
          Constructor.

Method Summary
 voidclose()
          Free all ressource.
 byte[]getBitmaps()
          Return the image data (uncompressed).
 intgetBitmapsSize()
          Return the image data size (uncompressed).
 intgetBitsPerPixel()
          Return the number of bits per pixel.
 ColorSpacegetColorSpace()
          Return the image color space.
 intgetHeight()
          Return the image height.
 PDFFiltergetPDFFilter()
          Return the original image compression type.
 byte[]getRessourceBytes()
          Return the original image data (compressed).
 intgetRessourceBytesSize()
          Return the original image data size (compressed).
 PDFColorgetTransparentColor()
          Return the transparent color.
 StringgetURL()
          Return the image URL.
 intgetWidth()
          Return the image width.
 booleanisTransparent()
          Return the image transparency.

Constructor Detail

AbstractFopImage

public AbstractFopImage(URL href)
throws FopImageException
Constructor. Construct a new FopImage object and initialize its default properties: The image data isn't kept in memory.
Parameters:
href - image URL
Returns: a new FopImage object
Throws:
FopImageException - an error occured during initialization

AbstractFopImage

public AbstractFopImage(URL href, ImageReader imgReader)
throws FopImageException
Constructor. Construct a new FopImage object and initialize its default properties: The image data isn't kept in memory.
Parameters:
href - image URL imgReader ImageReader object
Returns: a new FopImage object
Throws:
FopImageException - an error occured during initialization
Method Detail

close

public void close()
Free all ressource.

getBitmaps

public byte[] getBitmaps()
throws FopImageException
Return the image data (uncompressed).
Returns: the image data
Throws:
FopImageException - an error occured during loading

getBitmapsSize

public int getBitmapsSize()
throws FopImageException
Return the image data size (uncompressed).
Returns: the image data size
Throws:
FopImageException - an error occured during loading

getBitsPerPixel

public int getBitsPerPixel()
throws FopImageException
Return the number of bits per pixel.
Returns: number of bits per pixel
Throws:
FopImageException - an error occured during property retriaval

getColorSpace

public ColorSpace getColorSpace()
throws FopImageException
Return the image color space.
Returns: the image color space (org.apache.fop.datatypes.ColorSpace)
Throws:
FopImageException - an error occured during property retriaval

getHeight

public int getHeight()
throws FopImageException
Return the image height.
Returns: the image height
Throws:
FopImageException - an error occured during property retriaval

getPDFFilter

public PDFFilter getPDFFilter()
throws FopImageException
Return the original image compression type.
Returns: the original image compression type (org.apache.fop.pdf.PDFFilter)
Throws:
FopImageException - an error occured during loading

getRessourceBytes

public byte[] getRessourceBytes()
throws FopImageException
Return the original image data (compressed).
Returns: the original image data
Throws:
FopImageException - an error occured during loading

getRessourceBytesSize

public int getRessourceBytesSize()
throws FopImageException
Return the original image data size (compressed).
Returns: the original image data size
Throws:
FopImageException - an error occured during loading

getTransparentColor

public PDFColor getTransparentColor()
throws FopImageException
Return the transparent color.
Returns: the transparent color (org.apache.fop.pdf.PDFColor)
Throws:
FopImageException - an error occured during property retriaval

getURL

public String getURL()
Return the image URL.
Returns: the image URL (as String)

getWidth

public int getWidth()
throws FopImageException
Return the image width.
Returns: the image width
Throws:
FopImageException - an error occured during property retriaval

isTransparent

public boolean isTransparent()
throws FopImageException
Return the image transparency.
Returns: true if the image is transparent
Throws:
FopImageException - an error occured during property retriaval

Association Links

to Class java.net.URL

Image URL.

to Class org.apache.fop.image.analyser.ImageReader

ImageReader object (to obtain image header informations).

to Class org.apache.fop.datatypes.ColorSpace

Image color space (org.apache.fop.datatypes.ColorSpace).

to Class org.apache.fop.pdf.PDFColor

Transparent color (org.apache.fop.pdf.PDFColor).