01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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: /* $Id: CachableRed.java 496556 2007-01-16 00:59:48Z cam $ */
19:
20: package org.apache.xmlgraphics.image.rendered;
21:
22: import java.awt.Rectangle;
23: import java.awt.Shape;
24: import java.awt.image.RenderedImage;
25:
26: /**
27: * This provides a number of extra methods that enable a system to
28: * better analyse the dependencies between nodes in a render graph.
29: *
30: * @author <a href="mailto:Thomas.DeWeeese@Kodak.com">Thomas DeWeese</a>
31: * @version $Id: CachableRed.java 496556 2007-01-16 00:59:48Z cam $
32: */
33: public interface CachableRed extends RenderedImage {
34:
35: /**
36: * Returns the bounds of the current image.
37: * This should be 'in sync' with getMinX, getMinY, getWidth, getHeight
38: */
39: Rectangle getBounds();
40:
41: /**
42: * Returns the region of input data is is required to generate
43: * outputRgn.
44: * @param srcIndex The source to do the dependency calculation for.
45: * @param outputRgn The region of output you are interested in
46: * generating dependencies for. The is given in the output pixel
47: * coordiate system for this node.
48: * @return The region of input required. This is in the output pixel
49: * coordinate system for the source indicated by srcIndex.
50: */
51: Shape getDependencyRegion(int srcIndex, Rectangle outputRgn);
52:
53: /**
54: * This calculates the region of output that is affected by a change
55: * in a region of input.
56: * @param srcIndex The input that inputRgn reflects changes in.
57: * @param inputRgn the region of input that has changed, used to
58: * calculate the returned shape. This is given in the pixel
59: * coordinate system of the source indicated by srcIndex.
60: * @return The region of output that would be invalid given
61: * a change to inputRgn of the source selected by srcIndex.
62: * this is in the output pixel coordinate system of this node.
63: */
64: Shape getDirtyRegion(int srcIndex, Rectangle inputRgn);
65: }
|