01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-2006, Geotools Project Managment Committee (PMC)
05: * (C) 2001, Institut de Recherche pour le Développement
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: */
17: package org.geotools.image.io;
18:
19: import java.io.*; // Many imports, including some for javadoc only.
20: import javax.imageio.ImageReader;
21: import javax.imageio.spi.ImageReaderSpi;
22:
23: /**
24: * Base class for simple image decoders. The main simplification provided by this class is to
25: * assume that only one {@linkplain ImageTypeSpecifier image type} is supported (as opposed to
26: * the arbitrary number allowed by the standard {@link ImageReader}) and to provide a default
27: * image type built automatically from a color palette and a range of valid values.
28: * <p>
29: * More specifically, this class provides the following conveniences to implementors:
30: *
31: * <ul>
32: * <li><p>Provides a {@link #getInputStream} method, which returns the {@linkplain #input input}
33: * as an {@link InputStream} for convenience. Different kinds of input like {@linkplain File}
34: * or {@linkplain URL} are automatically handled.</p></li>
35: *
36: * <li><p>Provides default {@link #getNumImages} and {@link #getNumBands} implementations,
37: * which return 1. This default behavior matches simple image formats like flat binary
38: * files or ASCII files. Those methods need to be overrided for more complex image
39: * formats.</p></li>
40: *
41: * <li><p>Provides {@link #checkImageIndex} and {@link #checkBandIndex} convenience methods.
42: * Those methods are invoked by most implementation of public methods. They perform their
43: * checks based on the informations provided by the above-cited {@link #getNumImages} and
44: * {@link #getNumBands} methods.</p></li>
45: *
46: * <li><p>Provides default implementations of {@link #getImageTypes} and {@link #getRawImageType},
47: * which assume that only one {@linkplain ImageTypeSpecifier image type} is supported. The
48: * default image type is created from the informations provided by {@link #getRawDataType}
49: * and {@link #getImageMetadata}.</p></li>
50: *
51: * <li><p>Provides {@link #getStreamMetadata} and {@link #getImageMetadata} default
52: * implementations, which return {@code null} as authorized by the specification.
53: * Note that subclasses should consider returning
54: * {@link org.geotools.image.io.metadata.GeographicMetadata}.</p></li>
55: * </ul>
56: *
57: * Images may be flat binary or ASCII files with no meta-data and no color information.
58: * Their pixel values may be floating point values instead of integers. The default
59: * implementation assumes floating point values and uses a grayscale color space scaled
60: * to fit the range of values. Displaying such an image may be very slow. Consequently,
61: * users who want to display image are encouraged to change data type and color space with
62: * <a href="http://java.sun.com/products/java-media/jai/">Java Advanced Imaging</a>
63: * operators after reading.
64: *
65: * @since 2.1
66: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/coverageio/src/main/java/org/geotools/image/io/SimpleImageReader.java $
67: * @version $Id: SimpleImageReader.java 26161 2007-07-05 14:27:01Z desruisseaux $
68: * @author Martin Desruisseaux
69: *
70: * @deprecated Renamed as {@link StreamImageReader}.
71: */
72: public abstract class SimpleImageReader extends StreamImageReader {
73: /**
74: * Constructs a new image reader.
75: *
76: * @param provider The {@link ImageReaderSpi} that is invoking this constructor,
77: * or {@code null} if none.
78: */
79: protected SimpleImageReader(final ImageReaderSpi provider) {
80: super(provider);
81: }
82: }
|