diff options
author | Camil Staps | 2015-03-25 20:52:19 +0100 |
---|---|---|
committer | Camil Staps | 2015-03-25 20:52:19 +0100 |
commit | d2789c1696f36efc13d0df53b98d2370e7476738 (patch) | |
tree | a1d6dcc03514ea32dd936c0ec95031b45f8e8077 /Week8/src/qtrees/QTNode.java | |
parent | Added week 8 (diff) |
Week 8 done
Diffstat (limited to 'Week8/src/qtrees/QTNode.java')
-rw-r--r-- | Week8/src/qtrees/QTNode.java | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/Week8/src/qtrees/QTNode.java b/Week8/src/qtrees/QTNode.java index 4498dff..26cf9e1 100644 --- a/Week8/src/qtrees/QTNode.java +++ b/Week8/src/qtrees/QTNode.java @@ -1,18 +1,40 @@ -
package qtrees;
+import java.io.IOException;
import java.io.Writer;
/**
- *
+ * Representation of a node in a QTree
* @author Sjaak Smetsers
- * @version 18-03-2014
+ * @author Camil Staps, s4498062
+ *
+ * Note: the version by Sjaak Smetsers contained a sameLeaf method. This seems to be reduntant though, so I removed it.
*/
public abstract class QTNode {
+ /**
+ * Fill a (part of a) bitmap with this node
+ * @param x the x coordinate of the top left corner
+ * @param y the y coordinate of the top left corner
+ * @param width the width of the part of the bitmap to fill
+ * @param bitmap the bitmap to fill
+ */
public abstract void fillBitmap( int x, int y, int width, Bitmap bitmap );
- public abstract void writeNode( Writer out );
- public abstract boolean sameLeaf( QTNode other_node );
+
+ /**
+ * Write a node as bitstream
+ * @param out Writer to write to
+ * @throws IOException is passed on from Writer
+ */
+ public abstract void writeNode( Writer out ) throws IOException;
+ /**
+ * Fill a complete area of a bitmap with a particular value
+ * @param x the x coordinate of the top left corner
+ * @param y the y coordinate of the top left corner
+ * @param width the width (and height) of the area to fill
+ * @param bitmap the bitmap to fill
+ * @param val the value to fill the area with
+ */
public static void fillArea( int x, int y, int width, Bitmap bitmap, boolean val ){
for (int i = 0; i < width; i++) {
for (int j = 0; j < width; j++) {
|