1 /*
2 * Portions Copyright 1998 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Sun designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 /* ********************************************************************
27 **********************************************************************
28 **********************************************************************
29 *** COPYRIGHT (c) Eastman Kodak Company, 1997 ***
30 *** As an unpublished work pursuant to Title 17 of the United ***
31 *** States Code. All rights reserved. ***
32 **********************************************************************
33 **********************************************************************
34 **********************************************************************/
35
36 package java.awt.image.renderable;
37 import java.awt.image.RenderedImage;
38 import java.awt.RenderingHints;
39
40 /**
41 * The RenderedImageFactory interface (often abbreviated RIF) is
42 * intended to be implemented by classes that wish to act as factories
43 * to produce different renderings, for example by executing a series
44 * of BufferedImageOps on a set of sources, depending on a specific
45 * set of parameters, properties, and rendering hints.
46 */
47 public interface RenderedImageFactory {
48
49 /**
50 * Creates a RenderedImage representing the results of an imaging
51 * operation (or chain of operations) for a given ParameterBlock and
52 * RenderingHints. The RIF may also query any source images
53 * referenced by the ParameterBlock for their dimensions,
54 * SampleModels, properties, etc., as necessary.
55 *
56 * <p> The create() method can return null if the
57 * RenderedImageFactory is not capable of producing output for the
58 * given set of source images and parameters. For example, if a
59 * RenderedImageFactory is only capable of performing a 3x3
60 * convolution on single-banded image data, and the source image has
61 * multiple bands or the convolution Kernel is 5x5, null should be
62 * returned.
63 *
64 * <p> Hints should be taken into account, but can be ignored.
65 * The created RenderedImage may have a property identified
66 * by the String HINTS_OBSERVED to indicate which RenderingHints
67 * were used to create the image. In addition any RenderedImages
68 * that are obtained via the getSources() method on the created
69 * RenderedImage may have such a property.
70 *
71 * @param paramBlock a ParameterBlock containing sources and parameters
72 * for the RenderedImage to be created.
73 * @param hints a RenderingHints object containing hints.
74 * @return A RenderedImage containing the desired output.
75 */
76 RenderedImage create(ParameterBlock paramBlock,
77 RenderingHints hints);
78 }