01: /*
02: * $RCSfile: TileEncoderFactory.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.1 $
09: * $Date: 2005/02/11 04:57:56 $
10: * $State: Exp $
11: */package javax.media.jai.tilecodec;
12:
13: import java.awt.image.SampleModel;
14: import java.io.OutputStream;
15: import javax.media.jai.remote.NegotiableCapability;
16:
17: /**
18: * A factory for creating <code>TileEncoder</code>s.
19: *
20: * <p> This class stipulates that the capabilities of the
21: * <code>TileEncoder</code> be specified by implementing the
22: * <code>getEncodingCapability()</code> method.
23: *
24: * @see javax.media.jai.remote.NegotiableCapability
25: *
26: * @since JAI 1.1
27: */
28: public interface TileEncoderFactory {
29:
30: /**
31: * Creates a <code>TileEncoder</code> capable of encoding a
32: * <code>Raster</code> with the specified <code>SampleModel</code>
33: * using the encoding parameters specified via the
34: * <code>TileCodecParameterList</code>, to the given
35: * <code>OutputStream</code>.
36: *
37: * <p> This method can return null if the <code>TileEncoder</code> is not
38: * capable of producing output for the given set of parameters.
39: * For example, if a <code>TileEncoder</code> is only capable of dealing
40: * with a <code>PixelInterleavedSampleModel</code>, and the supplied
41: * <code>SampleModel</code> is not an instance of
42: * <code>PixelInterleavedSampleModel</code>, null should be
43: * returned. The supplied <code>SampleModel</code> should be used to
44: * decide whether it can be encoded by this class, and is not needed
45: * to actually construct a <code>TileEncoder</code>.
46: *
47: * <p> If the supplied <code>TileCodecParameterList</code> is null,
48: * a default <code>TileCodecParameterList</code> from the
49: * <code>TileCodecDescriptor</code> will be used to create the encoder.
50: *
51: * <p>Exceptions thrown by the <code>TileEncoder</code>
52: * will be caught by this method and will not be propagated.
53: *
54: * @param output The <code>OutputStream</code> to write the encoded
55: * data to.
56: * @param paramList The <code>TileCodecParameterList</code> containing
57: * the encoding parameters.
58: * @param sampleModel The <code>SampleModel</code> of the
59: * <code>Raster</code> to be encoded.
60: *
61: * @throws IllegalArgumentException if output is null.
62: * @throws IllegalArgumentException if sampleModel is null.
63: */
64: TileEncoder createEncoder(OutputStream output,
65: TileCodecParameterList paramList, SampleModel sampleModel);
66:
67: /**
68: * Returns the capabilities of this <code>TileEncoder</code> as a
69: * <code>NegotiableCapability</code>.
70: *
71: * @see javax.media.jai.remote.NegotiableCapability
72: */
73: NegotiableCapability getEncodeCapability();
74: }
|