01: /*
02: * $RCSfile: FPXImageDecoder.java,v $
03: *
04: * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
05: *
06: * Use is subject to license terms.
07: *
08: * $Revision: 1.2 $
09: * $Date: 2006/08/22 00:12:04 $
10: * $State: Exp $
11: */
12: package com.sun.media.jai.codecimpl;
13:
14: import java.awt.image.RenderedImage;
15: import java.io.InputStream;
16: import java.io.IOException;
17: import com.sun.media.jai.codec.FPXDecodeParam;
18: import com.sun.media.jai.codec.ImageDecoder;
19: import com.sun.media.jai.codec.ImageDecodeParam;
20: import com.sun.media.jai.codec.ImageDecoderImpl;
21: import com.sun.media.jai.codec.SeekableStream;
22: import com.sun.media.jai.codecimpl.fpx.FPXImage;
23:
24: /**
25: * @since EA3
26: */
27: public class FPXImageDecoder extends ImageDecoderImpl {
28:
29: public FPXImageDecoder(SeekableStream input, ImageDecodeParam param) {
30: super (input, param);
31: }
32:
33: public RenderedImage decodeAsRenderedImage(int page)
34: throws IOException {
35: if (page != 0) {
36: throw new IOException(JaiI18N.getString("FPXImageDecoder0"));
37: }
38: try {
39: return new FPXImage(input, (FPXDecodeParam) param);
40: } catch (Exception e) {
41: throw CodecUtils.toIOException(e);
42: }
43: }
44: }
|