Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of RA8875 by
Diff: SlidingWindow.h
- 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
