src/share/classes/java/awt/image/AffineTransformOp.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 108,134 **** validateTransform(xform); this.xform = (AffineTransform) xform.clone(); this.hints = hints; if (hints != null) { ! Object value = hints.get(hints.KEY_INTERPOLATION); if (value == null) { ! value = hints.get(hints.KEY_RENDERING); ! if (value == hints.VALUE_RENDER_SPEED) { interpolationType = TYPE_NEAREST_NEIGHBOR; } ! else if (value == hints.VALUE_RENDER_QUALITY) { interpolationType = TYPE_BILINEAR; } } ! else if (value == hints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR) { interpolationType = TYPE_NEAREST_NEIGHBOR; } ! else if (value == hints.VALUE_INTERPOLATION_BILINEAR) { interpolationType = TYPE_BILINEAR; } ! else if (value == hints.VALUE_INTERPOLATION_BICUBIC) { interpolationType = TYPE_BICUBIC; } } else { interpolationType = TYPE_NEAREST_NEIGHBOR; --- 108,134 ---- validateTransform(xform); this.xform = (AffineTransform) xform.clone(); this.hints = hints; if (hints != null) { ! Object value = hints.get(RenderingHints.KEY_INTERPOLATION); if (value == null) { ! value = hints.get(RenderingHints.KEY_RENDERING); ! if (value == RenderingHints.VALUE_RENDER_SPEED) { interpolationType = TYPE_NEAREST_NEIGHBOR; } ! else if (value == RenderingHints.VALUE_RENDER_QUALITY) { interpolationType = TYPE_BILINEAR; } } ! else if (value == RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR) { interpolationType = TYPE_NEAREST_NEIGHBOR; } ! else if (value == RenderingHints.VALUE_INTERPOLATION_BILINEAR) { interpolationType = TYPE_BILINEAR; } ! else if (value == RenderingHints.VALUE_INTERPOLATION_BICUBIC) { interpolationType = TYPE_BICUBIC; } } else { interpolationType = TYPE_NEAREST_NEIGHBOR;
*** 233,246 **** if (srcCM.getColorSpace().getType() != dstCM.getColorSpace().getType()) { int type = xform.getType(); boolean needTrans = ((type& ! (xform.TYPE_MASK_ROTATION| ! xform.TYPE_GENERAL_TRANSFORM)) != 0); ! if (! needTrans && type != xform.TYPE_TRANSLATION && type != xform.TYPE_IDENTITY) { double[] mtx = new double[4]; xform.getMatrix(mtx); // Check out the matrix. A non-integral scale will force ARGB // since the edge conditions can't be guaranteed. --- 233,248 ---- if (srcCM.getColorSpace().getType() != dstCM.getColorSpace().getType()) { int type = xform.getType(); boolean needTrans = ((type& ! (AffineTransform.TYPE_MASK_ROTATION| ! AffineTransform.TYPE_GENERAL_TRANSFORM)) != 0); ! if (! needTrans && ! type != AffineTransform.TYPE_TRANSLATION && ! type != AffineTransform.TYPE_IDENTITY) { double[] mtx = new double[4]; xform.getMatrix(mtx); // Check out the matrix. A non-integral scale will force ARGB // since the edge conditions can't be guaranteed.