1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with 4 * this work for additional information regarding copyright ownership. 5 * The ASF licenses this file to You under the Apache License, Version 2.0 6 * (the "License"); you may not use this file except in compliance with 7 * the License. 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 /* $Id: Graphics2DAdapter.java 426576 2006-07-28 15:44:37Z jeremias $ */ 19 20 package org.apache.fop.render; 21 22 import java.io.IOException; 23 24 /** 25 * This interface represents an optional feature that can be provided by 26 * a renderer. It is exposed by calling the getGraphics2DAdapter() method 27 * on the renderer. Renderers that support this feature allow painting 28 * of arbitrary images through a Graphics2D instance. 29 */ 30 public interface Graphics2DAdapter { 31 32 /** 33 * Paints an arbitrary images on a given Graphics2D instance. The renderer 34 * providing this functionality must set up a Graphics2D instance so that 35 * the image with the given extents (in mpt) can be painted by the painter 36 * passed to this method. The Graphics2DImagePainter is then passed this 37 * Graphics2D instance so the image can be painted. 38 * @param painter the painter which will paint the actual image 39 * @param context the renderer context for the current renderer 40 * @param x X position of the image 41 * @param y Y position of the image 42 * @param width width of the image 43 * @param height height of the image 44 * @throws IOException In case of an I/O error while writing the output format 45 */ 46 void paintImage(Graphics2DImagePainter painter, 47 RendererContext context, 48 int x, int y, int width, int height) throws IOException; 49 50 } 51