jdk/src/share/classes/java/awt/image/AffineTransformOp.java
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
child 22567 5816a47fa4dd
equal deleted inserted replaced
16733:9267ec7004a1 16734:da1901d79073
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    32 import java.awt.AlphaComposite;
    32 import java.awt.AlphaComposite;
    33 import java.awt.GraphicsEnvironment;
    33 import java.awt.GraphicsEnvironment;
    34 import java.awt.Rectangle;
    34 import java.awt.Rectangle;
    35 import java.awt.RenderingHints;
    35 import java.awt.RenderingHints;
    36 import java.awt.Transparency;
    36 import java.awt.Transparency;
    37 import javax.tools.annotation.GenerateNativeHeader;
    37 import java.lang.annotation.Native;
    38 import sun.awt.image.ImagingLib;
    38 import sun.awt.image.ImagingLib;
    39 
    39 
    40 /**
    40 /**
    41  * This class uses an affine transform to perform a linear mapping from
    41  * This class uses an affine transform to perform a linear mapping from
    42  * 2D coordinates in the source image or <CODE>Raster</CODE> to 2D coordinates
    42  * 2D coordinates in the source image or <CODE>Raster</CODE> to 2D coordinates
    61  * @see java.awt.RenderingHints#KEY_INTERPOLATION
    61  * @see java.awt.RenderingHints#KEY_INTERPOLATION
    62  * @see java.awt.RenderingHints#KEY_RENDERING
    62  * @see java.awt.RenderingHints#KEY_RENDERING
    63  * @see java.awt.RenderingHints#KEY_COLOR_RENDERING
    63  * @see java.awt.RenderingHints#KEY_COLOR_RENDERING
    64  * @see java.awt.RenderingHints#KEY_DITHERING
    64  * @see java.awt.RenderingHints#KEY_DITHERING
    65  */
    65  */
    66 /* No native methods here, but the constants are needed in the supporting JNI code */
       
    67 @GenerateNativeHeader
       
    68 public class AffineTransformOp implements BufferedImageOp, RasterOp {
    66 public class AffineTransformOp implements BufferedImageOp, RasterOp {
    69     private AffineTransform xform;
    67     private AffineTransform xform;
    70     RenderingHints hints;
    68     RenderingHints hints;
    71 
    69 
    72     /**
    70     /**
    73      * Nearest-neighbor interpolation type.
    71      * Nearest-neighbor interpolation type.
    74      */
    72      */
    75     public static final int TYPE_NEAREST_NEIGHBOR = 1;
    73     @Native public static final int TYPE_NEAREST_NEIGHBOR = 1;
    76 
    74 
    77     /**
    75     /**
    78      * Bilinear interpolation type.
    76      * Bilinear interpolation type.
    79      */
    77      */
    80     public static final int TYPE_BILINEAR = 2;
    78     @Native public static final int TYPE_BILINEAR = 2;
    81 
    79 
    82     /**
    80     /**
    83      * Bicubic interpolation type.
    81      * Bicubic interpolation type.
    84      */
    82      */
    85     public static final int TYPE_BICUBIC = 3;
    83     @Native public static final int TYPE_BICUBIC = 3;
    86 
    84 
    87     int interpolationType = TYPE_NEAREST_NEIGHBOR;
    85     int interpolationType = TYPE_NEAREST_NEIGHBOR;
    88 
    86 
    89     /**
    87     /**
    90      * Constructs an <CODE>AffineTransformOp</CODE> given an affine transform.
    88      * Constructs an <CODE>AffineTransformOp</CODE> given an affine transform.