BaseJpegDeocde exampe program

Dependencies:   BaseJpegDecode Terminal BaseUsbHost mbed mbed-rtos

Fork of BaseJpegDecode by Norimasa Okamoto

Revision:
4:7d88de31c55a
Child:
5:033432f9baf3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SimpleJpegDecode.h	Tue Oct 30 15:35:36 2012 +0000
@@ -0,0 +1,48 @@
+#ifndef SIMPLE_JPEG_DECODE_H
+#define SIMPLE_JPEG_DECODE_H
+
+#include "BaseJpegDecode.h"
+#include "inverseDCT.h"
+
+class SimpleJpegDecode : public BaseJpegDecode, public inverseDCT {
+public:
+    SimpleJpegDecode();
+    void output(int mcu, int block, int scan, int value);
+    virtual void outputDC(int mcu, int block, int value);
+    virtual void outputAC(int mcu, int block, int scan, int value);
+    virtual void outputMARK(uint8_t c);
+    virtual void outputBLOCK(int muc, int block, uint8_t* values); // iDCT
+
+    uint8_t* m_block_data[6];
+    int DC_count;
+    int AC_count;
+    int BLOCK_count;
+
+    ///Setups the result callback
+    /**
+     @param pMethod : callback function
+     */
+    void setOnResult( void (*pMethod)(int, int, uint8_t*) );
+  
+    ///Setups the result callback
+    /**
+    @param pItem : instance of class on which to execute the callback method
+    @param pMethod : callback method
+    */
+    class CDummy;
+    template<class T> 
+    void setOnResult( T* pItem, void (T::*pMethod)(int, int, uint8_t*) )
+    {
+        m_pCb = NULL;
+        m_pCbItem = (CDummy*) pItem;
+        m_pCbMeth = (void (CDummy::*)(int, int, uint8_t*)) pMethod;
+    }
+    void clearOnResult();
+protected:
+    void onResult(int x, int y, uint8_t* yuv);
+    CDummy* m_pCbItem;
+    void (CDummy::*m_pCbMeth)(int, int, uint8_t*);
+    void (*m_pCb)(int, int, uint8_t*);
+};
+
+#endif // SIMPLE_JPEG_DECODE_H
\ No newline at end of file