2362N/A * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/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 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/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 0N/A * This class performs an arbitrary linear combination of the bands 0N/A * in a <CODE>Raster</CODE>, using a specified matrix. 0N/A * The width of the matrix must be equal to the number of bands in the 0N/A * source <CODE>Raster</CODE>, optionally plus one. If there is one more 0N/A * column in the matrix than the number of bands, there is an implied 1 at the 0N/A * end of the vector of band samples representing a pixel. The height 0N/A * of the matrix must be equal to the number of bands in the destination. 0N/A * For example, a 3-banded <CODE>Raster</CODE> might have the following 0N/A * transformation applied to each pixel in order to invert the second band of 0N/A * the <CODE>Raster</CODE>. 0N/A * [ 1.0 0.0 0.0 0.0 ] [ b1 ] 0N/A * [ 0.0 -1.0 0.0 255.0 ] x [ b2 ] 0N/A * [ 0.0 0.0 1.0 0.0 ] [ b3 ] 0N/A * Note that the source and destination can be the same object. 0N/A * Constructs a <CODE>BandCombineOp</CODE> with the specified matrix. 0N/A * The width of the matrix must be equal to the number of bands in 0N/A * the source <CODE>Raster</CODE>, optionally plus one. If there is one 0N/A * more column in the matrix than the number of bands, there is an implied 0N/A * 1 at the end of the vector of band samples representing a pixel. The 0N/A * height of the matrix must be equal to the number of bands in the 0N/A * The first subscript is the row index and the second 0N/A * is the column index. This operation uses none of the currently 0N/A * defined rendering hints; the <CODE>RenderingHints</CODE> argument can be 0N/A * @param matrix The matrix to use for the band combine operation. 0N/A * @param hints The <CODE>RenderingHints</CODE> object for this operation. 0N/A * Not currently used so it can be null. 0N/A /* Arrays.copyOf is forgiving of the source array being 0N/A * too short, but it is also faster than other cloning 0N/A * methods, so we provide our own protection for short 0N/A * Returns a copy of the linear combination matrix. 0N/A * @return The matrix associated with this band combine operation. 0N/A * Transforms the <CODE>Raster</CODE> using the matrix specified in the 0N/A * constructor. An <CODE>IllegalArgumentException</CODE> may be thrown if 0N/A * the number of bands in the source or destination is incompatible with 0N/A * the matrix. See the class comments for more details. 0N/A * If the destination is null, it will be created with a number of bands 0N/A * equalling the number of rows in the matrix. No exception is thrown 0N/A * if the operation causes a data overflow. 0N/A * @param src The <CODE>Raster</CODE> to be filtered. 0N/A * @param dst The <CODE>Raster</CODE> in which to store the results 0N/A * of the filter operation. 0N/A * @return The filtered <CODE>Raster</CODE>. 0N/A * @throws IllegalArgumentException If the number of bands in the 0N/A * source or destination is incompatible with the matrix. 0N/A ") must be equal to the number"+
0N/A " of bands ([+1]) in src ("+
0N/A ") must be equal to the number"+
0N/A " of bands ([+1]) in dst ("+
0N/A // Need to add constant 0N/A * Returns the bounding box of the transformed destination. Since 0N/A * this is not a geometric operation, the bounding box is the same for 0N/A * the source and destination. 0N/A * An <CODE>IllegalArgumentException</CODE> may be thrown if the number of 0N/A * bands in the source is incompatible with the matrix. See 0N/A * the class comments for more details. 0N/A * @param src The <CODE>Raster</CODE> to be filtered. 0N/A * @return The <CODE>Rectangle2D</CODE> representing the destination 0N/A * image's bounding box. 0N/A * @throws IllegalArgumentException If the number of bands in the source 0N/A * is incompatible with the matrix. 0N/A * Creates a zeroed destination <CODE>Raster</CODE> with the correct size 0N/A * and number of bands. 0N/A * An <CODE>IllegalArgumentException</CODE> may be thrown if the number of 0N/A * bands in the source is incompatible with the matrix. See 0N/A * the class comments for more details. 0N/A * @param src The <CODE>Raster</CODE> to be filtered. 0N/A * @return The zeroed destination <CODE>Raster</CODE>. 0N/A ") must be equal to the number"+
0N/A " of bands ([+1]) in src ("+
0N/A " compatible Raster with "+
0N/A * Returns the location of the corresponding destination point given a 0N/A * point in the source <CODE>Raster</CODE>. If <CODE>dstPt</CODE> is 0N/A * specified, it is used to hold the return value. 0N/A * Since this is not a geometric operation, the point returned 0N/A * is the same as the specified <CODE>srcPt</CODE>. 0N/A * @param srcPt The <code>Point2D</code> that represents the point in 0N/A * the source <code>Raster</code> 0N/A * @param dstPt The <CODE>Point2D</CODE> in which to store the result. 0N/A * @return The <CODE>Point2D</CODE> in the destination image that 0N/A * corresponds to the specified point in the source image. 0N/A * Returns the rendering hints for this operation. 0N/A * @return The <CODE>RenderingHints</CODE> object associated with this 0N/A * operation. Returns null if no hints have been set.