The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1 | /* |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 21 | |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 22 | package javax.imageio; |
| 23 | |
| 24 | import javax.imageio.spi.ImageReaderSpi; |
| 25 | import javax.imageio.stream.ImageInputStream; |
| 26 | import javax.imageio.metadata.IIOMetadata; |
| 27 | import javax.imageio.event.IIOReadWarningListener; |
| 28 | import javax.imageio.event.IIOReadProgressListener; |
| 29 | import javax.imageio.event.IIOReadUpdateListener; |
| 30 | import java.util.Locale; |
| 31 | import java.util.List; |
| 32 | import java.util.Iterator; |
| 33 | import java.util.Set; |
| 34 | import java.io.IOException; |
| 35 | import java.awt.image.BufferedImage; |
| 36 | import java.awt.image.Raster; |
| 37 | import java.awt.image.RenderedImage; |
| 38 | import java.awt.*; |
| 39 | |
| 40 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 41 | * 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 48 | */ |
| 49 | public abstract class ImageReader { |
| 50 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 51 | /** |
| 52 | * The originating provider. |
| 53 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 54 | protected ImageReaderSpi originatingProvider; |
| 55 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 56 | /** |
| 57 | * The input object such as ImageInputStream. |
| 58 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 59 | protected Object input; |
| 60 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 61 | /** |
| 62 | * The seek forward only. |
| 63 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 64 | protected boolean seekForwardOnly; |
| 65 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 66 | /** |
| 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 69 | */ |
| 70 | protected boolean ignoreMetadata; |
| 71 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 72 | /** |
| 73 | * The minimum index. |
| 74 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 75 | protected int minIndex; |
| 76 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 77 | /** |
| 78 | * The available locales. |
| 79 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 80 | protected Locale[] availableLocales; |
| 81 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 82 | /** |
| 83 | * The locale. |
| 84 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 85 | protected Locale locale; |
| 86 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 87 | /** |
| 88 | * The list of warning listeners. |
| 89 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 90 | protected List<IIOReadWarningListener> warningListeners; |
| 91 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 92 | /** |
| 93 | * The list of warning locales. |
| 94 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 95 | protected List<Locale> warningLocales; |
| 96 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 97 | /** |
| 98 | * The list of progress listeners. |
| 99 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 100 | protected List<IIOReadProgressListener> progressListeners; |
| 101 | |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 102 | /** |
| 103 | * The list of update listeners. |
| 104 | */ |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 105 | protected List<IIOReadUpdateListener> updateListeners; |
| 106 | |
| 107 | /** |
| 108 | * Instantiates a new ImageReader. |
| 109 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 110 | * @param originatingProvider |
| 111 | * the ImageReaderSpi which instantiates this ImageReader. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 112 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 121 | * @throws IOException |
| 122 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 123 | */ |
| 124 | public String getFormatName() throws IOException { |
| 125 | return originatingProvider.getFormatNames()[0]; |
| 126 | } |
| 127 | |
| 128 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 129 | * Gets the ImageReaderSpi which instantiated this ImageReader. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 130 | * |
| 131 | * @return the ImageReaderSpi. |
| 132 | */ |
| 133 | public ImageReaderSpi getOriginatingProvider() { |
| 134 | return originatingProvider; |
| 135 | } |
| 136 | |
| 137 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 138 | * Sets the specified Object as the input source of this ImageReader. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 139 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 140 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 149 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 165 | * @param input |
| 166 | * the input. |
| 167 | * @return true, if is supported. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 168 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 186 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 192 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 201 | * @param input |
| 202 | * the input source, it can be ImageInputStream or other objects. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 203 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 211 | * @return the input source object such as ImageInputStream, or null. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 212 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 220 | * @return true, if the input source supports only forward reading, false |
| 221 | * otherwise. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 222 | */ |
| 223 | public boolean isSeekForwardOnly() { |
| 224 | return seekForwardOnly; |
| 225 | } |
| 226 | |
| 227 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 228 | * 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 230 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 231 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 234 | */ |
| 235 | public boolean isIgnoringMetadata() { |
| 236 | return ignoreMetadata; |
| 237 | } |
| 238 | |
| 239 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 240 | * Gets the minimum valid index for reading an image, thumbnail, or image |
| 241 | * metadata. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 242 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 243 | * @return the minimum valid index for reading an image, thumbnail, or image |
| 244 | * metadata. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 245 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 262 | * @param locale |
| 263 | * the Locale. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 264 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 281 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 284 | * @return the number of images. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 285 | * @throws IOException |
| 286 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 287 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 293 | * @param imageIndex |
| 294 | * the image index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 295 | * @return the width in pixels. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 296 | * @throws IOException |
| 297 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 298 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 304 | * @param imageIndex |
| 305 | * the image index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 306 | * @return the height in pixels. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 307 | * @throws IOException |
| 308 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 309 | */ |
| 310 | public abstract int getHeight(int imageIndex) throws IOException; |
| 311 | |
| 312 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 313 | * Checks if the storage format of the specified image places an impediment |
| 314 | * on random pixels access or not. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 315 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 316 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 322 | */ |
| 323 | public boolean isRandomAccessEasy(int imageIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 324 | return false; // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 325 | } |
| 326 | |
| 327 | /** |
| 328 | * Gets the aspect ratio (width devided by height) of the image. |
| 329 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 330 | * @param imageIndex |
| 331 | * the image index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 332 | * @return the aspect ratio of the image. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 333 | * @throws IOException |
| 334 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 335 | */ |
| 336 | public float getAspectRatio(int imageIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 337 | return (float)getWidth(imageIndex) / getHeight(imageIndex); |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 338 | } |
| 339 | |
| 340 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 341 | * Gets an ImageTypeSpecifier which indicates the type of the specified |
| 342 | * image. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 343 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 344 | * @param imageIndex |
| 345 | * the image's index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 346 | * @return the ImageTypeSpecifier. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 347 | * @throws IOException |
| 348 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 349 | */ |
| 350 | public ImageTypeSpecifier getRawImageType(int imageIndex) throws IOException { |
| 351 | throw new UnsupportedOperationException("Not implemented yet"); |
| 352 | } |
| 353 | |
| 354 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 355 | * 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 357 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 358 | * @param imageIndex |
| 359 | * the image index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 360 | * @return an Iterator of ImageTypeSpecifier objects. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 361 | * @throws IOException |
| 362 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 363 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 379 | * @throws IOException |
| 380 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 381 | */ |
| 382 | public abstract IIOMetadata getStreamMetadata() throws IOException; |
| 383 | |
| 384 | /** |
| 385 | * Gets an IIOMetadata object for this input source. |
| 386 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 387 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 392 | * @return the IIOMetadata. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 393 | * @throws IOException |
| 394 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 395 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 404 | * @param imageIndex |
| 405 | * the image index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 406 | * @return the IIOMetadata. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 407 | * @throws IOException |
| 408 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 409 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 415 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 422 | * @return the IIOMetadata. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 423 | * @throws IOException |
| 424 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 425 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 426 | public IIOMetadata getImageMetadata(int imageIndex, String formatName, Set<String> nodeNames) |
| 427 | throws IOException { |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 428 | throw new UnsupportedOperationException("Not implemented yet"); |
| 429 | } |
| 430 | |
| 431 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 432 | * Reads the specified image and returns it as a BufferedImage using the |
| 433 | * default ImageReadParam. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 434 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 435 | * @param imageIndex |
| 436 | * the image index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 437 | * @return the BufferedImage. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 438 | * @throws IOException |
| 439 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 440 | */ |
| 441 | public BufferedImage read(int imageIndex) throws IOException { |
| 442 | return read(imageIndex, null); |
| 443 | } |
| 444 | |
| 445 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 446 | * Reads the specified image and returns it as a BufferedImage using the |
| 447 | * specified ImageReadParam. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 448 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 449 | * @param imageIndex |
| 450 | * the image index. |
| 451 | * @param param |
| 452 | * the ImageReadParam. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 453 | * @return the BufferedImage. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 454 | * @throws IOException |
| 455 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 456 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 461 | * thumbnails, and metadata for this image, using the specified |
| 462 | * ImageReadParam. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 463 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 464 | * @param imageIndex |
| 465 | * the image index. |
| 466 | * @param param |
| 467 | * the ImageReadParam. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 468 | * @return the IIOImage. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 469 | * @throws IOException |
| 470 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 471 | */ |
| 472 | public IIOImage readAll(int imageIndex, ImageReadParam param) throws IOException { |
| 473 | throw new UnsupportedOperationException("Not implemented yet"); |
| 474 | } |
| 475 | |
| 476 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 477 | * Returns an Iterator of IIOImages from the input source. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 478 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 479 | * @param params |
| 480 | * the Iterator of ImageReadParam objects. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 481 | * @return the iterator of IIOImages. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 482 | * @throws IOException |
| 483 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 484 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 492 | * @return true, if this plug-in supports reading a Raster, false otherwise. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 493 | */ |
| 494 | public boolean canReadRaster() { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 495 | return false; // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 496 | } |
| 497 | |
| 498 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 499 | * Reads a new Raster object which contains the raw pixel data from the |
| 500 | * image. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 501 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 502 | * @param imageIndex |
| 503 | * the image index. |
| 504 | * @param param |
| 505 | * the ImageReadParam. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 506 | * @return the Raster. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 507 | * @throws IOException |
| 508 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 509 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 517 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 522 | */ |
| 523 | public boolean isImageTiled(int imageIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 524 | return false; // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 525 | } |
| 526 | |
| 527 | /** |
| 528 | * Gets the tile width in the specified image. |
| 529 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 530 | * @param imageIndex |
| 531 | * the image's index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 532 | * @return the tile width. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 533 | * @throws IOException |
| 534 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 535 | */ |
| 536 | public int getTileWidth(int imageIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 537 | return getWidth(imageIndex); // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 538 | } |
| 539 | |
| 540 | /** |
| 541 | * Gets the tile height in the specified image. |
| 542 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 543 | * @param imageIndex |
| 544 | * the image's index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 545 | * @return the tile height. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 546 | * @throws IOException |
| 547 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 548 | */ |
| 549 | public int getTileHeight(int imageIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 550 | return getHeight(imageIndex); // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 551 | } |
| 552 | |
| 553 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 554 | * Gets the X coordinate of the upper left corner of the tile grid in the |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 555 | * specified image. |
| 556 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 557 | * @param imageIndex |
| 558 | * the image's index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 559 | * @return the X coordinate of the upper left corner of the tile grid. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 560 | * @throws IOException |
| 561 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 562 | */ |
| 563 | public int getTileGridXOffset(int imageIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 564 | return 0; // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 565 | } |
| 566 | |
| 567 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 568 | * Gets the Y coordinate of the upper left corner of the tile grid in the |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 569 | * specified image. |
| 570 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 571 | * @param imageIndex |
| 572 | * the image's index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 573 | * @return the Y coordinate of the upper left corner of the tile grid. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 574 | * @throws IOException |
| 575 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 576 | */ |
| 577 | public int getTileGridYOffset(int imageIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 578 | return 0; // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 579 | } |
| 580 | |
| 581 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 582 | * 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 584 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 585 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 591 | * @return the BufferedImage. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 592 | * @throws IOException |
| 593 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 594 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 600 | * 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 602 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 603 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 609 | * @return the Raster. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 610 | * @throws IOException |
| 611 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 612 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 618 | * Reads the specified image using the specified ImageReadParam and returns |
| 619 | * it as a RenderedImage. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 620 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 621 | * @param imageIndex |
| 622 | * the image index. |
| 623 | * @param param |
| 624 | * the ImageReadParam. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 625 | * @return the RenderedImage. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 626 | * @throws IOException |
| 627 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 628 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 629 | public RenderedImage readAsRenderedImage(int imageIndex, ImageReadParam param) |
| 630 | throws IOException { |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 631 | return read(imageIndex, param); |
| 632 | } |
| 633 | |
| 634 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 635 | * Returns true if the image format supported by this reader supports |
| 636 | * thumbnail preview images. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 637 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 638 | * @return true, if the image format supported by this reader supports |
| 639 | * thumbnail preview images, false otherwise. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 640 | */ |
| 641 | public boolean readerSupportsThumbnails() { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 642 | return false; // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 643 | } |
| 644 | |
| 645 | /** |
| 646 | * Checks if the specified image has thumbnails or not. |
| 647 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 648 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 653 | */ |
| 654 | public boolean hasThumbnails(int imageIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 655 | return getNumThumbnails(imageIndex) > 0; // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 656 | } |
| 657 | |
| 658 | /** |
| 659 | * Gets the number of thumbnails for the specified image. |
| 660 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 661 | * @param imageIndex |
| 662 | * the image's index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 663 | * @return the number of thumbnails. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 664 | * @throws IOException |
| 665 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 666 | */ |
| 667 | public int getNumThumbnails(int imageIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 668 | return 0; // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 669 | } |
| 670 | |
| 671 | /** |
| 672 | * Gets the width of the specified thumbnail for the specified image. |
| 673 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 674 | * @param imageIndex |
| 675 | * the image's index. |
| 676 | * @param thumbnailIndex |
| 677 | * the thumbnail's index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 678 | * @return the thumbnail width. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 679 | * @throws IOException |
| 680 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 681 | */ |
| 682 | public int getThumbnailWidth(int imageIndex, int thumbnailIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 683 | return readThumbnail(imageIndex, thumbnailIndex).getWidth(); // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 684 | } |
| 685 | |
| 686 | /** |
| 687 | * Gets the height of the specified thumbnail for the specified image. |
| 688 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 689 | * @param imageIndex |
| 690 | * the image's index. |
| 691 | * @param thumbnailIndex |
| 692 | * the thumbnail's index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 693 | * @return the thumbnail height. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 694 | * @throws IOException |
| 695 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 696 | */ |
| 697 | public int getThumbnailHeight(int imageIndex, int thumbnailIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 698 | return readThumbnail(imageIndex, thumbnailIndex).getHeight(); // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 699 | } |
| 700 | |
| 701 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 702 | * Reads the thumbnail image for the specified image as a BufferedImage. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 703 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 704 | * @param imageIndex |
| 705 | * the image index. |
| 706 | * @param thumbnailIndex |
| 707 | * the thumbnail index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 708 | * @return the BufferedImage. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 709 | * @throws IOException |
| 710 | * if an I/O exception has occurred. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 711 | */ |
| 712 | public BufferedImage readThumbnail(int imageIndex, int thumbnailIndex) throws IOException { |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 713 | throw new UnsupportedOperationException("Unsupported"); // def |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 714 | } |
| 715 | |
| 716 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 717 | * Requests an abort operation for current reading operation. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 718 | */ |
| 719 | public void abort() { |
| 720 | throw new UnsupportedOperationException("Not implemented yet"); |
| 721 | } |
| 722 | |
| 723 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 724 | * Checks whether or not a request to abort the current read operation has |
| 725 | * been made successfully. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 726 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 727 | * @return true, if the request to abort the current read operation has been |
| 728 | * made successfully, false otherwise. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 729 | */ |
| 730 | protected boolean abortRequested() { |
| 731 | throw new UnsupportedOperationException("Not implemented yet"); |
| 732 | } |
| 733 | |
| 734 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 735 | * Clears all previous abort request, and abortRequested returns false after |
| 736 | * calling this method. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 737 | */ |
| 738 | protected void clearAbortRequest() { |
| 739 | throw new UnsupportedOperationException("Not implemented yet"); |
| 740 | } |
| 741 | |
| 742 | /** |
| 743 | * Adds the IIOReadWarningListener. |
| 744 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 745 | * @param listener |
| 746 | * the IIOReadWarningListener. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 747 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 755 | * @param listener |
| 756 | * the IIOReadWarningListener to be removed. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 757 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 772 | * @param listener |
| 773 | * the IIOReadProgressListener. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 774 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 782 | * @param listener |
| 783 | * the IIOReadProgressListener to be removed. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 784 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 799 | * @param listener |
| 800 | * the IIOReadUpdateListener. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 801 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 809 | * @param listener |
| 810 | * the IIOReadUpdateListener to be removed. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 811 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 824 | * Processes the start of an sequence of image reads by calling the |
| 825 | * sequenceStarted method on all registered IIOReadProgressListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 826 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 827 | * @param minIndex |
| 828 | * the minimum index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 829 | */ |
| 830 | protected void processSequenceStarted(int minIndex) { |
| 831 | throw new UnsupportedOperationException("Not implemented yet"); |
| 832 | } |
| 833 | |
| 834 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 835 | * Processes the completion of an sequence of image reads by calling |
| 836 | * sequenceComplete method on all registered IIOReadProgressListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 837 | */ |
| 838 | protected void processSequenceComplete() { |
| 839 | throw new UnsupportedOperationException("Not implemented yet"); |
| 840 | } |
| 841 | |
| 842 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 843 | * Processes the start of an image read by calling the imageStarted method |
| 844 | * on all registered IIOReadProgressListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 845 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 846 | * @param imageIndex |
| 847 | * the image index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 848 | */ |
| 849 | protected void processImageStarted(int imageIndex) { |
| 850 | throw new UnsupportedOperationException("Not implemented yet"); |
| 851 | } |
| 852 | |
| 853 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 854 | * Processes the current percentage of image completion by calling the |
| 855 | * imageProgress method on all registered IIOReadProgressListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 856 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 857 | * @param percentageDone |
| 858 | * the percentage done. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 859 | */ |
| 860 | protected void processImageProgress(float percentageDone) { |
| 861 | throw new UnsupportedOperationException("Not implemented yet"); |
| 862 | } |
| 863 | |
| 864 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 865 | * Processes image completion by calling the imageComplete method on all |
| 866 | * registered IIOReadProgressListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 867 | */ |
| 868 | protected void processImageComplete() { |
| 869 | throw new UnsupportedOperationException("Not implemented yet"); |
| 870 | } |
| 871 | |
| 872 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 873 | * Processes the start of a thumbnail read by calling the thumbnailStarted |
| 874 | * method on all registered IIOReadProgressListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 875 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 876 | * @param imageIndex |
| 877 | * the image index. |
| 878 | * @param thumbnailIndex |
| 879 | * the thumbnail index. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 880 | */ |
| 881 | protected void processThumbnailStarted(int imageIndex, int thumbnailIndex) { |
| 882 | throw new UnsupportedOperationException("Not implemented yet"); |
| 883 | } |
| 884 | |
| 885 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 886 | * Processes the current percentage of thumbnail completion by calling the |
| 887 | * thumbnailProgress method on all registered IIOReadProgressListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 888 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 889 | * @param percentageDone |
| 890 | * the percentage done. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 891 | */ |
| 892 | protected void processThumbnailProgress(float percentageDone) { |
| 893 | throw new UnsupportedOperationException("Not implemented yet"); |
| 894 | } |
| 895 | |
| 896 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 897 | * Processes the completion of a thumbnail read by calling the |
| 898 | * thumbnailComplete method on all registered IIOReadProgressListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 899 | */ |
| 900 | protected void processThumbnailComplete() { |
| 901 | throw new UnsupportedOperationException("Not implemented yet"); |
| 902 | } |
| 903 | |
| 904 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 905 | * Processes a read aborted event by calling the readAborted method on all |
| 906 | * registered IIOReadProgressListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 907 | */ |
| 908 | protected void processReadAborted() { |
| 909 | throw new UnsupportedOperationException("Not implemented yet"); |
| 910 | } |
| 911 | |
| 912 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 913 | * Processes the beginning of a progressive pass by calling the passStarted |
| 914 | * method on all registered IIOReadUpdateListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 915 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 916 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 934 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 935 | 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 937 | throw new UnsupportedOperationException("Not implemented yet"); |
| 938 | } |
| 939 | |
| 940 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 941 | * Processes the update of a set of samples by calling the imageUpdate |
| 942 | * method on all registered IIOReadUpdateListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 943 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 944 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 960 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 961 | protected void processImageUpdate(BufferedImage theImage, int minX, int minY, int width, |
| 962 | int height, int periodX, int periodY, int[] bands) { |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 963 | throw new UnsupportedOperationException("Not implemented yet"); |
| 964 | } |
| 965 | |
| 966 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 967 | * Processes the end of a progressive pass by calling passComplete method of |
| 968 | * registered IIOReadUpdateListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 969 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 970 | * @param theImage |
| 971 | * the image to be updated. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 972 | */ |
| 973 | protected void processPassComplete(BufferedImage theImage) { |
| 974 | throw new UnsupportedOperationException("Not implemented yet"); |
| 975 | } |
| 976 | |
| 977 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 978 | * Processes the beginning of a thumbnail progressive pass by calling the |
| 979 | * thumbnailPassStarted method on all registered IIOReadUpdateListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 980 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 981 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 999 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1000 | 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1002 | throw new UnsupportedOperationException("Not implemented yet"); |
| 1003 | } |
| 1004 | |
| 1005 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1006 | * 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1008 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1009 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1025 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1026 | protected void processThumbnailUpdate(BufferedImage theThumbnail, int minX, int minY, |
| 1027 | int width, int height, int periodX, int periodY, int[] bands) { |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1028 | throw new UnsupportedOperationException("Not implemented yet"); |
| 1029 | } |
| 1030 | |
| 1031 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1032 | * Processes the end of a thumbnail progressive pass by calling the |
| 1033 | * thumbnailPassComplete method on all registered IIOReadUpdateListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1034 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1035 | * @param theThumbnail |
| 1036 | * the thumbnail to be updated. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1037 | */ |
| 1038 | protected void processThumbnailPassComplete(BufferedImage theThumbnail) { |
| 1039 | throw new UnsupportedOperationException("Not implemented yet"); |
| 1040 | } |
| 1041 | |
| 1042 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1043 | * Processes a warning message by calling warningOccurred method of |
| 1044 | * registered IIOReadWarningListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1045 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1046 | * @param warning |
| 1047 | * the warning. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1048 | */ |
| 1049 | protected void processWarningOccurred(String warning) { |
| 1050 | throw new UnsupportedOperationException("Not implemented yet"); |
| 1051 | } |
| 1052 | |
| 1053 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1054 | * Processes a warning by calling the warningOccurred method of on all |
| 1055 | * registered IIOReadWarningListeners. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1056 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1057 | * @param baseName |
| 1058 | * the base name of ResourceBundles. |
| 1059 | * @param keyword |
| 1060 | * the keyword to index the warning among ResourceBundles. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1061 | */ |
| 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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1087 | * Gets the region of source image that should be read with the specified |
| 1088 | * width, height and ImageReadParam. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1089 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1090 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1096 | * @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 Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1103 | * 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1106 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1107 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1119 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1120 | protected static void computeRegions(ImageReadParam param, int srcWidth, int srcHeight, |
| 1121 | BufferedImage image, Rectangle srcRegion, Rectangle destRegion) { |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1122 | throw new UnsupportedOperationException("Not implemented yet"); |
| 1123 | } |
| 1124 | |
| 1125 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1126 | * 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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1129 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1130 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1136 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1137 | protected static void checkReadParamBandSettings(ImageReadParam param, int numSrcBands, |
| 1138 | int numDstBands) { |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1139 | throw new UnsupportedOperationException("Not implemented yet"); |
| 1140 | } |
| 1141 | |
| 1142 | /** |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1143 | * Gets the destination image where the decoded data is written. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1144 | * |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1145 | * @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 Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1153 | * @return the BufferedImage where decoded pixels should be written. |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1154 | * @throws IIOException |
| 1155 | * the IIOException is thrown if there is no suitable |
| 1156 | * ImageTypeSpecifier. |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1157 | */ |
The Android Open Source Project | f013e1a | 2008-12-17 18:05:43 -0800 | [diff] [blame] | 1158 | protected static BufferedImage getDestination(ImageReadParam param, |
| 1159 | Iterator<ImageTypeSpecifier> imageTypes, int width, int height) throws IIOException { |
The Android Open Source Project | 54b6cfa | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1160 | throw new UnsupportedOperationException("Not implemented yet"); |
| 1161 | } |
| 1162 | } |