KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > batik > gvt > filter > Mask


1 /*
2
3    Copyright 2000-2001,2003 The Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17  */

18 package org.apache.batik.gvt.filter;
19
20 import java.awt.geom.Rectangle2D JavaDoc;
21
22 import org.apache.batik.ext.awt.image.renderable.Filter;
23 import org.apache.batik.gvt.GraphicsNode;
24
25 /**
26  * Implements a masking operation. This masks the source by the result
27  * of converting the GraphicsNode to a mask image.
28  *
29  * @author <a HREF="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
30  * @version $Id: Mask.java,v 1.7 2005/03/27 08:58:34 cam Exp $
31  */

32 public interface Mask extends Filter {
33     /**
34      * The region to which this mask applies
35      */

36     public Rectangle2D JavaDoc getFilterRegion();
37
38     /**
39      * Returns the filter region to which this mask applies
40      */

41     public void setFilterRegion(Rectangle2D JavaDoc filterRegion);
42
43     /**
44      * The source to be masked by the mask node.
45      * @param src The Image to be masked.
46      */

47     public void setSource(Filter src);
48     
49     /**
50      * This returns the current image being masked by the mask node.
51      * @return The image to mask
52      */

53     public Filter getSource();
54     
55     /**
56      * Set the masking image to that described by gn.
57      * If gn is an rgba image then the alpha is premultiplied and then
58      * the rgb is converted to alpha via the standard feColorMatrix
59      * rgb to luminance conversion.
60      * In the case of an rgb only image, just the rgb to luminance
61      * conversion is performed.
62      * @param gn The graphics node that defines the mask image.
63      */

64     public void setMaskNode(GraphicsNode gn);
65     
66     /**
67      * Returns the Graphics node that the mask operation will use to
68      * define the masking image.
69      * @return The graphics node that defines the mask image.
70      */

71     public GraphicsNode getMaskNode();
72 }
73
Popular Tags