1 |
/* ConvolveOp.java -- |
/* ConvolveOp.java -- |
2 |
Copyright (C) 2004 Free Software Foundation -- ConvolveOp |
Copyright (C) 2004, 2005 Free Software Foundation -- ConvolveOp |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
191 |
* java.awt.image.WritableRaster) |
* java.awt.image.WritableRaster) |
192 |
*/ |
*/ |
193 |
public WritableRaster filter(Raster src, WritableRaster dest) { |
public WritableRaster filter(Raster src, WritableRaster dest) { |
|
if (src.numBands != dest.numBands) |
|
|
throw new ImagingOpException(null); |
|
194 |
if (src == dest) |
if (src == dest) |
195 |
throw new IllegalArgumentException(); |
throw new IllegalArgumentException(); |
196 |
if (src.getWidth() < kernel.getWidth() || |
if (src.getWidth() < kernel.getWidth() || |
199 |
|
|
200 |
if (dest == null) |
if (dest == null) |
201 |
dest = createCompatibleDestRaster(src); |
dest = createCompatibleDestRaster(src); |
202 |
|
else if (src.numBands != dest.numBands) |
203 |
|
throw new ImagingOpException(null); |
204 |
|
|
205 |
// Deal with bottom edge |
// Deal with bottom edge |
206 |
if (edge == EDGE_ZERO_FILL) |
if (edge == EDGE_ZERO_FILL) |