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.ext.awt.image.rendered;
20:
21: import java.awt.Rectangle;
22: import java.awt.Shape;
23: import java.awt.image.RenderedImage;
24:
25: /**
26: * This provides a number of extra methods that enable a system to
27: * better analyse the dependencies between nodes in a render graph.
28: *
29: * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
30: * @version $Id: CachableRed.java 478276 2006-11-22 18:33:37Z dvholten $
31: */
32: public interface CachableRed extends RenderedImage {
33:
34: /**
35: * Returns the bounds of the current image.
36: * This should be 'in sync' with getMinX, getMinY, getWidth, getHeight
37: */
38: Rectangle getBounds();
39:
40: /**
41: * Returns the region of input data is is required to generate
42: * outputRgn.
43: * @param srcIndex The source to do the dependency calculation for.
44: * @param outputRgn The region of output you are interested in
45: * generating dependencies for. The is given in the output pixel
46: * coordiate system for this node.
47: * @return The region of input required. This is in the output pixel
48: * coordinate system for the source indicated by srcIndex.
49: */
50: Shape getDependencyRegion(int srcIndex, Rectangle outputRgn);
51:
52: /**
53: * This calculates the region of output that is affected by a change
54: * in a region of input.
55: * @param srcIndex The input that inputRgn reflects changes in.
56: * @param inputRgn the region of input that has changed, used to
57: * calculate the returned shape. This is given in the pixel
58: * coordinate system of the source indicated by srcIndex.
59: * @return The region of output that would be invalid given
60: * a change to inputRgn of the source selected by srcIndex.
61: * this is in the output pixel coordinate system of this node.
62: */
63: Shape getDirtyRegion(int srcIndex, Rectangle inputRgn);
64: }
|