From 8a72ca3ce086be54032d04a7eff5cc95489b2a56 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sun, 17 Jan 2021 12:15:08 -0500 Subject: [PATCH] more cleanup; yech --- core/src/processing/core/PImage.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/core/src/processing/core/PImage.java b/core/src/processing/core/PImage.java index 898f399e5..e3add33cb 100644 --- a/core/src/processing/core/PImage.java +++ b/core/src/processing/core/PImage.java @@ -284,15 +284,10 @@ public class PImage implements PConstants, Cloneable { ////////////////////////////////////////////////////////////// - public PImage(int width, int height, int[] pixels, boolean requiresCheckAlpha, PApplet parent) { - initFromPixels( - width, - height, - pixels, - RGB, - 1 - ); + public PImage(int width, int height, int[] pixels, + boolean requiresCheckAlpha, PApplet parent) { + initFromPixels(width, height, pixels, RGB,1); this.parent = parent; if (requiresCheckAlpha) { @@ -300,7 +295,8 @@ public class PImage implements PConstants, Cloneable { } } - public PImage(int width, int height, int[] pixels, boolean requiresCheckAlpha, PApplet parent, + public PImage(int width, int height, int[] pixels, + boolean requiresCheckAlpha, PApplet parent, int format, int factor) { initFromPixels(width, height, pixels, format, factor); @@ -1054,7 +1050,8 @@ public class PImage implements PConstants, Cloneable { */ protected void buildBlurKernel(float r) { int radius = (int) (r * 3.5f); - radius = (radius < 1) ? 1 : ((radius < 248) ? radius : 248); + if (radius < 1) radius = 1; + if (radius > 248) radius = 248; if (blurRadius != radius) { blurRadius = radius; blurKernelSize = 1 + blurRadius<<1; @@ -2859,8 +2856,8 @@ int testFunction(int dst, int src) { } protected boolean saveTIFF(OutputStream output) { - // shutting off the warning, people can figure this out themselves /* + // shutting off this warning, people can figure this out themselves if (format != RGB) { System.err.println("Warning: only RGB information is saved with " + ".tif files. Use .tga or .png for ARGB images and others.");