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