spectorius
-
Posts
6 -
Joined
-
Last visited
Posts posted by spectorius
-
-
we could creatively debate this all day
my time is over midnight already (1:18 am)
if (intensity + this.brightness < 128) { this.rgbTable[intensity] = 0; } else { this.rgbTable[intensity] = 255; }
into
this.rgbTable[intensity] = (intensity + this.brightness < 128) ? 0 : 255;
p.s. i like simplicity very match
-
Actually, by performance it is the same, cause behind max and min there are same if else.
-
public static byte ClampToByte(double x) { if (x > 255) { return 255; } else if (x < 0) { return 0; } else { return (byte)x; } }
another thing. i think the next code is some better :wink:
public static byte ClampToByte(double x) { return (byte)Math.Min(Math.Max(x, 0), 255); }
That line of code does impact performance, but otherwise causes no harm.Why this line was there? Is it a part of the algorithm ?
ANd, where i can read about used algoritm for Reduce Noise Effect. Thanks :wink:
-
[code] int top = -Math.Min(rad, y);
-1 * Math.Min ?
Just a plain old negative sign...
So, It`s mean -1 * Math.Min() ?
-
int maxArea = GetMaxAreaForRadius(rad);
Hi! What is the point of this line??? Var maxArea is not used anywhere.
file: LocalHistogramEffect.cs
line: 161; function: RenderRect
And, BTW, what is minus in:
int top = -Math.Min(rad, y);
-1 * Math.Min ?
Thanks! 8)
LocalHistogramEffect.cs
in Plugin Developer's Central
Posted
For me it is easy
I ported Reduce Noise and Brightness & Contrast Adjustment effects to PHP, now trying Pencil Sketch