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