Steven Rhodes / CNCAirbrush
Revision:
0:461ddbab4fd1
Child:
2:6d2a681c5cdf
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Bitmap.h	Mon Apr 16 23:10:37 2012 +0000
@@ -0,0 +1,86 @@
+/**
+* @author Steven Rhodes
+*
+* @section LICENSE
+*
+* Copyright (c) 2012 Steven Rhodes
+*
+* Permission is hereby granted, free of charge, to any person obtaining a copy
+* of this software and associated documentation files (the "Software"), to deal
+* in the Software without restriction, including without limitation the rights
+* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+* copies of the Software, and to permit persons to whom the Software is
+* furnished to do so, subject to the following conditions:
+*
+* The above copyright notice and this permission notice shall be included in
+* all copies or substantial portions of the Software.
+*
+* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+* THE SOFTWARE.
+
+*/
+
+#ifndef BITMAP_H
+#define BITMAP_H
+
+#include "mbed.h"
+
+struct Row {
+    int rowNum;
+    long * string;
+    int length;
+    
+    /**
+    * Get the pixel at a position
+    * @param pixel column
+    *
+    * @return true if the pixel is black
+    */
+    bool pixel(int column);
+};
+
+class Bitmap {
+
+    /**
+    * Constructor to deal with bitmap
+    *
+    * @param tx mbed pin to use for tx line of Serial interface
+    * @param rx mbed pin to use for rx line of Serial interface
+    * @param ssid ssid of the adhoc network which will be created
+    */
+    Bitmap ();
+
+    /**
+    * Load an image into the bitmap.
+    *
+    * @return true if the image is successfully loaded
+    */
+    bool loadImg(char* filename);
+
+    /**
+    * Retrieve the selected row.
+    *
+    * @return a pointer to a row struct
+    */
+    Row * getRow(int row);
+
+    /**
+    * Return the height of the bitmap
+    *
+    * @return height
+    */
+    int getHeight();
+
+    /**
+    * Return the width of the bitmap
+    *
+    * @return width
+    */
+    int getWidth();
+};
+#endif
\ No newline at end of file