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

COVERAGE SUMMARY FOR SOURCE FILE [ThresholdBlurDescriptor.java]

nameclass, %method, %block, %line, %
ThresholdBlurDescriptor.java100% (1/1)75%  (3/4)86%  (175/203)64%  (9/14)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class ThresholdBlurDescriptor100% (1/1)75%  (3/4)86%  (175/203)64%  (9/14)
create (RenderedImage, KernelJAI, int, RenderingHints): RenderedOp 0%   (0/1)0%   (0/26)0%   (0/5)
<static initializer> 100% (1/1)99%  (156/158)100% (4/4)
ThresholdBlurDescriptor (): void 100% (1/1)100% (8/8)100% (2/2)
getPropertyGenerators (): PropertyGenerator [] 100% (1/1)100% (11/11)100% (3/3)

1/*
2 *  $RCSfile: ThresholdBlurDescriptor.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 com.sun.media.jai.util.AreaOpPropertyGenerator;
26import java.awt.RenderingHints;
27import java.awt.image.RenderedImage;
28import javax.media.jai.JAI;
29import javax.media.jai.KernelJAI;
30import javax.media.jai.OperationDescriptorImpl;
31import javax.media.jai.ParameterBlockJAI;
32import javax.media.jai.PropertyGenerator;
33import javax.media.jai.RenderedOp;
34import javax.media.jai.registry.RenderedRegistryMode;
35 
36/**
37 *  AreaOp based gaussian convolution with a cutoff threshold
38 *
39 * @see    javax.media.jai.OperationDescriptor
40 * @see    javax.media.jai.KernelJAI
41 */
42public class ThresholdBlurDescriptor extends OperationDescriptorImpl
43{
44 
45    /**
46     *  The parameter class types for the operation.
47     */
48    private static final Class[] paramClasses = {
49            javax.media.jai.KernelJAI.class, Integer.class
50            };
51 
52    /**
53     *  The parameter default values for the operation.
54     */
55    private static final Object[] paramDefaults = {
56            NO_PARAMETER_DEFAULT, new Integer(5)
57            };
58 
59    /**
60     *  The parameter names for the operation.
61     */
62    private static final String[] paramNames = {
63            "kernel", "threshold"
64            };
65 
66    /**
67     *  The resource strings that provide the general documentation and specify the parameter list
68     *  for a Convolve operation.
69     */
70    private static final String[][] resources = {
71            {"GlobalName", "ThresholdBlur"},
72            {"LocalName", "ThresholdBlur"},
73            {"Vendor", "JWS"},
74            {"Description", "ThresholdBlur"},
75            {"DocURL", ""},
76            {"Version", "1.0"},
77            {"arg0Desc", "The Kernel to use"},
78            {"arg1Desc", "The threshold"},
79            };
80 
81    /**
82     *  Constructor.
83     */
84    public ThresholdBlurDescriptor() {
85        super(resources, 1, paramClasses, paramNames, paramDefaults);
86    }
87 
88    /**
89     *  Returns an array of <code>PropertyGenerators</code> implementing property inheritance for
90     *  the operation.
91     *
92     * @return    An array of property generators.
93     */
94    public PropertyGenerator[] getPropertyGenerators() {
95        PropertyGenerator[] pg = new PropertyGenerator[1];
96 
97        pg[0] = new AreaOpPropertyGenerator();
98        return pg;
99    }
100 
101 
102    /**
103     *  Performs kernel-based threshold blur on an image.
104     *
105     * @return                            The <code>RenderedOp</code> destination.
106     * @throws  IllegalArgumentException  if <code>source0</code> is <code>null</code>.
107     * @throws  IllegalArgumentException  if <code>kernel</code> is <code>null</code>.
108     * @param  source0                    <code>RenderedImage</code> source 0.
109     * @param  kernel                     The convolution kernel.
110     * @param  threshold                  The limit to use.
111     * @param  hints                      The <code>RenderingHints</code> to use. May be <code>null</code>
112     *      .
113     */
114    public static RenderedOp create(RenderedImage source0,
115            KernelJAI kernel,
116            int threshold,
117            RenderingHints hints) {
118        ParameterBlockJAI pb =
119                new ParameterBlockJAI("ThresholdBlur",
120                RenderedRegistryMode.MODE_NAME);
121 
122        pb.setSource("source0", source0);
123 
124        pb.setParameter("kernel", kernel);
125        pb.setParameter("threshold", threshold);
126 
127        return JAI.create("ThresholdBlur", pb, hints);
128    }
129}

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