01: /*
02:
03: Licensed to the Apache Software Foundation (ASF) under one or more
04: contributor license agreements. See the NOTICE file distributed with
05: this work for additional information regarding copyright ownership.
06: The ASF licenses this file to You under the Apache License, Version 2.0
07: (the "License"); you may not use this file except in compliance with
08: the License. You may obtain a copy of the License at
09:
10: http://www.apache.org/licenses/LICENSE-2.0
11:
12: Unless required by applicable law or agreed to in writing, software
13: distributed under the License is distributed on an "AS IS" BASIS,
14: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15: See the License for the specific language governing permissions and
16: limitations under the License.
17:
18: */
19: package org.apache.batik.gvt.filter;
20:
21: import java.awt.geom.Rectangle2D;
22:
23: import org.apache.batik.ext.awt.image.renderable.Filter;
24: import org.apache.batik.gvt.GraphicsNode;
25:
26: /**
27: * Implements a masking operation. This masks the source by the result
28: * of converting the GraphicsNode to a mask image.
29: *
30: * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
31: * @version $Id: Mask.java 478188 2006-11-22 15:19:17Z dvholten $
32: */
33: public interface Mask extends Filter {
34: /**
35: * The region to which this mask applies
36: */
37: Rectangle2D getFilterRegion();
38:
39: /**
40: * Returns the filter region to which this mask applies
41: */
42: void setFilterRegion(Rectangle2D filterRegion);
43:
44: /**
45: * The source to be masked by the mask node.
46: * @param src The Image to be masked.
47: */
48: void setSource(Filter src);
49:
50: /**
51: * This returns the current image being masked by the mask node.
52: * @return The image to mask
53: */
54: Filter getSource();
55:
56: /**
57: * Set the masking image to that described by gn.
58: * If gn is an rgba image then the alpha is premultiplied and then
59: * the rgb is converted to alpha via the standard feColorMatrix
60: * rgb to luminance conversion.
61: * In the case of an rgb only image, just the rgb to luminance
62: * conversion is performed.
63: * @param gn The graphics node that defines the mask image.
64: */
65: void setMaskNode(GraphicsNode gn);
66:
67: /**
68: * Returns the Graphics node that the mask operation will use to
69: * define the masking image.
70: * @return The graphics node that defines the mask image.
71: */
72: GraphicsNode getMaskNode();
73: }
|