1 /* Copyright (C) 2005-2011 Fabio Riccardi */
2 
3 /*
4  * $RCSfile: AddCRIF.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:11 $
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 public class UnSharpMaskCRIF extends CRIFImpl {
24 
25     /** Constructor. */
UnSharpMaskCRIF()26     public UnSharpMaskCRIF() {
27         super("LCUnSharpMask");
28     }
29 
30     /**
31      * Creates a new instance of <code>AddOpImage</code> in the rendered
32      * layer. This method satisfies the implementation of RIF.
33      *
34      * @param paramBlock   The two source images to be added.
35      * @param renderHints  Optionally contains destination image layout.
36      */
create(ParameterBlock paramBlock, RenderingHints renderHints)37     public RenderedImage create(ParameterBlock paramBlock,
38                                 RenderingHints renderHints) {
39         // Get ImageLayout from renderHints if any.
40         ImageLayout layout = RIFUtil.getImageLayoutHint(renderHints);
41 
42 
43         return new UnSharpMaskOpImage(paramBlock.getRenderedSource(0),
44                                       paramBlock.getRenderedSource(1),
45                                       renderHints,
46                                       layout,
47                                       paramBlock.getDoubleParameter(0),
48                                       paramBlock.getIntParameter(1));
49     }
50 }
51