Simple editor - editing convolution filter

This commit is contained in:
Jindra Petřík
2025-05-14 00:23:51 +02:00
parent 93291cb42e
commit 7ca1858fcb
6 changed files with 454 additions and 35 deletions

View File

@@ -142,8 +142,8 @@ public class ConvolveOp implements BufferedImageOp, RasterOp {
float[] kvals = kernel.getKernelData(null);
for (int x = srcX - left; x < srcX + srcWidth + left + 1; x++) {
for (int y = srcY - top; y < srcY + srcHeight + top + 1; y++) {
for (int x = srcX - left; x < srcX + srcWidth + left; x++) {
for (int y = srcY - top; y < srcY + srcHeight + top; y++) {
float a;
if (preserveAlpha) {
boolean outSide = false;

View File

@@ -669,7 +669,7 @@ public class Filtering {
int srcHeight
) {
Kernel kernel = new Kernel(w, h, matrix);
BufferedImage dst = new BufferedImage(src.getWidth() + 1, src.getHeight() + 1, src.getType());
BufferedImage dst = new BufferedImage(src.getWidth(), src.getHeight(), src.getType());
BufferedImageOp op = new ConvolveOp(
kernel,
new RenderingHints(null),