001: /*
002: * @(#) $Header: /cvs/jai-operators/src/main/ca/forklabs/media/jai/opimage/PipelineCRIF.java,v 1.4 2007/07/05 18:25:22 forklabs Exp $
003: *
004: * Copyright (C) 2007 Forklabs Daniel Léonard
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or (at your option) any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: */
020:
021: package ca.forklabs.media.jai.opimage;
022:
023: import java.awt.RenderingHints;
024: import java.awt.image.RenderedImage;
025: import java.awt.image.renderable.ContextualRenderedImageFactory;
026: import java.awt.image.renderable.ParameterBlock;
027: import java.awt.image.renderable.RenderContext;
028: import java.awt.image.renderable.RenderableImage;
029: import ca.forklabs.media.jai.operator.PipelineDescriptor;
030:
031: /**
032: * Class {@code PipelineCRIF} is a {@link ContextualRenderedImageFactory}
033: * supporting the <em>Pipeline</em> operation in the rendered and renderable
034: * image layers.
035: *
036: * @author <a href="mailto:forklabs at dev.java.net?subject=ca.forklabs.media.jai.opimage.PipelineCRIF">Daniel Léonard</a>
037: * @version $Revision: 1.4 $
038: */
039: public class PipelineCRIF extends AbstractCRIF {
040:
041: //---------------------------
042: // Constructor
043: //---------------------------
044:
045: /**
046: * Constructor.
047: */
048: public PipelineCRIF() {
049: super (PipelineDescriptor.NAME);
050: }
051:
052: //---------------------------
053: // Implemented methods from javax.media.jai.CRIFImpl
054: //---------------------------
055:
056: /**
057: * Performs the rendered pipeline.
058: * @param pb the parameter block.
059: * @param hints optional rendering hints.
060: * @return the result.
061: */
062: @Override
063: @SuppressWarnings("nls")
064: public RenderedImage create(ParameterBlock pb, RenderingHints hints) {
065: PipelineUtil.Specialization<RenderedImage> specialization = PipelineUtil.RENDERED;
066: RenderedImage sink = PipelineUtil.doPipeline(pb, hints,
067: specialization);
068: return sink;
069: }
070:
071: /**
072: * Performs the renderable pipeline.
073: * @param context the rendering context.
074: * @param pb the parameter block.
075: * @return the result.
076: */
077: @Override
078: @SuppressWarnings("nls")
079: public RenderedImage create(RenderContext context, ParameterBlock pb) {
080: RenderingHints hints = null;
081: PipelineUtil.Specialization<RenderableImage> specialization = PipelineUtil.RENDERABLE;
082: RenderableImage image = PipelineUtil.doPipeline(pb, hints,
083: specialization);
084: RenderedImage sink = image.createRendering(context);
085: return sink;
086: }
087: // TODO : is this method really necessary ?
088:
089: }
090:
091: /*
092: * $Log: PipelineCRIF.java,v $
093: * Revision 1.4 2007/07/05 18:25:22 forklabs
094: * Added a note about the necessity of a method.
095: *
096: * Revision 1.3 2007/06/07 23:39:19 forklabs
097: * Operator pipeline is now on all four modes.
098: *
099: * Revision 1.2 2007/05/10 17:57:05 forklabs
100: * Added mnemonics for the parameter position in the ParameterBlock.
101: *
102: * Revision 1.1 2007/05/03 19:51:53 forklabs
103: * The pipeline descriptor.
104: *
105: */
|