author | tvaleev |
Thu, 04 Oct 2018 12:40:55 -0700 | |
changeset 52248 | 2e330da7cbf4 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
23010
6dadb192ad81
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents:
19169
diff
changeset
|
2 |
* Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 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 |
* |
|
5506 | 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 |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package java.awt.image; |
|
27 |
||
28 |
/** |
|
29 |
* The interface for objects which can produce the image data for Images. |
|
30 |
* Each image contains an ImageProducer which is used to reconstruct |
|
31 |
* the image whenever it is needed, for example, when a new size of the |
|
32 |
* Image is scaled, or when the width or height of the Image is being |
|
33 |
* requested. |
|
34 |
* |
|
35 |
* @see ImageConsumer |
|
36 |
* |
|
37 |
* @author Jim Graham |
|
38 |
*/ |
|
39 |
public interface ImageProducer { |
|
40 |
/** |
|
35667 | 41 |
* Registers an {@code ImageConsumer} with the |
42 |
* {@code ImageProducer} for access to the image data |
|
43 |
* during a later reconstruction of the {@code Image}. |
|
44 |
* The {@code ImageProducer} may, at its discretion, |
|
2 | 45 |
* start delivering the image data to the consumer |
35667 | 46 |
* using the {@code ImageConsumer} interface immediately, |
2 | 47 |
* or when the next available image reconstruction is triggered |
35667 | 48 |
* by a call to the {@code startProduction} method. |
49 |
* @param ic the specified {@code ImageConsumer} |
|
2 | 50 |
* @see #startProduction |
51 |
*/ |
|
52 |
public void addConsumer(ImageConsumer ic); |
|
53 |
||
54 |
/** |
|
35667 | 55 |
* Determines if a specified {@code ImageConsumer} |
2 | 56 |
* object is currently registered with this |
35667 | 57 |
* {@code ImageProducer} as one of its consumers. |
58 |
* @param ic the specified {@code ImageConsumer} |
|
59 |
* @return {@code true} if the specified |
|
60 |
* {@code ImageConsumer} is registered with |
|
61 |
* this {@code ImageProducer}; |
|
62 |
* {@code false} otherwise. |
|
2 | 63 |
*/ |
64 |
public boolean isConsumer(ImageConsumer ic); |
|
65 |
||
66 |
/** |
|
35667 | 67 |
* Removes the specified {@code ImageConsumer} object |
2 | 68 |
* from the list of consumers currently registered to |
69 |
* receive image data. It is not considered an error |
|
70 |
* to remove a consumer that is not currently registered. |
|
35667 | 71 |
* The {@code ImageProducer} should stop sending data |
2 | 72 |
* to this consumer as soon as is feasible. |
35667 | 73 |
* @param ic the specified {@code ImageConsumer} |
2 | 74 |
*/ |
75 |
public void removeConsumer(ImageConsumer ic); |
|
76 |
||
77 |
/** |
|
35667 | 78 |
* Registers the specified {@code ImageConsumer} object |
2 | 79 |
* as a consumer and starts an immediate reconstruction of |
80 |
* the image data which will then be delivered to this |
|
81 |
* consumer and any other consumer which might have already |
|
82 |
* been registered with the producer. This method differs |
|
83 |
* from the addConsumer method in that a reproduction of |
|
84 |
* the image data should be triggered as soon as possible. |
|
35667 | 85 |
* @param ic the specified {@code ImageConsumer} |
2 | 86 |
* @see #addConsumer |
87 |
*/ |
|
88 |
public void startProduction(ImageConsumer ic); |
|
89 |
||
90 |
/** |
|
35667 | 91 |
* Requests, on behalf of the {@code ImageConsumer}, |
92 |
* that the {@code ImageProducer} attempt to resend |
|
2 | 93 |
* the image data one more time in TOPDOWNLEFTRIGHT order |
94 |
* so that higher quality conversion algorithms which |
|
95 |
* depend on receiving pixels in order can be used to |
|
96 |
* produce a better output version of the image. The |
|
35667 | 97 |
* {@code ImageProducer} is free to |
2 | 98 |
* ignore this call if it cannot resend the data in that |
99 |
* order. If the data can be resent, the |
|
35667 | 100 |
* {@code ImageProducer} should respond by executing |
101 |
* the following minimum set of {@code ImageConsumer} |
|
2 | 102 |
* method calls: |
19169 | 103 |
* <pre>{@code |
2 | 104 |
* ic.setHints(TOPDOWNLEFTRIGHT | < otherhints >); |
105 |
* ic.setPixels(...); // As many times as needed |
|
106 |
* ic.imageComplete(); |
|
19169 | 107 |
* }</pre> |
35667 | 108 |
* @param ic the specified {@code ImageConsumer} |
2 | 109 |
* @see ImageConsumer#setHints |
110 |
*/ |
|
111 |
public void requestTopDownLeftRightResend(ImageConsumer ic); |
|
112 |
} |