fop 0.94

org.apache.fop.image
Class FopImageConsumer

java.lang.Object
  extended by org.apache.fop.image.FopImageConsumer
All Implemented Interfaces:
java.awt.image.ImageConsumer

public class FopImageConsumer
extends java.lang.Object
implements java.awt.image.ImageConsumer

ImageConsumer implementation for FopImage classes.

Author:
Eric SCHAEFFER

Field Summary
protected  java.awt.image.ColorModel cm
          Color model
protected  int height
          Image height in pixels
protected  int hints
          hints
protected  java.lang.Integer imageStatus
          Image status
protected  java.awt.image.ImageProducer ip
          Image producer
protected  java.util.Hashtable properties
          Image properties
protected  int width
          Image width in pixels
 
Fields inherited from interface java.awt.image.ImageConsumer
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT
 
Constructor Summary
FopImageConsumer(java.awt.image.ImageProducer iprod)
          Main constructor
 
Method Summary
 java.awt.image.ColorModel getColorModel()
          Returns the color model of the image
 int getHeight()
          Returns the image height
 int[] getImage()
          Returns the bitmap as an array.
 int getWidth()
          Returns the image width
 void imageComplete(int status)
           
 boolean isImageReady()
          Indicates whether the image is ready.
 void setColorModel(java.awt.image.ColorModel model)
           
 void setDimensions(int width, int height)
           
 void setHints(int hintflags)
           
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int off, int scansize)
           
 void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int off, int scansize)
           
 void setProperties(java.util.Hashtable props)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

protected int width
Image width in pixels


height

protected int height
Image height in pixels


imageStatus

protected java.lang.Integer imageStatus
Image status


hints

protected int hints
hints


properties

protected java.util.Hashtable properties
Image properties


cm

protected java.awt.image.ColorModel cm
Color model


ip

protected java.awt.image.ImageProducer ip
Image producer

Constructor Detail

FopImageConsumer

public FopImageConsumer(java.awt.image.ImageProducer iprod)
Main constructor

Parameters:
iprod - ImageProducer to use
Method Detail

imageComplete

public void imageComplete(int status)
Specified by:
imageComplete in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.imageComplete(int)

setColorModel

public void setColorModel(java.awt.image.ColorModel model)
Specified by:
setColorModel in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.setColorModel(ColorModel)

setDimensions

public void setDimensions(int width,
                          int height)
Specified by:
setDimensions in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.setDimensions(int, int)

setHints

public void setHints(int hintflags)
Specified by:
setHints in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.setHints(int)

setProperties

public void setProperties(java.util.Hashtable props)
Specified by:
setProperties in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.setProperties(Hashtable)

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      java.awt.image.ColorModel model,
                      byte[] pixels,
                      int off,
                      int scansize)
Specified by:
setPixels in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.setPixels(int, int, int, int, ColorModel, byte[], int, int)

setPixels

public void setPixels(int x,
                      int y,
                      int w,
                      int h,
                      java.awt.image.ColorModel model,
                      int[] pixels,
                      int off,
                      int scansize)
Specified by:
setPixels in interface java.awt.image.ImageConsumer
See Also:
ImageConsumer.setPixels(int, int, int, int, ColorModel, int[], int, int)

isImageReady

public boolean isImageReady()
                     throws java.lang.Exception
Indicates whether the image is ready.

Returns:
boolean True if the image is ready, false if it's still loading
Throws:
java.lang.Exception - If an error happened while loading the image

getWidth

public int getWidth()
Returns the image width

Returns:
the width in pixels

getHeight

public int getHeight()
Returns the image height

Returns:
the height in pixels

getColorModel

public java.awt.image.ColorModel getColorModel()
Returns the color model of the image

Returns:
the color model

getImage

public int[] getImage()
               throws java.lang.Exception
Returns the bitmap as an array.

Returns:
the bitmap as an array.
Throws:
java.lang.Exception - if an error occured while generating the array

fop 0.94

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