Path: blob/master/src/java.desktop/share/classes/sun/java2d/pipe/DrawImagePipe.java
41159 views
/*1* Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.java2d.pipe;2627import java.awt.Color;28import java.awt.Image;29import java.awt.image.BufferedImage;30import java.awt.image.BufferedImageOp;31import java.awt.image.ImageObserver;32import java.awt.geom.AffineTransform;33import sun.java2d.SunGraphics2D;3435/**36* This interface defines the set of calls that pipeline objects37* can use to pass on responsibility for performing various38* image copy commands.39* There are 3 types of image copies handled by this class:40* - copyImage: These methods simply copy the pixels41* from the src to dest, either from (0, 0) (implicit)42* or from a given (sx, sy) location.43* - scaleImage: These methods copy from src to dest while44* scaling the source image. The src and dest rectangles45* are used to specify the scale.46* - copyImageBg: These methods behave the same as the47* copyImage methods except they substitute the given48* background color for any transparent pixels.49* - scaleImageBg: These methods behave the same as the50* scaleImage methods except they substitute the given51* background color for any transparent pixels.52* - transformImage....53*/54public interface DrawImagePipe {5556public boolean copyImage(SunGraphics2D sg, Image img,57int x, int y,58Color bgColor,59ImageObserver observer);6061public boolean copyImage(SunGraphics2D sg, Image img,62int dx, int dy, int sx, int sy, int w, int h,63Color bgColor,64ImageObserver observer);6566public boolean scaleImage(SunGraphics2D sg, Image img, int x, int y,67int width, int height,68Color bgColor,69ImageObserver observer);7071public boolean scaleImage(SunGraphics2D sg, Image img,72int dx1, int dy1, int dx2, int dy2,73int sx1, int sy1, int sx2, int sy2,74Color bgColor,75ImageObserver observer);7677public boolean transformImage(SunGraphics2D sg, Image img,78AffineTransform atfm,79ImageObserver observer);8081public void transformImage(SunGraphics2D sg, BufferedImage img,82BufferedImageOp op, int x, int y);838485}868788