|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.image.ImageFilter
com.lizardtech.djvubean.DjVuFilter
public final class DjVuFilter
DjVuFilter objects are used to present a segment of a DjVu image at an arbitrary resolution. In order to keep the code simple, this filter is used on a 1 pixel memory source to wrap into an ImageProducer. This avoids the need to implement low level methods to deal directly with ImageConsumer objects. The animated flag may be used for progressive rendering and scrolling. When animated, up to two additional threads may be used to offload work. The first thread updates the buffered pixels after each progressive update and after move() method calls. The second thread passes the pixels to the ImageConsumer.
Field Summary | |
---|---|
boolean |
animated
True if separate threads may be used. |
protected int |
fullHeight
The full height of the subsampled segment. |
protected int |
fullWidth
The full width of the subsampled segment. |
static java.awt.image.ColorModel |
GRAY_MODEL
Gray Color model. |
DjVuInfo |
info
The DjVuInfo Codec |
DjVuPage |
page
The DjVuPage being displayed. |
protected java.awt.Point |
position
The new position of the upper left corner. |
static java.awt.image.ColorModel |
RGB_MODEL
RGB Color model. |
protected int |
subsample
The current subsample rate. |
protected double |
sx
Horizontal scale factor. |
protected double |
sy
Vertical scale factor. |
Fields inherited from class java.awt.image.ImageFilter |
---|
consumer |
Fields inherited from interface java.awt.image.ImageConsumer |
---|
COMPLETESCANLINES, IMAGEABORTED, IMAGEERROR, RANDOMPIXELORDER, SINGLEFRAME, SINGLEFRAMEDONE, SINGLEPASS, STATICIMAGEDONE, TOPDOWNLEFTRIGHT |
Constructor Summary | |
---|---|
DjVuFilter(java.awt.Rectangle bounds,
java.awt.Dimension pageSize,
DjVuPage page,
boolean animated)
Creates a new instance of DjVuFilter |
Method Summary | |
---|---|
java.awt.Rectangle |
getBounds()
Return the bounding rectangle of the segment. |
java.awt.Image |
getImage(java.awt.Component parent)
Call to lookup, or create an image with the specified parent. |
java.awt.image.ImageProducer |
getImageProducer()
Called to create an ImageProducer which uses this filter. |
java.awt.Dimension |
getSize()
Return the scaled page size. |
void |
move(int x,
int y)
Called to move the upper left hand corner of the image segment. |
protected void |
newPixels()
Called to indicate newPixels are available. |
void |
run()
This is the run method used for all threads. |
void |
setDimensions(int w,
int h)
Called by the image producer to set the image size. |
void |
setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
byte[] pixels,
int off,
int scansize)
Sets the array of pixels from the available GPixmap and fillColor for borders. |
void |
setPixels(int x,
int y,
int w,
int h,
java.awt.image.ColorModel model,
int[] pixels,
int off,
int scansize)
Sets the array of pixels from the available GPixmap and fillColor for borders. |
Methods inherited from class java.awt.image.ImageFilter |
---|
clone, getFilterInstance, imageComplete, resendTopDownLeftRight, setColorModel, setHints, setProperties |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.awt.image.ColorModel RGB_MODEL
public static final java.awt.image.ColorModel GRAY_MODEL
public final DjVuInfo info
public final DjVuPage page
public final boolean animated
protected final java.awt.Point position
protected final int fullHeight
protected final int fullWidth
protected final int subsample
protected final double sx
protected final double sy
Constructor Detail |
---|
public DjVuFilter(java.awt.Rectangle bounds, java.awt.Dimension pageSize, DjVuPage page, boolean animated)
bounds
- The bounding rectangle of the desired segment.pageSize
- The stretched page size.page
- The DjVuPage to render.animated
- True if multiple threads should be used to allow
progressive rendering and move method calls.Method Detail |
---|
public java.awt.Rectangle getBounds()
public void setDimensions(int w, int h)
setDimensions
in interface java.awt.image.ImageConsumer
setDimensions
in class java.awt.image.ImageFilter
w
- ignoredh
- ignoredpublic java.awt.Image getImage(java.awt.Component parent)
parent
- The component to call createImage on.
public java.awt.image.ImageProducer getImageProducer()
public void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, byte[] pixels, int off, int scansize)
setPixels
in interface java.awt.image.ImageConsumer
setPixels
in class java.awt.image.ImageFilter
x
- (ignored)y
- (ignored)w
- (ignored)h
- (ignored)model
- (ignored)pixels
- (ignored)off
- (ignored)scansize
- (ignored)public void setPixels(int x, int y, int w, int h, java.awt.image.ColorModel model, int[] pixels, int off, int scansize)
setPixels
in interface java.awt.image.ImageConsumer
setPixels
in class java.awt.image.ImageFilter
x
- the x-coordinate of the upper-left corner of the region of
pixels (ignored)y
- the y-coordinate of the upper-left corner of the region of
pixels (ignored)w
- the width of the region of pixels (ignored)h
- the height of the region of pixels (ignored)model
- the color model of the input data (ignored)pixels
- the array of pixels (ignored)off
- the offset into the pixel array (ignored)scansize
- the distance from one row of pixels to the next in the
array (ignored)public java.awt.Dimension getSize()
public void move(int x, int y)
x
- Left to right x coordinate.y
- Top down y coordinate.
java.lang.IllegalStateException
- if not animated.public void run()
run
in interface java.lang.Runnable
protected void newPixels()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |