[Pixelle-commit] SF.net SVN: pixelle: [28] trunk/pixelle/src/com/mebigfatguy/pixelle
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2008-06-20 02:53:08
|
Revision: 28
http://pixelle.svn.sourceforge.net/pixelle/?rev=28&view=rev
Author: dbrosius
Date: 2008-06-19 19:53:12 -0700 (Thu, 19 Jun 2008)
Log Message:
-----------
use range of 0 - 255, rather than 0 - 1 as that is more understandable
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelEval.java
trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelEval.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelEval.java 2008-06-19 05:52:07 UTC (rev 27)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelEval.java 2008-06-20 02:53:12 UTC (rev 28)
@@ -64,7 +64,7 @@
return 0.0;
}
- return buffer.getElemDouble(y * width * 3 + x * 3 + offset);
+ return (double)buffer.getElem(y * width * 3 + x * 3 + offset);
}
public int getWidth() {
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-19 05:52:07 UTC (rev 27)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/PixelleTransformer.java 2008-06-20 02:53:12 UTC (rev 28)
@@ -75,11 +75,11 @@
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)
+ if (value < 0.0)
value = 0.0;
- else if (value > 1.0)
- value = 1.0;*/
- buffer.setElemDouble(y * width * 3 + x * 3 + offset, value);
+ else if (value > 255.0)
+ value = 255.0;
+ buffer.setElem(y * width * 3 + x * 3 + offset, (int)(value + 0.49));
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|