## org.apache.fop.image
Class AbstractFopImage

    java.lang.Object
      |
      +--org.apache.fop.image.AbstractFopImage

Direct Known Subclasses:
  BmpImage, GifJpegImage, SVGImage

public abstract class AbstractFopImage
extends java.lang.Object
implements FopImage

Base class to implement the FopImage interface.

Author:
  Eric SCHAEFFER
See Also:
  `FopImage`

Field Summary
`protected byte[]` `m_bitmaps` Image data (uncompressed).
`protected int` `m_bitmapsSize` Image data size.
`protected int` `m_bitsPerPixel` Bits per pixel.
`protected ColorSpace` `m_colorSpace` Image color space (org.apache.fop.datatypes.ColorSpace).
`protected int` `m_height` Image height (in pixel).
`protected java.net.URL` `m_href` Image URL.
`protected ImageReader` `m_imageReader` ImageReader object (to obtain image header informations).
`protected boolean` `m_isTransparent` Image transparency.
`protected PDFColor` `m_transparentColor` Transparent color (org.apache.fop.pdf.PDFColor).
`protected int` `m_width` Image width (in pixel).

Constructor Summary
`AbstractFopImage(java.net.URL href)` Constructor.
`AbstractFopImage(java.net.URL href, ImageReader imgReader)` Constructor.

Method Summary
`void` `close()` Free all ressource.
`byte[]` `getBitmaps()` Return the image data (uncompressed).
`int` `getBitmapsSize()` Return the image data size (uncompressed).
`int` `getBitsPerPixel()` Return the number of bits per pixel.
`ColorSpace` `getColorSpace()` Return the image color space.
`int` `getHeight()` Return the image height.
`PDFFilter` `getPDFFilter()` Return the original image compression type.
`byte[]` `getRessourceBytes()` Return the original image data (compressed).
`int` `getRessourceBytesSize()` Return the original image data size (compressed).
`PDFColor` `getTransparentColor()` Return the transparent color.
`java.lang.String` `getURL()` Return the image URL.
`int` `getWidth()` Return the image width.
`boolean` `isTransparent()` Return the image transparency.
`protected abstract void` `loadImage()` Load image data and initialize its properties.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_width

    protected int m_width

  Image width (in pixel).

### m_height

    protected int m_height

  Image height (in pixel).

### m_href

    protected java.net.URL m_href

  Image URL.

### m_imageReader

    protected ImageReader m_imageReader

  ImageReader object (to obtain image header informations).

### m_colorSpace

    protected ColorSpace m_colorSpace

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

### m_bitsPerPixel

    protected int m_bitsPerPixel

  Bits per pixel.

### m_bitmaps

    protected byte[] m_bitmaps

  Image data (uncompressed).

### m_bitmapsSize

    protected int m_bitmapsSize

  Image data size.

### m_isTransparent

    protected boolean m_isTransparent

  Image transparency.

### m_transparentColor

    protected PDFColor m_transparentColor

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

Constructor Detail

### AbstractFopImage

    public AbstractFopImage(java.net.URL href)
                     throws FopImageException

  Constructor. Construct a new FopImage object and initialize its default properties:
  - image width
  - image height
  The image data isn't kept in memory.
  Parameters:
    `href` - image URL
  Throws:
    FopImageException - an error occured during initialization

### AbstractFopImage

    public AbstractFopImage(java.net.URL href,
                            ImageReader imgReader)
                     throws FopImageException

  Constructor. Construct a new FopImage object and initialize its default properties:
  - image width
  - image height
  The image data isn't kept in memory.
  Parameters:
    `href` - image URL imgReader ImageReader object
  Throws:
    FopImageException - an error occured during initialization

Method Detail

### loadImage

    protected abstract void loadImage()
                               throws FopImageException

  Load image data and initialize its properties. Subclasses need to implement this method.
  Throws:
    FopImageException - an error occured during loading

### getURL

    public java.lang.String getURL()

  Return the image URL.
  Specified by:
    getURL in interface FopImage
  Returns:
    the image URL (as String)

### getWidth

    public int getWidth()
                 throws FopImageException

  Return the image width.
  Specified by:
    getWidth in interface FopImage
  Returns:
    the image width
  Throws:
    FopImageException - an error occured during property retriaval

### getHeight

    public int getHeight()
                  throws FopImageException

  Return the image height.
  Specified by:
    getHeight in interface FopImage
  Returns:
    the image height
  Throws:
    FopImageException - an error occured during property retriaval

### getColorSpace

    public ColorSpace getColorSpace()
                             throws FopImageException

  Return the image color space.
  Specified by:
    getColorSpace in interface FopImage
  Returns:
    the image color space (org.apache.fop.datatypes.ColorSpace)
  Throws:
    FopImageException - an error occured during property retriaval

### getBitsPerPixel

    public int getBitsPerPixel()
                        throws FopImageException

  Return the number of bits per pixel.
  Specified by:
    getBitsPerPixel in interface FopImage
  Returns:
    number of bits per pixel
  Throws:
    FopImageException - an error occured during property retriaval

### isTransparent

    public boolean isTransparent()
                          throws FopImageException

  Return the image transparency.
  Specified by:
    isTransparent in interface FopImage
  Returns:
    true if the image is transparent
  Throws:
    FopImageException - an error occured during property retriaval

### getTransparentColor

    public PDFColor getTransparentColor()
                                 throws FopImageException

  Return the transparent color.
  Specified by:
    getTransparentColor in interface FopImage
  Returns:
    the transparent color (org.apache.fop.pdf.PDFColor)
  Throws:
    FopImageException - an error occured during property retriaval

### getBitmaps

    public byte[] getBitmaps()
                      throws FopImageException

  Return the image data (uncompressed).
  Specified by:
    getBitmaps in interface FopImage
  Returns:
    the image data
  Throws:
    FopImageException - an error occured during loading

### getBitmapsSize

    public int getBitmapsSize()
                       throws FopImageException

  Return the image data size (uncompressed).
  Specified by:
    getBitmapsSize in interface FopImage
  Returns:
    the image data size
  Throws:
    FopImageException - an error occured during loading

### getRessourceBytes

    public byte[] getRessourceBytes()
                             throws FopImageException

  Return the original image data (compressed).
  Specified by:
    getRessourceBytes in interface FopImage
  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).
  Specified by:
    getRessourceBytesSize in interface FopImage
  Returns:
    the original image data size
  Throws:
    FopImageException - an error occured during loading

### getPDFFilter

    public PDFFilter getPDFFilter()
                           throws FopImageException

  Return the original image compression type.
  Specified by:
    getPDFFilter in interface FopImage
  Returns:
    the original image compression type (org.apache.fop.pdf.PDFFilter)
  Throws:
    FopImageException - an error occured during loading

### close

    public void close()

  Free all ressource.
  Specified by:
    close in interface FopImage

Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.