EMMA Coverage Report (generated Sun Apr 20 22:38:01 CEST 2008)
[all classes][net.sf.jomic.tools]

COVERAGE SUMMARY FOR SOURCE FILE [ThresholdBlurRIF.java]

nameclass, %method, %block, %line, %
ThresholdBlurRIF.java100% (1/1)50%  (1/2)7%   (3/45)17%  (2/12)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ThresholdBlurRIF100% (1/1)50%  (1/2)7%   (3/45)17%  (2/12)
create (ParameterBlock, RenderingHints): RenderedImage 0%   (0/1)0%   (0/42)0%   (0/10)
ThresholdBlurRIF (): void 100% (1/1)100% (3/3)100% (2/2)

1/*
2 *  $RCSfile: ThresholdBlurRIF.java $
3 *
4 *  Copyright (c) 2007 Jeremiah Spaulding
5 *
6 *  This program is free software; you can redistribute it and/or modify
7 *  it under the terms of the GNU General Public License as published by
8 *  the Free Software Foundation; either version 2 of the License, or
9 *  (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 *  $Revision: 1.0 $
21 *  $Date: 2007/07/15 00:00:00 $
22 */
23package net.sf.jomic.tools;
24 
25import java.awt.RenderingHints;
26import java.awt.image.RenderedImage;
27import java.awt.image.renderable.ParameterBlock;
28import java.awt.image.renderable.RenderedImageFactory;
29import javax.media.jai.BorderExtender;
30import javax.media.jai.ImageLayout;
31import javax.media.jai.KernelJAI;
32import javax.media.jai.JAI;
33 
34/**
35 * @see    ThresholdBlurRIF
36 */
37public class ThresholdBlurRIF implements RenderedImageFactory
38{
39 
40    /**
41     *  Constructor.
42     */
43    public ThresholdBlurRIF() {
44        super();
45    }
46 
47    /**
48     *  Create a new instance of ThresholdBlurOpImage in the rendered layer. This method satisfies
49     *  the implementation of RIF.
50     *
51     * @param  paramBlock  The source image and the convolution kernel.
52     */
53    public RenderedImage create(ParameterBlock paramBlock,
54            RenderingHints renderHints) {
55        // Get ImageLayout from renderHints if any.
56        ImageLayout layout = null;
57 
58        if (renderHints != null) {
59            layout = (ImageLayout) renderHints.get(JAI.KEY_IMAGE_LAYOUT);
60        }
61 
62        // Get BorderExtender from renderHints if any.
63        BorderExtender extender = null;
64 
65        if (renderHints != null) {
66            extender = (BorderExtender) renderHints.get(JAI.KEY_BORDER_EXTENDER);
67        }
68 
69        KernelJAI unRotatedKernel =
70                (KernelJAI) paramBlock.getObjectParameter(0);
71        KernelJAI kJAI = unRotatedKernel.getRotatedKernel();
72        int threshold = paramBlock.getIntParameter(1);
73 
74        return new ThresholdBlurOpImage(paramBlock.getRenderedSource(0),
75                extender,
76                renderHints,
77                layout,
78                kJAI, threshold);
79    }
80}

[all classes][net.sf.jomic.tools]
EMMA 2.0.4217 (C) Vladimir Roubtsov