EventListener
public interface IIOReadUpdateListener extends EventListener
ImageReader
implementations to notify callers of their image and thumbnail reading methods of pixel updates.Modifier and Type | Method | Description |
---|---|---|
void |
imageUpdate |
Reports that a given region of the image has been updated. |
void |
passComplete |
Reports that the current read operation has completed a progressive pass. |
void |
passStarted |
Reports that the current read operation is about to begin a progressive pass. |
void |
thumbnailPassComplete |
Reports that the current thumbnail read operation has completed a progressive pass. |
void |
thumbnailPassStarted |
Reports that the current thumbnail read operation is about to begin a progressive pass. |
void |
thumbnailUpdate |
Reports that a given region of a thumbnail image has been updated. |
void passStarted(ImageReader source, BufferedImage theImage, int pass, int minPass, int maxPass, int minX, int minY, int periodX, int periodY, int[] bands)
An estimate of the area that will be updated by the pass is indicated by the minX
, minY
, width
, and height
parameters. If the pass is interlaced, that is, it only updates selected rows or columns, the periodX
and periodY
parameters will indicate the degree of subsampling. The set of bands that may be affected is indicated by the value of bands
.
source
- the ImageReader
object calling this method.theImage
- the BufferedImage
being updated.pass
- the number of the pass that is about to begin, starting with 0.minPass
- the index of the first pass that will be decoded.maxPass
- the index of the last pass that will be decoded.minX
- the X coordinate of the leftmost updated column of pixels.minY
- the Y coordinate of the uppermost updated row of pixels.periodX
- the horizontal spacing between updated pixels; a value of 1 means no gaps.periodY
- the vertical spacing between updated pixels; a value of 1 means no gaps.bands
- an array of int
s indicating the set bands that may be updated.void imageUpdate(ImageReader source, BufferedImage theImage, int minX, int minY, int width, int height, int periodX, int periodY, int[] bands)
Note that different image format readers may produce decoded pixels in a variety of different orders. Many readers will produce pixels in a simple top-to-bottom, left-to-right-order, but others may use multiple passes of interlacing, tiling, etc. The sequence of updates may even differ from call to call depending on network speeds, for example. A call to this method does not guarantee that all the specified pixels have actually been updated, only that some activity has taken place within some subregion of the one specified.
The particular ImageReader
implementation may choose how often to provide updates. Each update specifies that a given region of the image has been updated since the last update. A region is described by its spatial bounding box (minX
, minY
, width
, and height
); X and Y subsampling factors (periodX
and periodY
); and a set of updated bands (bands
). For example, the update:
minX = 10 minY = 20 width = 3 height = 4 periodX = 2 periodY = 3 bands = { 1, 3 }would indicate that bands 1 and 3 of the following pixels were updated:
(10, 20) (12, 20) (14, 20) (10, 23) (12, 23) (14, 23) (10, 26) (12, 26) (14, 26) (10, 29) (12, 29) (14, 29)
source
- the ImageReader
object calling this method.theImage
- the BufferedImage
being updated.minX
- the X coordinate of the leftmost updated column of pixels.minY
- the Y coordinate of the uppermost updated row of pixels.width
- the number of updated pixels horizontally.height
- the number of updated pixels vertically.periodX
- the horizontal spacing between updated pixels; a value of 1 means no gaps.periodY
- the vertical spacing between updated pixels; a value of 1 means no gaps.bands
- an array of int
s indicating which bands are being updated.void passComplete(ImageReader source, BufferedImage theImage)
source
- the ImageReader
object calling this method.theImage
- the BufferedImage
being updated.void thumbnailPassStarted(ImageReader source, BufferedImage theThumbnail, int pass, int minPass, int maxPass, int minX, int minY, int periodX, int periodY, int[] bands)
source
- the ImageReader
object calling this method.theThumbnail
- the BufferedImage
thumbnail being updated.pass
- the number of the pass that is about to begin, starting with 0.minPass
- the index of the first pass that will be decoded.maxPass
- the index of the last pass that will be decoded.minX
- the X coordinate of the leftmost updated column of pixels.minY
- the Y coordinate of the uppermost updated row of pixels.periodX
- the horizontal spacing between updated pixels; a value of 1 means no gaps.periodY
- the vertical spacing between updated pixels; a value of 1 means no gaps.bands
- an array of int
s indicating the set bands that may be updated.void thumbnailUpdate(ImageReader source, BufferedImage theThumbnail, int minX, int minY, int width, int height, int periodX, int periodY, int[] bands)
source
- the ImageReader
object calling this method.theThumbnail
- the BufferedImage
thumbnail being updated.minX
- the X coordinate of the leftmost updated column of pixels.minY
- the Y coordinate of the uppermost updated row of pixels.width
- the number of updated pixels horizontally.height
- the number of updated pixels vertically.periodX
- the horizontal spacing between updated pixels; a value of 1 means no gaps.periodY
- the vertical spacing between updated pixels; a value of 1 means no gaps.bands
- an array of int
s indicating which bands are being updated.void thumbnailPassComplete(ImageReader source, BufferedImage theThumbnail)
source
- the ImageReader
object calling this method.theThumbnail
- the BufferedImage
thumbnail being updated.
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/imageio/event/IIOReadUpdateListener.html