home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 November / Chip_1998-11_cd.bin / tema / Cafe / main.bin / ImageProducer.java < prev    next >
Text File  |  1997-05-20  |  4KB  |  99 lines

  1. /*
  2.  * @(#)ImageProducer.java    1.11 96/11/23
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. package java.awt.image;
  24.  
  25. /**
  26.  * The interface for objects which can produce the image data for Images.
  27.  * Each image contains an ImageProducer which is used to reconstruct
  28.  * the image whenever it is needed, for example, when a new size of the
  29.  * Image is scaled, or when the width or height of the Image is being
  30.  * requested.
  31.  *
  32.  * @see ImageConsumer
  33.  *
  34.  * @version    1.11 11/23/96
  35.  * @author     Jim Graham
  36.  */
  37. public interface ImageProducer {
  38.     /**
  39.      * This method is used to register an ImageConsumer with the
  40.      * ImageProducer for access to the image data during a later
  41.      * reconstruction of the Image.  The ImageProducer may, at its
  42.      * discretion, start delivering the image data to the consumer
  43.      * using the ImageConsumer interface immediately, or when the
  44.      * next available image reconstruction is triggered by a call
  45.      * to the startProduction method.
  46.      * @see #startProduction
  47.      */
  48.     public void addConsumer(ImageConsumer ic);
  49.  
  50.     /**
  51.      * This method determines if a given ImageConsumer object
  52.      * is currently registered with this ImageProducer as one
  53.      * of its consumers.
  54.      */
  55.     public boolean isConsumer(ImageConsumer ic);
  56.  
  57.     /**
  58.      * This method removes the given ImageConsumer object
  59.      * from the list of consumers currently registered to
  60.      * receive image data.  It is not considered an error
  61.      * to remove a consumer that is not currently registered.
  62.      * The ImageProducer should stop sending data to this
  63.      * consumer as soon as is feasible.
  64.      */
  65.     public void removeConsumer(ImageConsumer ic);
  66.  
  67.     /**
  68.      * This method both registers the given ImageConsumer object
  69.      * as a consumer and starts an immediate reconstruction of
  70.      * the image data which will then be delivered to this
  71.      * consumer and any other consumer which may have already
  72.      * been registered with the producer.  This method differs
  73.      * from the addConsumer method in that a reproduction of
  74.      * the image data should be triggered as soon as possible.
  75.      * @see #addConsumer
  76.      */
  77.     public void startProduction(ImageConsumer ic);
  78.  
  79.     /**
  80.      * This method is used by an ImageConsumer to request that
  81.      * the ImageProducer attempt to resend the image data one
  82.      * more time in TOPDOWNLEFTRIGHT order so that higher
  83.      * quality conversion algorithms which depend on receiving
  84.      * pixels in order can be used to produce a better output
  85.      * version of the image.  The ImageProducer is free to
  86.      * ignore this call if it cannot resend the data in that
  87.      * order.  If the data can be resent, then the ImageProducer
  88.      * should respond by executing the following minimum set of
  89.      * ImageConsumer method calls:
  90.      * <pre>
  91.      *    ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >);
  92.      *    ic.setPixels(...);    // As many times as needed
  93.      *    ic.imageComplete();
  94.      * </pre>
  95.      * @see ImageConsumer#setHints
  96.      */
  97.     public void requestTopDownLeftRightResend(ImageConsumer ic);
  98. }
  99.