01: /*
02: * $RCSfile: AndCRIF.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:14 $
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.RenderContext;
17: import java.awt.image.renderable.ParameterBlock;
18: import java.awt.image.renderable.RenderableImage;
19: import javax.media.jai.CRIFImpl;
20: import javax.media.jai.ImageLayout;
21: import java.util.Map;
22:
23: /**
24: * A <code>CRIF</code> supporting the "And" operation in the
25: * rendered and renderable image layers.
26: *
27: * @since EA2
28: * @see javax.media.jai.operator.AndDescriptor
29: * @see AndOpImage
30: *
31: */
32: public class AndCRIF extends CRIFImpl {
33:
34: /** Constructor. */
35: public AndCRIF() {
36: super ("and");
37: }
38:
39: /**
40: * Creates a new instance of <code>AndOpImage</code> in the
41: * rendered layer. This method satisifies the implementation of RIF.
42: *
43: * @param paramBlock The two source images to be "anded" together.
44: * @param renderHints Optionally contains destination image layout.
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 AndOpImage(paramBlock.getRenderedSource(0),
52: paramBlock.getRenderedSource(1), renderHints, layout);
53: }
54: }
|