2362N/A * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. 1173N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1173N/A * This code is free software; you can redistribute it and/or modify it 1173N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 1173N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 1173N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1173N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1173N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1173N/A * version 2 for more details (a copy is included in the LICENSE file that 1173N/A * You should have received a copy of the GNU General Public License version 1173N/A * 2 along with this work; if not, write to the Free Software Foundation, 1173N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1173N/A * @author Created by Jasper Potts (Jun 18, 2007) 1173N/A * Clear a transparent image to 100% transparent 1173N/A * @param img The image to clear 1173N/A // ================================================================================================================= 1173N/A * Apply Gaussian Blur to Image 1173N/A * @param dst The destination image to draw blured src image into, null if you want a new one created 1173N/A * @param radius The blur kernel radius 1173N/A //noinspection SuspiciousNameCombination 1173N/A // the result is now stored in srcPixels due to the 2nd pass 1173N/A //noinspection SuspiciousNameCombination 1173N/A // the result is now stored in srcPixels due to the 2nd pass 1173N/A * <p>Blurs the source pixels into the destination pixels. The force of the blur is specified by the radius which 1173N/A * must be greater than 0.</p> <p>The source and destination pixels arrays are expected to be in the INT_ARGB 1173N/A * format.</p> <p>After this method is executed, dstPixels contains a transposed and filtered copy of 1173N/A * @param srcPixels the source pixels 1173N/A * @param dstPixels the destination pixels 1173N/A * @param width the width of the source picture 1173N/A * @param height the height of the source picture 1173N/A * @param kernel the kernel of the blur effect 1173N/A * @param radius the radius of the blur effect 1173N/A * <p>Blurs the source pixels into the destination pixels. The force of the blur is specified by the radius which 1173N/A * must be greater than 0.</p> <p>The source and destination pixels arrays are expected to be in the BYTE_GREY 1173N/A * format.</p> <p>After this method is executed, dstPixels contains a transposed and filtered copy of 1173N/A * @param srcPixels the source pixels 1173N/A * @param dstPixels the destination pixels 1173N/A * @param width the width of the source picture 1173N/A * @param height the height of the source picture 1173N/A * @param kernel the kernel of the blur effect 1173N/A * @param radius the radius of the blur effect 1173N/A// if (subOffset < 0) subOffset = 0; 1173N/A// if (subOffset >= width) subOffset = width-1; 1173N/A // ================================================================================================================= 1173N/A * <p>Returns an array of pixels, stored as integers, from a <code>BufferedImage</code>. The pixels are grabbed from 1173N/A * a rectangular area defined by a location and two dimensions. Calling this method on an image of type different 1173N/A * from <code>BufferedImage.TYPE_INT_ARGB</code> and <code>BufferedImage.TYPE_INT_RGB</code> will unmanage the 1173N/A * @param img the source image 1173N/A * @param x the x location at which to start grabbing pixels 1173N/A * @param y the y location at which to start grabbing pixels 1173N/A * @param w the width of the rectangle of pixels to grab 1173N/A * @param h the height of the rectangle of pixels to grab 1173N/A * @param pixels a pre-allocated array of pixels of size w*h; can be null 1173N/A * @return <code>pixels</code> if non-null, a new array of integers otherwise 1173N/A * @throws IllegalArgumentException is <code>pixels</code> is non-null and of length < w*h 1173N/A * <p>Writes a rectangular area of pixels in the destination <code>BufferedImage</code>. Calling this method on an 1173N/A * image of type different from <code>BufferedImage.TYPE_INT_ARGB</code> and <code>BufferedImage.TYPE_INT_RGB</code> 1173N/A * will unmanage the image.</p> 1173N/A * @param img the destination image 1173N/A * @param x the x location at which to start storing pixels 1173N/A * @param y the y location at which to start storing pixels 1173N/A * @param w the width of the rectangle of pixels to store 1173N/A * @param h the height of the rectangle of pixels to store 1173N/A * @param pixels an array of pixels, stored as integers 1173N/A * @throws IllegalArgumentException is <code>pixels</code> is non-null and of length < w*h 1173N/A * <p>Returns an array of pixels, stored as integers, from a 1173N/A * <code>BufferedImage</code>. The pixels are grabbed from a rectangular 1173N/A * area defined by a location and two dimensions. Calling this method on 1173N/A * an image of type different from <code>BufferedImage.TYPE_INT_ARGB</code> 1173N/A * and <code>BufferedImage.TYPE_INT_RGB</code> will unmanage the image.</p> 1173N/A * @param img the source image 1173N/A * @param x the x location at which to start grabbing pixels 1173N/A * @param y the y location at which to start grabbing pixels 1173N/A * @param w the width of the rectangle of pixels to grab 1173N/A * @param h the height of the rectangle of pixels to grab 1173N/A * @param pixels a pre-allocated array of pixels of size w*h; can be null 1173N/A * @return <code>pixels</code> if non-null, a new array of integers 1173N/A * @throws IllegalArgumentException is <code>pixels</code> is non-null and 1173N/A * <p>Writes a rectangular area of pixels in the destination 1173N/A * <code>BufferedImage</code>. Calling this method on 1173N/A * an image of type different from <code>BufferedImage.TYPE_INT_ARGB</code> 1173N/A * and <code>BufferedImage.TYPE_INT_RGB</code> will unmanage the image.</p> 1173N/A * @param img the destination image 1173N/A * @param x the x location at which to start storing pixels 1173N/A * @param y the y location at which to start storing pixels 1173N/A * @param w the width of the rectangle of pixels to store 1173N/A * @param h the height of the rectangle of pixels to store 1173N/A * @param pixels an array of pixels, stored as integers 1173N/A * @throws IllegalArgumentException is <code>pixels</code> is non-null and 1173N/A * <p>Returns a new <code>BufferedImage</code> using the same color model 1173N/A * as the image passed as a parameter. The returned image is only compatible 1173N/A * with the image passed as a parameter. This does not mean the returned 1173N/A * image is compatible with the hardware.</p> 1173N/A * @param image the reference image from which the color model of the new 1173N/A * @return a new <code>BufferedImage</code>, compatible with the color model 1173N/A * <p>Returns a new translucent compatible image of the specified width and 1173N/A * height. That is, the returned <code>BufferedImage</code> is compatible with 1173N/A * the graphics hardware. If the method is called in a headless 1173N/A * environment, then the returned BufferedImage will be compatible with 1173N/A * @param width the width of the new image 1173N/A * @param height the height of the new image 1173N/A * @return a new translucent compatible <code>BufferedImage</code> of the 1173N/A * specified width and height 1173N/A // Returns the graphics configuration for the primary screen