blob: cf282ed2a82af99793653b9eb6c39a12e57a5006 [file] [log] [blame]
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001/*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17/**
18 * @author Rustem V. Rafikov
19 * @version $Revision: 1.3 $
20 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080021
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070022package javax.imageio;
23
24import javax.imageio.spi.ImageReaderSpi;
25import javax.imageio.stream.ImageInputStream;
26import javax.imageio.metadata.IIOMetadata;
27import javax.imageio.event.IIOReadWarningListener;
28import javax.imageio.event.IIOReadProgressListener;
29import javax.imageio.event.IIOReadUpdateListener;
30import java.util.Locale;
31import java.util.List;
32import java.util.Iterator;
33import java.util.Set;
34import java.io.IOException;
35import java.awt.image.BufferedImage;
36import java.awt.image.Raster;
37import java.awt.image.RenderedImage;
38import java.awt.*;
39
40/**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080041 * The ImageReader class is an abstract class for decoding images. ImageReader
42 * objects are instantiated by the service provider interface, ImageReaderSpi
43 * class, for the specific format. ImageReaderSpi class should be registered
44 * with the IIORegistry, which uses them for format recognition and presentation
45 * of available format readers and writers.
46 *
47 * @since Android 1.0
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070048 */
49public abstract class ImageReader {
50
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080051 /**
52 * The originating provider.
53 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070054 protected ImageReaderSpi originatingProvider;
55
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080056 /**
57 * The input object such as ImageInputStream.
58 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070059 protected Object input;
60
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080061 /**
62 * The seek forward only.
63 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070064 protected boolean seekForwardOnly;
65
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080066 /**
67 * The ignore metadata flag indicates whether current input source has been
68 * marked as metadata is allowed to be ignored by setInput.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070069 */
70 protected boolean ignoreMetadata;
71
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080072 /**
73 * The minimum index.
74 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070075 protected int minIndex;
76
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080077 /**
78 * The available locales.
79 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070080 protected Locale[] availableLocales;
81
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080082 /**
83 * The locale.
84 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070085 protected Locale locale;
86
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080087 /**
88 * The list of warning listeners.
89 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070090 protected List<IIOReadWarningListener> warningListeners;
91
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080092 /**
93 * The list of warning locales.
94 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -070095 protected List<Locale> warningLocales;
96
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -080097 /**
98 * The list of progress listeners.
99 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700100 protected List<IIOReadProgressListener> progressListeners;
101
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800102 /**
103 * The list of update listeners.
104 */
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700105 protected List<IIOReadUpdateListener> updateListeners;
106
107 /**
108 * Instantiates a new ImageReader.
109 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800110 * @param originatingProvider
111 * the ImageReaderSpi which instantiates this ImageReader.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700112 */
113 protected ImageReader(ImageReaderSpi originatingProvider) {
114 this.originatingProvider = originatingProvider;
115 }
116
117 /**
118 * Gets the format name of this input source.
119 *
120 * @return the format name of this input source.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800121 * @throws IOException
122 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700123 */
124 public String getFormatName() throws IOException {
125 return originatingProvider.getFormatNames()[0];
126 }
127
128 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800129 * Gets the ImageReaderSpi which instantiated this ImageReader.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700130 *
131 * @return the ImageReaderSpi.
132 */
133 public ImageReaderSpi getOriginatingProvider() {
134 return originatingProvider;
135 }
136
137 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800138 * Sets the specified Object as the input source of this ImageReader.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700139 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800140 * @param input
141 * the input source, it can be an ImageInputStream or other
142 * supported objects.
143 * @param seekForwardOnly
144 * indicates whether the stream must be read sequentially from
145 * its current starting point.
146 * @param ignoreMetadata
147 * parameter which indicates if metadata may be ignored during
148 * reads or not.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700149 */
150 public void setInput(Object input, boolean seekForwardOnly, boolean ignoreMetadata) {
151 if (input != null) {
152 if (!isSupported(input) && !(input instanceof ImageInputStream)) {
153 throw new IllegalArgumentException("input " + input + " is not supported");
154 }
155 }
156 this.minIndex = 0;
157 this.seekForwardOnly = seekForwardOnly;
158 this.ignoreMetadata = ignoreMetadata;
159 this.input = input;
160 }
161
162 /**
163 * Checks if is supported.
164 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800165 * @param input
166 * the input.
167 * @return true, if is supported.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700168 */
169 private boolean isSupported(Object input) {
170 ImageReaderSpi spi = getOriginatingProvider();
171 if (null != spi) {
172 Class[] outTypes = spi.getInputTypes();
173 for (Class<?> element : outTypes) {
174 if (element.isInstance(input)) {
175 return true;
176 }
177 }
178 }
179 return false;
180 }
181
182 /**
183 * Sets the specified Object as the input source of this ImageReader.
184 * Metadata is not ignored.
185 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800186 * @param input
187 * the input source, it can be an ImageInputStream or other
188 * supported objects.
189 * @param seekForwardOnly
190 * indicates whether the stream must be read sequentially from
191 * its current starting point.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700192 */
193 public void setInput(Object input, boolean seekForwardOnly) {
194 setInput(input, seekForwardOnly, false);
195 }
196
197 /**
198 * Sets the specified Object as the input source of this ImageReader.
199 * Metadata is not ignored and forward seeking is not required.
200 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800201 * @param input
202 * the input source, it can be ImageInputStream or other objects.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700203 */
204 public void setInput(Object input) {
205 setInput(input, false, false);
206 }
207
208 /**
209 * Gets the input source object of this ImageReader, or returns null.
210 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800211 * @return the input source object such as ImageInputStream, or null.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700212 */
213 public Object getInput() {
214 return input;
215 }
216
217 /**
218 * Checks if the input source supports only forward reading, or not.
219 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800220 * @return true, if the input source supports only forward reading, false
221 * otherwise.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700222 */
223 public boolean isSeekForwardOnly() {
224 return seekForwardOnly;
225 }
226
227 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800228 * Returns true if the current input source allows to metadata to be ignored
229 * by passing true as the ignoreMetadata argument to the setInput method.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700230 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800231 * @return true, if the current input source allows to metadata to be
232 * ignored by passing true as the ignoreMetadata argument to the
233 * setInput method.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700234 */
235 public boolean isIgnoringMetadata() {
236 return ignoreMetadata;
237 }
238
239 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800240 * Gets the minimum valid index for reading an image, thumbnail, or image
241 * metadata.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700242 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800243 * @return the minimum valid index for reading an image, thumbnail, or image
244 * metadata.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700245 */
246 public int getMinIndex() {
247 return minIndex;
248 }
249
250 /**
251 * Gets the available locales.
252 *
253 * @return an array of the available locales.
254 */
255 public Locale[] getAvailableLocales() {
256 return availableLocales;
257 }
258
259 /**
260 * Sets the locale to this ImageReader.
261 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800262 * @param locale
263 * the Locale.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700264 */
265 public void setLocale(Locale locale) {
266 throw new UnsupportedOperationException("Not implemented yet");
267 }
268
269 /**
270 * Gets the locale of this ImageReader.
271 *
272 * @return the locale of this ImageReader.
273 */
274 public Locale getLocale() {
275 return locale;
276 }
277
278 /**
279 * Gets the number of images available in the current input source.
280 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800281 * @param allowSearch
282 * the parameter which indicates what a search is required; if
283 * false, the reader may return -1 without searching.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700284 * @return the number of images.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800285 * @throws IOException
286 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700287 */
288 public abstract int getNumImages(boolean allowSearch) throws IOException;
289
290 /**
291 * Gets the width of the specified image in input source.
292 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800293 * @param imageIndex
294 * the image index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700295 * @return the width in pixels.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800296 * @throws IOException
297 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700298 */
299 public abstract int getWidth(int imageIndex) throws IOException;
300
301 /**
302 * Gets the height of the specified image in input source.
303 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800304 * @param imageIndex
305 * the image index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700306 * @return the height in pixels.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800307 * @throws IOException
308 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700309 */
310 public abstract int getHeight(int imageIndex) throws IOException;
311
312 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800313 * Checks if the storage format of the specified image places an impediment
314 * on random pixels access or not.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700315 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800316 * @param imageIndex
317 * the image's index.
318 * @return true, if the storage format of the specified image places an
319 * impediment on random pixels access, false otherwise.
320 * @throws IOException
321 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700322 */
323 public boolean isRandomAccessEasy(int imageIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800324 return false; // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700325 }
326
327 /**
328 * Gets the aspect ratio (width devided by height) of the image.
329 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800330 * @param imageIndex
331 * the image index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700332 * @return the aspect ratio of the image.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800333 * @throws IOException
334 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700335 */
336 public float getAspectRatio(int imageIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800337 return (float)getWidth(imageIndex) / getHeight(imageIndex);
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700338 }
339
340 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800341 * Gets an ImageTypeSpecifier which indicates the type of the specified
342 * image.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700343 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800344 * @param imageIndex
345 * the image's index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700346 * @return the ImageTypeSpecifier.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800347 * @throws IOException
348 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700349 */
350 public ImageTypeSpecifier getRawImageType(int imageIndex) throws IOException {
351 throw new UnsupportedOperationException("Not implemented yet");
352 }
353
354 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800355 * Gets an Iterator of ImageTypeSpecifier objects which are associated with
356 * image types that may be used when decoding specified image.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700357 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800358 * @param imageIndex
359 * the image index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700360 * @return an Iterator of ImageTypeSpecifier objects.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800361 * @throws IOException
362 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700363 */
364 public abstract Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex) throws IOException;
365
366 /**
367 * Gets the default ImageReadParam object.
368 *
369 * @return the ImageReadParam object.
370 */
371 public ImageReadParam getDefaultReadParam() {
372 throw new UnsupportedOperationException("Not implemented yet");
373 }
374
375 /**
376 * Gets an IIOMetadata object for this input source.
377 *
378 * @return the IIOMetadata.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800379 * @throws IOException
380 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700381 */
382 public abstract IIOMetadata getStreamMetadata() throws IOException;
383
384 /**
385 * Gets an IIOMetadata object for this input source.
386 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800387 * @param formatName
388 * the desired metadata format to be used in the returned
389 * IIOMetadata object.
390 * @param nodeNames
391 * the node names of the document.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700392 * @return the IIOMetadata.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800393 * @throws IOException
394 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700395 */
396 public IIOMetadata getStreamMetadata(String formatName, Set<String> nodeNames)
397 throws IOException {
398 throw new UnsupportedOperationException("Not implemented yet");
399 }
400
401 /**
402 * Gets the image metadata of the specified image in input source.
403 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800404 * @param imageIndex
405 * the image index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700406 * @return the IIOMetadata.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800407 * @throws IOException
408 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700409 */
410 public abstract IIOMetadata getImageMetadata(int imageIndex) throws IOException;
411
412 /**
413 * Gets the image metadata of the specified image input source.
414 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800415 * @param imageIndex
416 * the image index.
417 * @param formatName
418 * the desired metadata format to be used in the returned
419 * IIOMetadata object.
420 * @param nodeNames
421 * the node names which can be contained in the document.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700422 * @return the IIOMetadata.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800423 * @throws IOException
424 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700425 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800426 public IIOMetadata getImageMetadata(int imageIndex, String formatName, Set<String> nodeNames)
427 throws IOException {
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700428 throw new UnsupportedOperationException("Not implemented yet");
429 }
430
431 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800432 * Reads the specified image and returns it as a BufferedImage using the
433 * default ImageReadParam.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700434 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800435 * @param imageIndex
436 * the image index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700437 * @return the BufferedImage.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800438 * @throws IOException
439 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700440 */
441 public BufferedImage read(int imageIndex) throws IOException {
442 return read(imageIndex, null);
443 }
444
445 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800446 * Reads the specified image and returns it as a BufferedImage using the
447 * specified ImageReadParam.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700448 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800449 * @param imageIndex
450 * the image index.
451 * @param param
452 * the ImageReadParam.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700453 * @return the BufferedImage.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800454 * @throws IOException
455 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700456 */
457 public abstract BufferedImage read(int imageIndex, ImageReadParam param) throws IOException;
458
459 /**
460 * Reads the specified image and returns an IIOImage with this image,
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800461 * thumbnails, and metadata for this image, using the specified
462 * ImageReadParam.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700463 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800464 * @param imageIndex
465 * the image index.
466 * @param param
467 * the ImageReadParam.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700468 * @return the IIOImage.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800469 * @throws IOException
470 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700471 */
472 public IIOImage readAll(int imageIndex, ImageReadParam param) throws IOException {
473 throw new UnsupportedOperationException("Not implemented yet");
474 }
475
476 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800477 * Returns an Iterator of IIOImages from the input source.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700478 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800479 * @param params
480 * the Iterator of ImageReadParam objects.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700481 * @return the iterator of IIOImages.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800482 * @throws IOException
483 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700484 */
485 public Iterator<IIOImage> readAll(Iterator<? extends ImageReadParam> params) throws IOException {
486 throw new UnsupportedOperationException("Not implemented yet");
487 }
488
489 /**
490 * Checks whether or not this plug-in supports reading a Raster.
491 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800492 * @return true, if this plug-in supports reading a Raster, false otherwise.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700493 */
494 public boolean canReadRaster() {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800495 return false; // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700496 }
497
498 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800499 * Reads a new Raster object which contains the raw pixel data from the
500 * image.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700501 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800502 * @param imageIndex
503 * the image index.
504 * @param param
505 * the ImageReadParam.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700506 * @return the Raster.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800507 * @throws IOException
508 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700509 */
510 public Raster readRaster(int imageIndex, ImageReadParam param) throws IOException {
511 throw new UnsupportedOperationException("Unsupported");
512 }
513
514 /**
515 * Checks if the specified image has tiles or not.
516 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800517 * @param imageIndex
518 * the image's index.
519 * @return true, if the specified image has tiles, false otherwise.
520 * @throws IOException
521 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700522 */
523 public boolean isImageTiled(int imageIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800524 return false; // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700525 }
526
527 /**
528 * Gets the tile width in the specified image.
529 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800530 * @param imageIndex
531 * the image's index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700532 * @return the tile width.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800533 * @throws IOException
534 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700535 */
536 public int getTileWidth(int imageIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800537 return getWidth(imageIndex); // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700538 }
539
540 /**
541 * Gets the tile height in the specified image.
542 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800543 * @param imageIndex
544 * the image's index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700545 * @return the tile height.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800546 * @throws IOException
547 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700548 */
549 public int getTileHeight(int imageIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800550 return getHeight(imageIndex); // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700551 }
552
553 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800554 * Gets the X coordinate of the upper left corner of the tile grid in the
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700555 * specified image.
556 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800557 * @param imageIndex
558 * the image's index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700559 * @return the X coordinate of the upper left corner of the tile grid.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800560 * @throws IOException
561 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700562 */
563 public int getTileGridXOffset(int imageIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800564 return 0; // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700565 }
566
567 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800568 * Gets the Y coordinate of the upper left corner of the tile grid in the
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700569 * specified image.
570 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800571 * @param imageIndex
572 * the image's index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700573 * @return the Y coordinate of the upper left corner of the tile grid.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800574 * @throws IOException
575 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700576 */
577 public int getTileGridYOffset(int imageIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800578 return 0; // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700579 }
580
581 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800582 * Reads the tile specified by the tileX and tileY parameters of the
583 * specified image and returns it as a BufferedImage.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700584 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800585 * @param imageIndex
586 * the image index.
587 * @param tileX
588 * the X index of tile.
589 * @param tileY
590 * the Y index of tile.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700591 * @return the BufferedImage.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800592 * @throws IOException
593 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700594 */
595 public BufferedImage readTile(int imageIndex, int tileX, int tileY) throws IOException {
596 throw new UnsupportedOperationException("Not implemented yet");
597 }
598
599 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800600 * Reads the tile specified by the tileX and tileY parameters of the
601 * specified image and returns it as a Raster.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700602 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800603 * @param imageIndex
604 * the image index.
605 * @param tileX
606 * the X index of tile.
607 * @param tileY
608 * the Y index of tile.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700609 * @return the Raster.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800610 * @throws IOException
611 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700612 */
613 public Raster readTileRaster(int imageIndex, int tileX, int tileY) throws IOException {
614 throw new UnsupportedOperationException("Not implemented yet");
615 }
616
617 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800618 * Reads the specified image using the specified ImageReadParam and returns
619 * it as a RenderedImage.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700620 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800621 * @param imageIndex
622 * the image index.
623 * @param param
624 * the ImageReadParam.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700625 * @return the RenderedImage.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800626 * @throws IOException
627 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700628 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800629 public RenderedImage readAsRenderedImage(int imageIndex, ImageReadParam param)
630 throws IOException {
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700631 return read(imageIndex, param);
632 }
633
634 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800635 * Returns true if the image format supported by this reader supports
636 * thumbnail preview images.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700637 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800638 * @return true, if the image format supported by this reader supports
639 * thumbnail preview images, false otherwise.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700640 */
641 public boolean readerSupportsThumbnails() {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800642 return false; // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700643 }
644
645 /**
646 * Checks if the specified image has thumbnails or not.
647 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800648 * @param imageIndex
649 * the image's index.
650 * @return true, if the specified image has thumbnails, false otherwise.
651 * @throws IOException
652 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700653 */
654 public boolean hasThumbnails(int imageIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800655 return getNumThumbnails(imageIndex) > 0; // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700656 }
657
658 /**
659 * Gets the number of thumbnails for the specified image.
660 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800661 * @param imageIndex
662 * the image's index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700663 * @return the number of thumbnails.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800664 * @throws IOException
665 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700666 */
667 public int getNumThumbnails(int imageIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800668 return 0; // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700669 }
670
671 /**
672 * Gets the width of the specified thumbnail for the specified image.
673 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800674 * @param imageIndex
675 * the image's index.
676 * @param thumbnailIndex
677 * the thumbnail's index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700678 * @return the thumbnail width.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800679 * @throws IOException
680 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700681 */
682 public int getThumbnailWidth(int imageIndex, int thumbnailIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800683 return readThumbnail(imageIndex, thumbnailIndex).getWidth(); // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700684 }
685
686 /**
687 * Gets the height of the specified thumbnail for the specified image.
688 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800689 * @param imageIndex
690 * the image's index.
691 * @param thumbnailIndex
692 * the thumbnail's index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700693 * @return the thumbnail height.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800694 * @throws IOException
695 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700696 */
697 public int getThumbnailHeight(int imageIndex, int thumbnailIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800698 return readThumbnail(imageIndex, thumbnailIndex).getHeight(); // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700699 }
700
701 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800702 * Reads the thumbnail image for the specified image as a BufferedImage.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700703 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800704 * @param imageIndex
705 * the image index.
706 * @param thumbnailIndex
707 * the thumbnail index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700708 * @return the BufferedImage.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800709 * @throws IOException
710 * if an I/O exception has occurred.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700711 */
712 public BufferedImage readThumbnail(int imageIndex, int thumbnailIndex) throws IOException {
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800713 throw new UnsupportedOperationException("Unsupported"); // def
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700714 }
715
716 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800717 * Requests an abort operation for current reading operation.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700718 */
719 public void abort() {
720 throw new UnsupportedOperationException("Not implemented yet");
721 }
722
723 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800724 * Checks whether or not a request to abort the current read operation has
725 * been made successfully.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700726 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800727 * @return true, if the request to abort the current read operation has been
728 * made successfully, false otherwise.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700729 */
730 protected boolean abortRequested() {
731 throw new UnsupportedOperationException("Not implemented yet");
732 }
733
734 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800735 * Clears all previous abort request, and abortRequested returns false after
736 * calling this method.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700737 */
738 protected void clearAbortRequest() {
739 throw new UnsupportedOperationException("Not implemented yet");
740 }
741
742 /**
743 * Adds the IIOReadWarningListener.
744 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800745 * @param listener
746 * the IIOReadWarningListener.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700747 */
748 public void addIIOReadWarningListener(IIOReadWarningListener listener) {
749 throw new UnsupportedOperationException("Not implemented yet");
750 }
751
752 /**
753 * Removes the specified IIOReadWarningListener.
754 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800755 * @param listener
756 * the IIOReadWarningListener to be removed.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700757 */
758 public void removeIIOReadWarningListener(IIOReadWarningListener listener) {
759 throw new UnsupportedOperationException("Not implemented yet");
760 }
761
762 /**
763 * Removes all registered IIOReadWarningListeners.
764 */
765 public void removeAllIIOReadWarningListeners() {
766 throw new UnsupportedOperationException("Not implemented yet");
767 }
768
769 /**
770 * Adds the IIOReadProgressListener.
771 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800772 * @param listener
773 * the IIOReadProgressListener.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700774 */
775 public void addIIOReadProgressListener(IIOReadProgressListener listener) {
776 throw new UnsupportedOperationException("Not implemented yet");
777 }
778
779 /**
780 * Removes the specified IIOReadProgressListener.
781 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800782 * @param listener
783 * the IIOReadProgressListener to be removed.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700784 */
785 public void removeIIOReadProgressListener(IIOReadProgressListener listener) {
786 throw new UnsupportedOperationException("Not implemented yet");
787 }
788
789 /**
790 * Removes registered IIOReadProgressListeners.
791 */
792 public void removeAllIIOReadProgressListeners() {
793 throw new UnsupportedOperationException("Not implemented yet");
794 }
795
796 /**
797 * Adds the IIOReadUpdateListener.
798 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800799 * @param listener
800 * the IIOReadUpdateListener.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700801 */
802 public void addIIOReadUpdateListener(IIOReadUpdateListener listener) {
803 throw new UnsupportedOperationException("Not implemented yet");
804 }
805
806 /**
807 * Removes the specified IIOReadUpdateListener.
808 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800809 * @param listener
810 * the IIOReadUpdateListener to be removed.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700811 */
812 public void removeIIOReadUpdateListener(IIOReadUpdateListener listener) {
813 throw new UnsupportedOperationException("Not implemented yet");
814 }
815
816 /**
817 * Removes registered IIOReadUpdateListeners.
818 */
819 public void removeAllIIOReadUpdateListeners() {
820 throw new UnsupportedOperationException("Not implemented yet");
821 }
822
823 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800824 * Processes the start of an sequence of image reads by calling the
825 * sequenceStarted method on all registered IIOReadProgressListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700826 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800827 * @param minIndex
828 * the minimum index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700829 */
830 protected void processSequenceStarted(int minIndex) {
831 throw new UnsupportedOperationException("Not implemented yet");
832 }
833
834 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800835 * Processes the completion of an sequence of image reads by calling
836 * sequenceComplete method on all registered IIOReadProgressListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700837 */
838 protected void processSequenceComplete() {
839 throw new UnsupportedOperationException("Not implemented yet");
840 }
841
842 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800843 * Processes the start of an image read by calling the imageStarted method
844 * on all registered IIOReadProgressListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700845 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800846 * @param imageIndex
847 * the image index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700848 */
849 protected void processImageStarted(int imageIndex) {
850 throw new UnsupportedOperationException("Not implemented yet");
851 }
852
853 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800854 * Processes the current percentage of image completion by calling the
855 * imageProgress method on all registered IIOReadProgressListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700856 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800857 * @param percentageDone
858 * the percentage done.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700859 */
860 protected void processImageProgress(float percentageDone) {
861 throw new UnsupportedOperationException("Not implemented yet");
862 }
863
864 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800865 * Processes image completion by calling the imageComplete method on all
866 * registered IIOReadProgressListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700867 */
868 protected void processImageComplete() {
869 throw new UnsupportedOperationException("Not implemented yet");
870 }
871
872 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800873 * Processes the start of a thumbnail read by calling the thumbnailStarted
874 * method on all registered IIOReadProgressListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700875 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800876 * @param imageIndex
877 * the image index.
878 * @param thumbnailIndex
879 * the thumbnail index.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700880 */
881 protected void processThumbnailStarted(int imageIndex, int thumbnailIndex) {
882 throw new UnsupportedOperationException("Not implemented yet");
883 }
884
885 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800886 * Processes the current percentage of thumbnail completion by calling the
887 * thumbnailProgress method on all registered IIOReadProgressListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700888 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800889 * @param percentageDone
890 * the percentage done.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700891 */
892 protected void processThumbnailProgress(float percentageDone) {
893 throw new UnsupportedOperationException("Not implemented yet");
894 }
895
896 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800897 * Processes the completion of a thumbnail read by calling the
898 * thumbnailComplete method on all registered IIOReadProgressListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700899 */
900 protected void processThumbnailComplete() {
901 throw new UnsupportedOperationException("Not implemented yet");
902 }
903
904 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800905 * Processes a read aborted event by calling the readAborted method on all
906 * registered IIOReadProgressListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700907 */
908 protected void processReadAborted() {
909 throw new UnsupportedOperationException("Not implemented yet");
910 }
911
912 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800913 * Processes the beginning of a progressive pass by calling the passStarted
914 * method on all registered IIOReadUpdateListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700915 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800916 * @param theImage
917 * the image to be updated.
918 * @param pass
919 * the current pass index.
920 * @param minPass
921 * the minimum pass index.
922 * @param maxPass
923 * the maximum pass index.
924 * @param minX
925 * the X coordinate of of the upper left pixel.
926 * @param minY
927 * the Y coordinate of of the upper left pixel.
928 * @param periodX
929 * the horizontal separation between pixels.
930 * @param periodY
931 * the vertical separation between pixels.
932 * @param bands
933 * the number of affected bands.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700934 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800935 protected void processPassStarted(BufferedImage theImage, int pass, int minPass, int maxPass,
936 int minX, int minY, int periodX, int periodY, int[] bands) {
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700937 throw new UnsupportedOperationException("Not implemented yet");
938 }
939
940 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800941 * Processes the update of a set of samples by calling the imageUpdate
942 * method on all registered IIOReadUpdateListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700943 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800944 * @param theImage
945 * the image to be updated.
946 * @param minX
947 * the X coordinate of the upper left pixel.
948 * @param minY
949 * the Y coordinate of the upper left pixel.
950 * @param width
951 * the width of updated area.
952 * @param height
953 * the height of updated area.
954 * @param periodX
955 * the horizontal separation between pixels.
956 * @param periodY
957 * the vertical separation between pixels.
958 * @param bands
959 * the number of affected bands.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700960 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800961 protected void processImageUpdate(BufferedImage theImage, int minX, int minY, int width,
962 int height, int periodX, int periodY, int[] bands) {
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700963 throw new UnsupportedOperationException("Not implemented yet");
964 }
965
966 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800967 * Processes the end of a progressive pass by calling passComplete method of
968 * registered IIOReadUpdateListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700969 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800970 * @param theImage
971 * the image to be updated.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700972 */
973 protected void processPassComplete(BufferedImage theImage) {
974 throw new UnsupportedOperationException("Not implemented yet");
975 }
976
977 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800978 * Processes the beginning of a thumbnail progressive pass by calling the
979 * thumbnailPassStarted method on all registered IIOReadUpdateListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700980 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -0800981 * @param theThumbnail
982 * the thumbnail to be updated.
983 * @param pass
984 * the current pass index.
985 * @param minPass
986 * the minimum pass index.
987 * @param maxPass
988 * the maximum pass index.
989 * @param minX
990 * the X coordinate of the upper left pixel.
991 * @param minY
992 * the Y coordinate of the upper left pixel.
993 * @param periodX
994 * the horizontal separation between pixels.
995 * @param periodY
996 * the vertical separation between pixels.
997 * @param bands
998 * the number of affected bands.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -0700999 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001000 protected void processThumbnailPassStarted(BufferedImage theThumbnail, int pass, int minPass,
1001 int maxPass, int minX, int minY, int periodX, int periodY, int[] bands) {
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001002 throw new UnsupportedOperationException("Not implemented yet");
1003 }
1004
1005 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001006 * Processes the update of a set of samples in a thumbnail image by calling
1007 * the thumbnailUpdate method on all registered IIOReadUpdateListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001008 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001009 * @param theThumbnail
1010 * the thumbnail to be updated.
1011 * @param minX
1012 * the X coordinate of the upper left pixel.
1013 * @param minY
1014 * the Y coordinate of the upper left pixel.
1015 * @param width
1016 * the total width of the updated area.
1017 * @param height
1018 * the total height of the updated area.
1019 * @param periodX
1020 * the horizontal separation between pixels.
1021 * @param periodY
1022 * the vertical separation between pixels.
1023 * @param bands
1024 * the number of affected bands.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001025 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001026 protected void processThumbnailUpdate(BufferedImage theThumbnail, int minX, int minY,
1027 int width, int height, int periodX, int periodY, int[] bands) {
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001028 throw new UnsupportedOperationException("Not implemented yet");
1029 }
1030
1031 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001032 * Processes the end of a thumbnail progressive pass by calling the
1033 * thumbnailPassComplete method on all registered IIOReadUpdateListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001034 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001035 * @param theThumbnail
1036 * the thumbnail to be updated.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001037 */
1038 protected void processThumbnailPassComplete(BufferedImage theThumbnail) {
1039 throw new UnsupportedOperationException("Not implemented yet");
1040 }
1041
1042 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001043 * Processes a warning message by calling warningOccurred method of
1044 * registered IIOReadWarningListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001045 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001046 * @param warning
1047 * the warning.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001048 */
1049 protected void processWarningOccurred(String warning) {
1050 throw new UnsupportedOperationException("Not implemented yet");
1051 }
1052
1053 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001054 * Processes a warning by calling the warningOccurred method of on all
1055 * registered IIOReadWarningListeners.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001056 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001057 * @param baseName
1058 * the base name of ResourceBundles.
1059 * @param keyword
1060 * the keyword to index the warning among ResourceBundles.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001061 */
1062 protected void processWarningOccurred(String baseName, String keyword) {
1063 throw new UnsupportedOperationException("Not implemented yet");
1064 }
1065
1066 /**
1067 * Resets this ImageReader.
1068 */
1069 public void reset() {
1070 // def
1071 setInput(null, false);
1072 setLocale(null);
1073 removeAllIIOReadUpdateListeners();
1074 removeAllIIOReadWarningListeners();
1075 removeAllIIOReadProgressListeners();
1076 clearAbortRequest();
1077 }
1078
1079 /**
1080 * Disposes of any resources.
1081 */
1082 public void dispose() {
1083 // do nothing by def
1084 }
1085
1086 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001087 * Gets the region of source image that should be read with the specified
1088 * width, height and ImageReadParam.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001089 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001090 * @param param
1091 * the ImageReadParam object, or null.
1092 * @param srcWidth
1093 * the source image's width.
1094 * @param srcHeight
1095 * the source image's height.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001096 * @return the Rectangle of source region.
1097 */
1098 protected static Rectangle getSourceRegion(ImageReadParam param, int srcWidth, int srcHeight) {
1099 throw new UnsupportedOperationException("Not implemented yet");
1100 }
1101
1102 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001103 * Computes the specified source region and the specified destination region
1104 * with the specified the width and height of the source image, an optional
1105 * destination image, and an ImageReadParam.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001106 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001107 * @param param
1108 * the an ImageReadParam object, or null.
1109 * @param srcWidth
1110 * the source image's width.
1111 * @param srcHeight
1112 * the source image's height.
1113 * @param image
1114 * the destination image.
1115 * @param srcRegion
1116 * the source region.
1117 * @param destRegion
1118 * the destination region.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001119 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001120 protected static void computeRegions(ImageReadParam param, int srcWidth, int srcHeight,
1121 BufferedImage image, Rectangle srcRegion, Rectangle destRegion) {
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001122 throw new UnsupportedOperationException("Not implemented yet");
1123 }
1124
1125 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001126 * Checks the validity of the source and destination band and is called when
1127 * the reader knows the number of bands of the source image and the number
1128 * of bands of the destination image.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001129 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001130 * @param param
1131 * the ImageReadParam for reading the Image.
1132 * @param numSrcBands
1133 * the number of bands in the source.
1134 * @param numDstBands
1135 * the number of bands in the destination.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001136 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001137 protected static void checkReadParamBandSettings(ImageReadParam param, int numSrcBands,
1138 int numDstBands) {
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001139 throw new UnsupportedOperationException("Not implemented yet");
1140 }
1141
1142 /**
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001143 * Gets the destination image where the decoded data is written.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001144 *
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001145 * @param param
1146 * the ImageReadParam.
1147 * @param imageTypes
1148 * the iterator of ImageTypeSpecifier objects.
1149 * @param width
1150 * the width of the image being decoded.
1151 * @param height
1152 * the height of the image being decoded.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001153 * @return the BufferedImage where decoded pixels should be written.
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001154 * @throws IIOException
1155 * the IIOException is thrown if there is no suitable
1156 * ImageTypeSpecifier.
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001157 */
The Android Open Source Projectf013e1a2008-12-17 18:05:43 -08001158 protected static BufferedImage getDestination(ImageReadParam param,
1159 Iterator<ImageTypeSpecifier> imageTypes, int width, int height) throws IIOException {
The Android Open Source Project54b6cfa2008-10-21 07:00:00 -07001160 throw new UnsupportedOperationException("Not implemented yet");
1161 }
1162}