Guillermo Stedile / RA8875

Dependencies:   GPS

Dependents:   SNOCC_V1 SNOCC_V2

Fork of RA8875 by SNOCC

Revision:
63:ed787f5fcdc4
diff -r 86d24b9480b9 -r ed787f5fcdc4 SlidingWindow.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SlidingWindow.h	Sun Mar 23 16:27:55 2014 +0000
@@ -0,0 +1,33 @@
+#ifndef SLIDINGWINDOW_H
+#define SLIDINGWINDOW_H
+#include <mbed.h>
+
+// Used by PNG.cpp
+
+class SlidingWindow
+{
+public:
+    typedef enum
+    {
+        noerror,
+        outofmemory
+    } Status_T;
+    SlidingWindow(int desiredSize, int allowedSize);
+    ~SlidingWindow();
+
+    bool set(int x, unsigned char value);
+    unsigned char get(int foreDistance, int backDistance);
+    Status_T status(void) {
+        return m_status;
+    }
+private:
+    unsigned char * m_buf;
+    int m_forewardUsed;
+    int m_backwardUsed;
+    int m_desiredSize;
+    int m_allowedSize;
+    unsigned char * m_used;
+    Status_T m_status;
+};
+
+#endif // SLIDINGWINDOW_H