001/* IIOReadUpdateListener.java --
002   Copyright (C) 2004  Free Software Foundation, Inc.
003
004This file is part of GNU Classpath.
005
006GNU Classpath is free software; you can redistribute it and/or modify
007it under the terms of the GNU General Public License as published by
008the Free Software Foundation; either version 2, or (at your option)
009any later version.
010
011GNU Classpath is distributed in the hope that it will be useful, but
012WITHOUT ANY WARRANTY; without even the implied warranty of
013MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014General Public License for more details.
015
016You should have received a copy of the GNU General Public License
017along with GNU Classpath; see the file COPYING.  If not, write to the
018Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
01902110-1301 USA.
020
021Linking this library statically or dynamically with other modules is
022making a combined work based on this library.  Thus, the terms and
023conditions of the GNU General Public License cover the whole
024combination.
025
026As a special exception, the copyright holders of this library give you
027permission to link this library with independent modules to produce an
028executable, regardless of the license terms of these independent
029modules, and to copy and distribute the resulting executable under
030terms of your choice, provided that you also meet, for each linked
031independent module, the terms and conditions of the license of that
032module.  An independent module is a module which is not derived from
033or based on this library.  If you modify this library, you may extend
034this exception to your version of the library, but you are not
035obligated to do so.  If you do not wish to do so, delete this
036exception statement from your version. */
037
038
039package javax.imageio.event;
040
041import java.awt.image.BufferedImage;
042import java.util.EventListener;
043
044import javax.imageio.ImageReader;
045
046public interface IIOReadUpdateListener extends EventListener
047{
048  /**
049   * Reports that a given region of the image has been updated.
050   *
051   * @param source the <code>ImageReader</code> object calling this method
052   * @param image the BufferedImage being updated
053   * @param minX the X coordinate of the leftmost updated column of pixels
054   * @param minY the Y coordinate of the uppermost updated row of pixels
055   * @param width the number of updated pixels horizontally
056   * @param height the number of updated pixels vertically
057   * @param periodX the horizontal spacing between updated pixels; a value of 1 means no gaps
058   * @param periodY the vertical spacing between updated pixels; a value of 1 means no gaps
059   * @param bands an array of <code>int</code>s indicating which bands are being updated
060   */
061  void imageUpdate(ImageReader source, BufferedImage image, int minX,
062                   int minY, int width, int height, int periodX, int periodY,
063                   int[] bands);
064
065  /**
066   * Reports that the current read operation has completed a progressive pass.
067   *
068   * @param source the <code>ImageReader</code> object calling this method
069   * @param image the BufferedImage being updated
070   */
071  void passComplete(ImageReader source, BufferedImage image);
072
073  /**
074   * Reports that the current read operation is about to begin a progressive pass.
075   *
076   * @param source the <code>ImageReader</code> object calling this method
077   * @param image the BufferedImage being updated
078   * @param pass the numer of the pass that is about to begin, starting with 0
079   * @param minPass the index of the first pass that will be decoded
080   * @param maxPass the index of the last pass that will be decoded
081   * @param minX the X coordinate of the leftmost updated column of pixels
082   * @param minY the Y coordinate of the uppermost updated row of pixels
083   * @param periodX the horizontal spacing between updated pixels; a value of 1 means no gaps
084   * @param periodY the vertical spacing between updated pixels; a value of 1 means no gaps
085   * @param bands an array of <code>int</code>s indicating which bands are being updated
086   */
087  void passStarted(ImageReader source, BufferedImage image, int pass,
088                   int minPass, int maxPass, int minX, int minY, int periodX,
089                   int periodY, int[] bands);
090
091  /**
092   * Reports that the current thumbnail read operation has completed a progressive pass.
093   *
094   * @param source the <code>ImageReader</code> object calling this method
095   * @param image the BufferedImage being updated
096   */
097  void thumbnailPassComplete(ImageReader source, BufferedImage image);
098
099  /**
100   * Reports that the current thumbnail read operation is about to begin a progressive pass.
101   *
102   * @param source the <code>ImageReader</code> object calling this method
103   * @param image the BufferedImage being updated
104   * @param pass the numer of the pass that is about to begin, starting with 0
105   * @param minPass the index of the first pass that will be decoded
106   * @param maxPass the index of the last pass that will be decoded
107   * @param minX the X coordinate of the leftmost updated column of pixels
108   * @param minY the Y coordinate of the uppermost updated row of pixels
109   * @param periodX the horizontal spacing between updated pixels; a value of 1 means no gaps
110   * @param periodY the vertical spacing between updated pixels; a value of 1 means no gaps
111   * @param bands an array of <code>int</code>s indicating which bands are being updated
112   */
113  void thumbnailPassStarted(ImageReader source, BufferedImage image, int pass,
114                            int minPass, int maxPass, int minX, int minY,
115                            int periodX, int periodY, int[] bands);
116
117  /**
118   * Reports that a given region of a thumbnail image has been updated.
119   *
120   * @param source the <code>ImageReader</code> object calling this method
121   * @param image the BufferedImage being updated
122   * @param minX the X coordinate of the leftmost updated column of pixels
123   * @param minY the Y coordinate of the uppermost updated row of pixels
124   * @param width the number of updated pixels horizontally
125   * @param height the number of updated pixels vertically
126   * @param periodX the horizontal spacing between updated pixels; a value of 1 means no gaps
127   * @param periodY the vertical spacing between updated pixels; a value of 1 means no gaps
128   * @param bands an array of <code>int</code>s indicating which bands are being updated
129   */
130  void thumbnailUpdate(ImageReader source, BufferedImage image, int minX,
131                       int minY, int width, int height, int periodX,
132                       int periodY, int[] bands);
133}