01: /*
02: * @(#) $Header: /cvs/jai-operators/src/main/ca/forklabs/media/jai/opimage/AbstractCRIF.java,v 1.1 2007/05/03 18:32:29 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.renderable.ContextualRenderedImageFactory;
25: import javax.media.jai.CRIFImpl;
26: import javax.media.jai.ImageLayout;
27: import javax.media.jai.JAI;
28:
29: /**
30: * Class {@code AbstractCRIF} provides common code for implementations of
31: * {@link ContextualRenderedImageFactory}.
32: *
33: * @author <a href="mailto:forklabs at dev.java.net?subject=ca.forklabs.media.jai.opimage.AbstractCRIF">Daniel Léonard</a>
34: * @version $Revision: 1.1 $
35: */
36: public abstract class AbstractCRIF extends CRIFImpl {
37:
38: //---------------------------
39: // Constructor
40: //---------------------------
41:
42: /**
43: * Constructor.
44: * @param name the name of the operation.
45: */
46: protected AbstractCRIF(String name) {
47: super (name);
48: }
49:
50: //---------------------------
51: // Abstract methods
52: //---------------------------
53:
54: /**
55: * Gets the image layout from the given rendering hints.
56: * @param hints the rendering hints.
57: * @return the image layout.
58: */
59: protected ImageLayout getImageLayout(RenderingHints hints) {
60: ImageLayout image_layout = (null == hints) ? null
61: : (ImageLayout) hints.get(JAI.KEY_IMAGE_LAYOUT);
62: return image_layout;
63: }
64:
65: }
66:
67: /*
68: * $Log: AbstractCRIF.java,v $
69: * Revision 1.1 2007/05/03 18:32:29 forklabs
70: * Initial commit for the unaryfunction operator.
71: *
72: */
|