01: /*
02: * $RCSfile: ExtremaRIF.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:25 $
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.ROI;
19:
20: /**
21: * A <code>RIF</code> supporting the "Extrema" operation in the
22: * rendered image layer.
23: *
24: * @see javax.media.jai.operator.ExtremaDescriptor
25: */
26: public class ExtremaRIF implements RenderedImageFactory {
27:
28: /** Constructor. */
29: public ExtremaRIF() {
30: }
31:
32: /**
33: * Creates a new instance of <code>ExtremaOpImage</code>
34: * in the rendered layer. Any image layout information in
35: * <code>RenderingHints</code> is ignored.
36: * This method satisfies the implementation of RIF.
37: */
38: public RenderedImage create(ParameterBlock paramBlock,
39: RenderingHints hints) {
40: RenderedImage src = paramBlock.getRenderedSource(0);
41:
42: int xStart = src.getMinX(); // default values
43: int yStart = src.getMinY();
44:
45: int maxWidth = src.getWidth();
46: int maxHeight = src.getHeight();
47:
48: return new ExtremaOpImage(src, (ROI) paramBlock
49: .getObjectParameter(0), xStart, yStart, paramBlock
50: .getIntParameter(1), paramBlock.getIntParameter(2),
51: ((Boolean) paramBlock.getObjectParameter(3))
52: .booleanValue(), paramBlock.getIntParameter(4));
53: }
54: }
|