< prev index next >

src/java.desktop/share/classes/java/awt/image/ImageConsumer.java

Print this page


   1 /*
   2  * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 141      * size of the rectangle of source pixels that are contained in
 142      * the array of pixels.  The specified ColorModel object should
 143      * be used to convert the pixels into their corresponding color
 144      * and alpha components.  Pixel (m,n) is stored in the pixels array
 145      * at index (n * scansize + m + off).  The pixels delivered using
 146      * this method are all stored as bytes.
 147      * @param x the X coordinate of the upper-left corner of the
 148      *        area of pixels to be set
 149      * @param y the Y coordinate of the upper-left corner of the
 150      *        area of pixels to be set
 151      * @param w the width of the area of pixels
 152      * @param h the height of the area of pixels
 153      * @param model the specified {@code ColorModel}
 154      * @param pixels the array of pixels
 155      * @param off the offset into the {@code pixels} array
 156      * @param scansize the distance from one row of pixels to the next in
 157      * the {@code pixels} array
 158      * @see ColorModel
 159      */
 160     void setPixels(int x, int y, int w, int h,
 161                    ColorModel model, byte pixels[], int off, int scansize);
 162 
 163     /**
 164      * The pixels of the image are delivered using one or more calls
 165      * to the setPixels method.  Each call specifies the location and
 166      * size of the rectangle of source pixels that are contained in
 167      * the array of pixels.  The specified ColorModel object should
 168      * be used to convert the pixels into their corresponding color
 169      * and alpha components.  Pixel (m,n) is stored in the pixels array
 170      * at index (n * scansize + m + off).  The pixels delivered using
 171      * this method are all stored as ints.
 172      * this method are all stored as ints.
 173      * @param x the X coordinate of the upper-left corner of the
 174      *        area of pixels to be set
 175      * @param y the Y coordinate of the upper-left corner of the
 176      *        area of pixels to be set
 177      * @param w the width of the area of pixels
 178      * @param h the height of the area of pixels
 179      * @param model the specified {@code ColorModel}
 180      * @param pixels the array of pixels
 181      * @param off the offset into the {@code pixels} array
 182      * @param scansize the distance from one row of pixels to the next in
 183      * the {@code pixels} array
 184      * @see ColorModel
 185      */
 186     void setPixels(int x, int y, int w, int h,
 187                    ColorModel model, int pixels[], int off, int scansize);
 188 
 189     /**
 190      * The imageComplete method is called when the ImageProducer is
 191      * finished delivering all of the pixels that the source image
 192      * contains, or when a single frame of a multi-frame animation has
 193      * been completed, or when an error in loading or producing the
 194      * image has occurred.  The ImageConsumer should remove itself from the
 195      * list of consumers registered with the ImageProducer at this time,
 196      * unless it is interested in successive frames.
 197      * @param status the status of image loading
 198      * @see ImageProducer#removeConsumer
 199      */
 200     void imageComplete(int status);
 201 
 202     /**
 203      * An error was encountered while producing the image.
 204      * @see #imageComplete
 205      */
 206     int IMAGEERROR = 1;
 207 
   1 /*
   2  * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 141      * size of the rectangle of source pixels that are contained in
 142      * the array of pixels.  The specified ColorModel object should
 143      * be used to convert the pixels into their corresponding color
 144      * and alpha components.  Pixel (m,n) is stored in the pixels array
 145      * at index (n * scansize + m + off).  The pixels delivered using
 146      * this method are all stored as bytes.
 147      * @param x the X coordinate of the upper-left corner of the
 148      *        area of pixels to be set
 149      * @param y the Y coordinate of the upper-left corner of the
 150      *        area of pixels to be set
 151      * @param w the width of the area of pixels
 152      * @param h the height of the area of pixels
 153      * @param model the specified {@code ColorModel}
 154      * @param pixels the array of pixels
 155      * @param off the offset into the {@code pixels} array
 156      * @param scansize the distance from one row of pixels to the next in
 157      * the {@code pixels} array
 158      * @see ColorModel
 159      */
 160     void setPixels(int x, int y, int w, int h,
 161                    ColorModel model, byte[] pixels, int off, int scansize);
 162 
 163     /**
 164      * The pixels of the image are delivered using one or more calls
 165      * to the setPixels method.  Each call specifies the location and
 166      * size of the rectangle of source pixels that are contained in
 167      * the array of pixels.  The specified ColorModel object should
 168      * be used to convert the pixels into their corresponding color
 169      * and alpha components.  Pixel (m,n) is stored in the pixels array
 170      * at index (n * scansize + m + off).  The pixels delivered using
 171      * this method are all stored as ints.
 172      * this method are all stored as ints.
 173      * @param x the X coordinate of the upper-left corner of the
 174      *        area of pixels to be set
 175      * @param y the Y coordinate of the upper-left corner of the
 176      *        area of pixels to be set
 177      * @param w the width of the area of pixels
 178      * @param h the height of the area of pixels
 179      * @param model the specified {@code ColorModel}
 180      * @param pixels the array of pixels
 181      * @param off the offset into the {@code pixels} array
 182      * @param scansize the distance from one row of pixels to the next in
 183      * the {@code pixels} array
 184      * @see ColorModel
 185      */
 186     void setPixels(int x, int y, int w, int h,
 187                    ColorModel model, int[] pixels, int off, int scansize);
 188 
 189     /**
 190      * The imageComplete method is called when the ImageProducer is
 191      * finished delivering all of the pixels that the source image
 192      * contains, or when a single frame of a multi-frame animation has
 193      * been completed, or when an error in loading or producing the
 194      * image has occurred.  The ImageConsumer should remove itself from the
 195      * list of consumers registered with the ImageProducer at this time,
 196      * unless it is interested in successive frames.
 197      * @param status the status of image loading
 198      * @see ImageProducer#removeConsumer
 199      */
 200     void imageComplete(int status);
 201 
 202     /**
 203      * An error was encountered while producing the image.
 204      * @see #imageComplete
 205      */
 206     int IMAGEERROR = 1;
 207 
< prev index next >