307 /**
308 * Transforms the source <CODE>Raster</CODE> and stores the results in
309 * the destination <CODE>Raster</CODE>. This operation performs the
310 * transform band by band.
311 * <p>
312 * If the destination <CODE>Raster</CODE> is null, a new
313 * <CODE>Raster</CODE> is created.
314 * An <CODE>IllegalArgumentException</CODE> may be thrown if the source is
315 * the same as the destination or if the number of bands in
316 * the source is not equal to the number of bands in the
317 * destination.
318 * <p>
319 * The coordinates of the rectangle returned by
320 * <code>getBounds2D(Raster)</code>
321 * are not necessarily the same as the coordinates of the
322 * <code>WritableRaster</code> returned by this method. If the
323 * upper-left corner coordinates of rectangle are negative then
324 * this part of the rectangle is not drawn. If the coordinates
325 * of the rectangle are positive then the filtered image is drawn at
326 * that position in the destination <code>Raster</code>.
327 * <p>
328 * @param src The <CODE>Raster</CODE> to transform.
329 * @param dst The <CODE>Raster</CODE> in which to store the results of the
330 * transformation.
331 *
332 * @return The transformed <CODE>Raster</CODE>.
333 *
334 * @throws ImagingOpException if the raster cannot be transformed
335 * because of a data-processing error that might be
336 * caused by an invalid image format, tile format, or
337 * image-processing operation, or any other unsupported
338 * operation.
339 */
340 public final WritableRaster filter(Raster src, WritableRaster dst) {
341 if (src == null) {
342 throw new NullPointerException("src image is null");
343 }
344 if (dst == null) {
345 dst = createCompatibleDestRaster(src);
346 }
347 if (src == dst) {
|
307 /**
308 * Transforms the source <CODE>Raster</CODE> and stores the results in
309 * the destination <CODE>Raster</CODE>. This operation performs the
310 * transform band by band.
311 * <p>
312 * If the destination <CODE>Raster</CODE> is null, a new
313 * <CODE>Raster</CODE> is created.
314 * An <CODE>IllegalArgumentException</CODE> may be thrown if the source is
315 * the same as the destination or if the number of bands in
316 * the source is not equal to the number of bands in the
317 * destination.
318 * <p>
319 * The coordinates of the rectangle returned by
320 * <code>getBounds2D(Raster)</code>
321 * are not necessarily the same as the coordinates of the
322 * <code>WritableRaster</code> returned by this method. If the
323 * upper-left corner coordinates of rectangle are negative then
324 * this part of the rectangle is not drawn. If the coordinates
325 * of the rectangle are positive then the filtered image is drawn at
326 * that position in the destination <code>Raster</code>.
327 *
328 * @param src The <CODE>Raster</CODE> to transform.
329 * @param dst The <CODE>Raster</CODE> in which to store the results of the
330 * transformation.
331 *
332 * @return The transformed <CODE>Raster</CODE>.
333 *
334 * @throws ImagingOpException if the raster cannot be transformed
335 * because of a data-processing error that might be
336 * caused by an invalid image format, tile format, or
337 * image-processing operation, or any other unsupported
338 * operation.
339 */
340 public final WritableRaster filter(Raster src, WritableRaster dst) {
341 if (src == null) {
342 throw new NullPointerException("src image is null");
343 }
344 if (dst == null) {
345 dst = createCompatibleDestRaster(src);
346 }
347 if (src == dst) {
|