01: /*
02: * $RCSfile: ColorModelFactory.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:06 $
10: * $State: Exp $
11: */
12: package javax.media.jai;
13:
14: import java.awt.image.ColorModel;
15: import java.awt.image.SampleModel;
16: import java.util.List;
17: import java.util.Map;
18: import java.util.Vector;
19:
20: /**
21: * Interface defining a callback which may be used to create a
22: * <code>ColorModel</code> for the rendering of a node in an
23: * operation chain. The value corresponding to the key
24: * {@link JAI#KEY_COLOR_MODEL_FACTORY} in a configuration
25: * mapping must be of type <code>ColorModelFactory</code>. This
26: * configuration variable is recognized by the constructor
27: * {@link OpImage#OpImage(Vector,ImageLayout,Map,boolean)}.
28: *
29: * @since JAI 1.1.2
30: */
31: public interface ColorModelFactory {
32: /**
33: * Create a <code>ColorModel</code> given the image
34: * <code>SampleModel</code> and configuration variables.
35: * When invoked in the context of
36: * {@link OpImage#OpImage(Vector,ImageLayout,Map,boolean)},
37: * the <code>SampleModel</code> will be that of the
38: * <code>OpImage</code> and the source list and configuration
39: * mapping will be those which were supplied to the
40: * <code>OpImage</code> constructor.
41: *
42: * <p>The implementing class should in general ensure that the
43: * <code>ColorModel</code> created is compatible with the
44: * supplied <code>SampleModel</code>. If it is known a priori
45: * that compatibility is verified by the object which invokes this
46: * method, then such compatibility verification might be
47: * safely omitted.</p>
48: *
49: * @param sampleModel The <code>SampleModel</code> to which the
50: * <code>ColorModel</code> to be created must correspond;
51: * may <b>not</b> be <code>null</code>.
52: * @param sources A <code>List</code> of <code>RenderedImage</code>s;
53: * may be <code>null</code>.
54: * @param configuration A configuration mapping; may be
55: * <code>null</code>.
56: * @return A new <code>ColorModel</code> or <code>null</code> if it
57: * is not possible for the <code>ColorModelFactory</code>
58: * to create a <code>ColorModel</code> for the supplied
59: * parameters.
60: * @exception IllegalArgumentException if <code>sampleModel</code>
61: * is <code>null</code>.
62: */
63: ColorModel createColorModel(SampleModel sampleModel, List sources,
64: Map configuration);
65: }
|