01: /*
02: * @(#) $Header: /cvs/jai-operators/src/main/ca/forklabs/media/jai/opimage/MedianCollectionCRIF.java,v 1.2 2007/07/05 18:23:49 forklabs Exp $
03: *
04: * Copyright (C) 2007 Forklabs Daniel Léonard
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: */
20:
21: package ca.forklabs.media.jai.opimage;
22:
23: import java.awt.RenderingHints;
24: import java.awt.image.RenderedImage;
25: import java.awt.image.renderable.ContextualRenderedImageFactory;
26: import java.awt.image.renderable.ParameterBlock;
27: import javax.media.jai.CollectionImage;
28: import javax.media.jai.ImageLayout;
29: import ca.forklabs.media.jai.opimage.AbstractCRIF;
30: import ca.forklabs.media.jai.operator.MedianCollectionDescriptor;
31: import ca.forklabs.media.jai.opimage.MedianCollectionOpImage;
32:
33: /**
34: * Class {@code MedianCollectionCRIF} is a
35: * {@link ContextualRenderedImageFactory} supporting the
36: * <em>MedianCollection</em> operation in the rendered and renderable image
37: * layers.
38: *
39: * @author <a href="mailto:forklabs at dev.java.net?subject=ca.forklabs.media.jai.opimage.MedianCollectionCRIF">Daniel Léonard</a>
40: * @version $Revision: 1.2 $
41: * @see MedianCollectionOpImage
42: */
43: public class MedianCollectionCRIF extends AbstractCRIF {
44:
45: //---------------------------
46: // Constructor
47: //---------------------------
48:
49: /**
50: * Constructor.
51: */
52: public MedianCollectionCRIF() {
53: super (MedianCollectionDescriptor.NAME);
54: }
55:
56: //---------------------------
57: // Implemented methods from javax.media.jai.CRIFImpl
58: //---------------------------
59:
60: /**
61: * Creates a new instance of {@link MedianCollectionOpImage} in the rendered
62: * layer.
63: * @param pb the parameter block containing the collection of images to
64: * be <em>medianed</em>.
65: * @param hints optional rendering hints.
66: */
67: @Override
68: @SuppressWarnings("unchecked")
69: public RenderedImage create(ParameterBlock pb, RenderingHints hints) {
70: CollectionImage sources = (CollectionImage) pb.getSource(0);
71: ImageLayout layout = this .getImageLayout(hints);
72: RenderedImage image = new MedianCollectionOpImage(sources,
73: hints, layout);
74: return image;
75: }
76:
77: }
78:
79: /*
80: * $Log: MedianCollectionCRIF.java,v $
81: * Revision 1.2 2007/07/05 18:23:49 forklabs
82: * Now uses CollectionImage instead of lists.
83: *
84: * Revision 1.1 2007/06/13 18:56:37 forklabs
85: * Operator mediancollection.
86: *
87: */
|