01: /*
02: * $RCSfile: MinCRIF.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:56:34 $
10: * $State: Exp $
11: */
12: package com.sun.media.jai.opimage;
13:
14: import java.awt.RenderingHints;
15: import java.awt.image.RenderedImage;
16: import java.awt.image.renderable.ParameterBlock;
17: import java.awt.image.renderable.RenderedImageFactory;
18: import javax.media.jai.CRIFImpl;
19: import javax.media.jai.ImageLayout;
20: import java.util.Map;
21:
22: /**
23: * A <code>CRIF</code> supporting the "Min" operation in the
24: * rendered and renderable image layer.
25: *
26: * @see javax.media.jai.operator.MinDescriptor
27: * @see MinOpImage
28: *
29: */
30: public class MinCRIF extends CRIFImpl {
31:
32: /** Constructor. */
33: public MinCRIF() {
34: super ("min");
35: }
36:
37: /**
38: * Creates a new instance of <code>MinOpImage</code> in the rendered
39: * layer. This method satisfies the implementation of RIF.
40: *
41: * @param paramBlock The two source images from which the minimum
42: * pixel values are chosen.
43: * @param renderHints Optionally contains destination image layout
44: * and tile cache.
45: */
46: public RenderedImage create(ParameterBlock paramBlock,
47: RenderingHints renderHints) {
48: // Get ImageLayout from renderHints if any.
49: ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
50:
51: return new MinOpImage(paramBlock.getRenderedSource(0),
52: paramBlock.getRenderedSource(1), renderHints, layout);
53: }
54: }
|