1 /* 2 * @(#)RenderedImageFactory.java 1.10 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 /* ******************************************************************** 9 ********************************************************************** 10 ********************************************************************** 11 *** COPYRIGHT (c) Eastman Kodak Company, 1997 *** 12 *** As an unpublished work pursuant to Title 17 of the United *** 13 *** States Code. All rights reserved. *** 14 ********************************************************************** 15 ********************************************************************** 16 **********************************************************************/ 17 18 package java.awt.image.renderable; 19 import java.awt.image.RenderedImage; 20 import java.awt.RenderingHints; 21 22 /** 23 * The RenderedImageFactory interface (often abbreviated RIF) is 24 * intended to be implemented by classes that wish to act as factories 25 * to produce different renderings, for example by executing a series 26 * of BufferedImageOps on a set of sources, depending on a specific 27 * set of parameters, properties, and rendering hints. 28 */ 29 public interface RenderedImageFactory { 30 31 /** 32 * Creates a RenderedImage representing the results of an imaging 33 * operation (or chain of operations) for a given ParameterBlock and 34 * RenderingHints. The RIF may also query any source images 35 * referenced by the ParameterBlock for their dimensions, 36 * SampleModels, properties, etc., as necessary. 37 * 38 * <p> The create() method can return null if the 39 * RenderedImageFactory is not capable of producing output for the 40 * given set of source images and parameters. For example, if a 41 * RenderedImageFactory is only capable of performing a 3x3 42 * convolution on single-banded image data, and the source image has 43 * multiple bands or the convolution Kernel is 5x5, null should be 44 * returned. 45 * 46 * <p> Hints should be taken into account, but can be ignored. 47 * The created RenderedImage may have a property identified 48 * by the String HINTS_OBSERVED to indicate which RenderingHints 49 * were used to create the image. In addition any RenderedImages 50 * that are obtained via the getSources() method on the created 51 * RenderedImage may have such a property. 52 * 53 * @param paramBlock a ParameterBlock containing sources and parameters 54 * for the RenderedImage to be created. 55 * @param hints a RenderingHints object containing hints. 56 * @return A RenderedImage containing the desired output. 57 */ 58 RenderedImage create(ParameterBlock paramBlock, 59 RenderingHints hints); 60 } 61