01: /*
02: * $RCSfile: MlibDCTRIF.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:55:53 $
10: * $State: Exp $
11: */
12: package com.sun.media.jai.mlib;
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.ImageLayout;
19: import java.util.Map;
20: import com.sun.media.jai.opimage.DCTOpImage;
21: import com.sun.media.jai.opimage.FCT;
22: import com.sun.media.jai.opimage.RIFUtil;
23:
24: /**
25: * A <code>RIF</code> supporting the "DCT" operation in the
26: * rendered image mode using MediaLib.
27: *
28: * @see javax.media.jai.operator.DCTDescriptor
29: * @see com.sun.media.jai.opimage.DCTOpImage
30: *
31: * @since EA4
32: *
33: */
34: public class MlibDCTRIF implements RenderedImageFactory {
35:
36: /** Constructor. */
37: public MlibDCTRIF() {
38: }
39:
40: /**
41: * Creates a new instance of <code>DCTOpImage</code> in
42: * the rendered image mode.
43: *
44: * @param args The source image.
45: * @param hints May contain rendering hints and destination image layout.
46: */
47: public RenderedImage create(ParameterBlock args,
48: RenderingHints hints) {
49: /* Get ImageLayout and TileCache from RenderingHints. */
50: ImageLayout layout = RIFUtil.getImageLayoutHint(hints);
51:
52: if (!MediaLibAccessor
53: .isMediaLibCompatible(new ParameterBlock())) {
54: return null;
55: }
56:
57: return new DCTOpImage(args.getRenderedSource(0), hints, layout,
58: new FCTmediaLib(true, 2));
59: }
60: }
|