mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-05 14:35:11 +00:00
Added: Simple editor - convolution filter presets
This commit is contained in:
@@ -1204,7 +1204,7 @@ public class Timeline {
|
||||
|
||||
if (filters != null) {
|
||||
for (FILTER filter : filters) {
|
||||
img = filter.apply(img, unzoom, (int) deltaXMax, (int) deltaYMax, (int) Math.round(newWidth - 2 * deltaXMax), (int) Math.round(newHeight - 2 * deltaYMax));
|
||||
img = filter.apply(img, unzoom, 0, 0, newWidth, newHeight);
|
||||
}
|
||||
}
|
||||
if (blendMode > 1) {
|
||||
|
||||
@@ -103,12 +103,12 @@ public class CONVOLUTIONFILTER extends FILTER {
|
||||
|
||||
@Override
|
||||
public double getDeltaX() {
|
||||
return ((matrixX - 1) >> 1) + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDeltaY() {
|
||||
return ((matrixY - 1) >> 1) + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -142,8 +142,8 @@ public class ConvolveOp implements BufferedImageOp, RasterOp {
|
||||
|
||||
float[] kvals = kernel.getKernelData(null);
|
||||
|
||||
for (int x = srcX - left; x < srcX + srcWidth + left; x++) {
|
||||
for (int y = srcY - top; y < srcY + srcHeight + top; y++) {
|
||||
for (int x = srcX; x < srcX + srcWidth; x++) {
|
||||
for (int y = srcY; y < srcY + srcHeight; y++) {
|
||||
float a;
|
||||
if (preserveAlpha) {
|
||||
boolean outSide = false;
|
||||
@@ -157,12 +157,12 @@ public class ConvolveOp implements BufferedImageOp, RasterOp {
|
||||
fsrcY = srcY;
|
||||
outSide = true;
|
||||
}
|
||||
if (fsrcX >= srcX + srcWidth + 1) {
|
||||
fsrcX = srcX + srcWidth;
|
||||
if (fsrcX >= srcX + srcWidth) {
|
||||
fsrcX = srcX + srcWidth - 1;
|
||||
outSide = true;
|
||||
}
|
||||
if (fsrcY >= srcY + srcHeight + 1) {
|
||||
fsrcY = srcY + srcHeight;
|
||||
if (fsrcY >= srcY + srcHeight) {
|
||||
fsrcY = srcY + srcHeight - 1;
|
||||
outSide = true;
|
||||
}
|
||||
if (outSide) {
|
||||
@@ -212,16 +212,16 @@ public class ConvolveOp implements BufferedImageOp, RasterOp {
|
||||
nSrcX = srcX;
|
||||
outSide = true;
|
||||
}
|
||||
if (nSrcX >= srcX + srcWidth + 1) {
|
||||
nSrcX = srcX + srcWidth;
|
||||
if (nSrcX >= srcX + srcWidth) {
|
||||
nSrcX = srcX + srcWidth - 1;
|
||||
outSide = true;
|
||||
}
|
||||
if (nSrcY < srcY) {
|
||||
nSrcY = srcY;
|
||||
outSide = true;
|
||||
}
|
||||
if (nSrcY >= srcY + srcHeight + 1) {
|
||||
nSrcY = srcY + srcHeight;
|
||||
if (nSrcY >= srcY + srcHeight) {
|
||||
nSrcY = srcY + srcHeight - 1;
|
||||
outSide = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user