[Pixelle-commit] SF.net SVN: pixelle: [25] trunk/pixelle/src/com/mebigfatguy/pixelle/ PixelleTransf
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-06-18 04:35:04
|
Revision: 25
http://pixelle.svn.sourceforge.net/pixelle/?rev=25&view=rev
Author: dbrosius
Date: 2008-06-17 21:35:10 -0700 (Tue, 17 Jun 2008)
Log Message:
-----------
cap the pixel values to 0..1
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-18 04:12:01 UTC (rev 24)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-18 04:35:10 UTC (rev 25)
@@ -76,6 +76,10 @@
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
double value = expr.eval(pe, x, y);
+ if (value < 0.0)
+ value = 0.0;
+ else if (value > 1.0)
+ value = 1.0;
buffer.setElemDouble(y * width * 3 + x * 3 + offset, value);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|