[Polycasso-commit] SF.net SVN: polycasso:[28] trunk/polycasso/src/com/mebigfatguy/polycasso/ Feedba
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-11-24 05:14:56
|
Revision: 28
http://polycasso.svn.sourceforge.net/polycasso/?rev=28&view=rev
Author: dbrosius
Date: 2009-11-24 05:14:47 +0000 (Tue, 24 Nov 2009)
Log Message:
-----------
javadoc
Modified Paths:
--------------
trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java
Modified: trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java
===================================================================
--- trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java 2009-11-24 05:12:11 UTC (rev 27)
+++ trunk/polycasso/src/com/mebigfatguy/polycasso/Feedback.java 2009-11-24 05:14:47 UTC (rev 28)
@@ -22,11 +22,20 @@
import java.awt.image.DataBufferByte;
import java.awt.image.WritableRaster;
+/**
+ * an immutable class for processing a test image against target image for closeness.
+ */
public class Feedback {
private byte[] targetBuffer;
private int size;
+ /**
+ * creates a feedback object with a given targetImage. Caches the image bytes in
+ * member variables.
+ *
+ * @param targetImage the target image that will be the judge of test images
+ */
public Feedback(BufferedImage targetImage) {
WritableRaster raster = targetImage.getRaster();
DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
@@ -34,6 +43,12 @@
size = dbb.getSize();
}
+ /**
+ * returns a score of how close the test image is to the target
+ *
+ * @param testImage the image to score
+ * @return a value that represents its closeness to ideal
+ */
public double calculateDelta(BufferedImage testImage) {
WritableRaster raster = testImage.getRaster();
DataBufferByte dbb = (DataBufferByte)raster.getDataBuffer();
@@ -63,5 +78,4 @@
return error;
}
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|