01: /*
02: * $RCSfile: BinarizeCRIF.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:15 $
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 javax.media.jai.CRIFImpl;
18: import javax.media.jai.ImageLayout;
19:
20: /**
21: * A <code>CRIF</code> supporting the "Binarize" operation in the rendered
22: * and renderable image layers.
23: *
24: * @see javax.media.jai.operator.BinarizeDescriptor
25: * @see javax.media.jai.operator.BinarizeDescriptor
26: * @see BinarizeOpImage
27: *
28: */
29: public class BinarizeCRIF extends CRIFImpl {
30:
31: /** Constructor. */
32: public BinarizeCRIF() {
33: super ("binarize");
34: }
35:
36: /**
37: * Creates a new instance of <code>BinarizeOpImage</code> in the
38: * rendered layer.
39: *
40: * @param args The source image and the input parameters.
41: * @param hints Optionally contains destination image layout.
42: */
43: public RenderedImage create(ParameterBlock args,
44: RenderingHints renderHints) {
45: // Get ImageLayout from renderHints if any.
46: ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
47:
48: return new BinarizeOpImage(args.getRenderedSource(0),
49: renderHints, layout, args.getDoubleParameter(0));
50: }
51: }
|