01: /*
02: * $RCSfile: IDFTCRIF.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:28 $
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.EnumeratedParameter;
20: import javax.media.jai.ImageLayout;
21: import java.util.Map;
22:
23: /**
24: * A <code>CRIF</code> supporting the "IDFT" operation in the rendered
25: * image layer.
26: *
27: * @since Beta
28: * @see javax.media.jai.operator.DFTDescriptor
29: * @see javax.media.jai.operator.IDFTDescriptor
30: *
31: */
32: public class IDFTCRIF extends CRIFImpl {
33:
34: /** Constructor. */
35: public IDFTCRIF() {
36: super ("idft");
37: }
38:
39: /**
40: * Creates a new instance of an IDFT operator according to the scaling
41: * type.
42: *
43: * @param paramBlock The scaling type.
44: */
45: public RenderedImage create(ParameterBlock paramBlock,
46: RenderingHints renderHints) {
47: // Get ImageLayout from renderHints if any.
48: ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
49:
50: RenderedImage source = paramBlock.getRenderedSource(0);
51: EnumeratedParameter scalingType = (EnumeratedParameter) paramBlock
52: .getObjectParameter(0);
53: EnumeratedParameter dataNature = (EnumeratedParameter) paramBlock
54: .getObjectParameter(1);
55:
56: FFT fft = new FFT(false, new Integer(scalingType.getValue()), 2);
57:
58: return new DFTOpImage(source, renderHints, layout, dataNature,
59: fft);
60: }
61: }
|