01: package org.libtiff.jai.codecimpl;
02:
03: /*
04: * The contents of this file are subject to the JAVA ADVANCED IMAGING
05: * SAMPLE INPUT-OUTPUT CODECS AND WIDGET HANDLING SOURCE CODE License
06: * Version 1.0 (the "License"); You may not use this file except in
07: * compliance with the License. You may obtain a copy of the License at
08: * http://www.sun.com/software/imaging/JAI/index.html
09: *
10: * Software distributed under the License is distributed on an "AS IS"
11: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12: * the License for the specific language governing rights and limitations
13: * under the License.
14: *
15: * The Original Code is JAVA ADVANCED IMAGING SAMPLE INPUT-OUTPUT CODECS
16: * AND WIDGET HANDLING SOURCE CODE.
17: * The Initial Developer of the Original Code is: Sun Microsystems, Inc..
18: * Portions created by: _______________________________________
19: * are Copyright (C): _______________________________________
20: * All Rights Reserved.
21: * Contributor(s): _______________________________________
22: */
23:
24: import java.awt.image.RenderedImage;
25: import java.io.IOException;
26:
27: import org.libtiff.jai.util.JaiI18N;
28:
29: import com.sun.media.jai.codec.ImageDecodeParam;
30: import com.sun.media.jai.codec.SeekableStream;
31: import com.sun.media.jai.codec.TIFFDecodeParam;
32: import com.sun.media.jai.codecimpl.TIFFImageDecoder;
33:
34: /**
35: */
36: public class XTIFFImageDecoder extends TIFFImageDecoder {
37:
38: public XTIFFImageDecoder(SeekableStream input,
39: ImageDecodeParam param) {
40: super (input, param);
41: }
42:
43: public RenderedImage decodeAsRenderedImage(int page)
44: throws IOException {
45: if ((page < 0) || (page >= getNumPages())) {
46: throw new IOException(JaiI18N
47: .getString("XTIFFImageDecoder9"));
48: }
49: return new XTIFFImage(input, (TIFFDecodeParam) param, page);
50: }
51: }
|