1 /* Copyright (C) 2005-2011 Fabio Riccardi */
2 
3 /*
4  * $RCSfile: BandCombineCRIF.java,v $
5  *
6  * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
7  *
8  * Use is subject to license terms.
9  *
10  * $Revision: 1.1 $
11  * $Date: 2005/02/11 04:56:14 $
12  * $State: Exp $
13  */
14 package com.lightcrafts.jai.opimage;
15 import com.lightcrafts.media.jai.opimage.RIFUtil;
16 
17 import java.awt.RenderingHints;
18 import java.awt.image.RenderedImage;
19 import java.awt.image.renderable.ParameterBlock;
20 import com.lightcrafts.mediax.jai.CRIFImpl;
21 import com.lightcrafts.mediax.jai.ImageLayout;
22 
23 /**
24  * A <code>CRIF</code> supporting the "BandCombine" operation in the
25  * rendered and renderable image layers.
26  *
27  * @see com.lightcrafts.mediax.jai.operator.BandCombineDescriptor
28  * @see LCBandCombineOpImage
29  *
30  *
31  * @since EA3
32  */
33 public class LCBandCombineCRIF extends CRIFImpl {
34 
35     /** Constructor. */
LCBandCombineCRIF()36     public LCBandCombineCRIF() {
37         super("LCBandCombine");
38     }
39 
40     /**
41      * Creates a new instance of <code>LCBandCombineOpImage</code>
42      * in the rendered layer.
43      *
44      * @param args   The source image and the constants.
45      * @param hints  Optionally contains destination image layout.
46      */
create(ParameterBlock args, RenderingHints hints)47     public RenderedImage create(ParameterBlock args,
48                                 RenderingHints hints) {
49         // Get ImageLayout from renderHints if any.
50         ImageLayout layout = RIFUtil.getImageLayoutHint(hints);
51 
52 
53         return new LCBandCombineOpImage(args.getRenderedSource(0),
54                                         hints,
55                                         layout,
56                                         (double[][])args.getObjectParameter(0));
57     }
58 }
59