Norimasa Okamoto / Mbed 2 deprecated SimpleJpegDecode_example

Dependencies:   BaseJpegDecode BaseUsbHost FATFileSystem mbed-rtos mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers SimpleJpegDecode.h Source File

SimpleJpegDecode.h

00001 #ifndef SIMPLE_JPEG_DECODE_H
00002 #define SIMPLE_JPEG_DECODE_H
00003 
00004 #include "BaseJpegDecode.h"
00005 #include "inverseDCT.h"
00006 
00007 #define YUV   0
00008 #define RGB24 1
00009 
00010 class SimpleJpegDecode : public BaseJpegDecode, public inverseDCT {
00011 public:
00012     SimpleJpegDecode(uint8_t output_mode=RGB24);
00013 
00014     void format_YUV(int mcu, int block, int8_t* values);
00015     void format_RGB24(int mcu, int block, int8_t* values);
00016 
00017     void output(int mcu, int block, int scan, int value);
00018     virtual void outputDC(int mcu, int block, int value);
00019     virtual void outputAC(int mcu, int block, int scan, int value);
00020     virtual void outputMARK(uint8_t c);
00021     virtual void outputBLOCK(int muc, int block, int8_t* values); // iDCT
00022 
00023     int8_t m_block_data[5][64];
00024     int DC_count;
00025     int AC_count;
00026     int BLOCK_count;
00027 
00028     ///Setups the result callback
00029     /**
00030      @param pMethod : callback function
00031      */
00032     void setOnResult( void (*pMethod)(int, int, uint8_t*) );
00033   
00034     ///Setups the result callback
00035     /**
00036     @param pItem : instance of class on which to execute the callback method
00037     @param pMethod : callback method
00038     */
00039     class CDummy;
00040     template<class T> 
00041     void setOnResult( T* pItem, void (T::*pMethod)(int, int, uint8_t*) )
00042     {
00043         m_pCb = NULL;
00044         m_pCbItem = (CDummy*) pItem;
00045         m_pCbMeth = (void (CDummy::*)(int, int, uint8_t*)) pMethod;
00046     }
00047     void clearOnResult();
00048 protected:
00049     void onResult(int x, int y, uint8_t* yuv);
00050     CDummy* m_pCbItem;
00051     void (CDummy::*m_pCbMeth)(int, int, uint8_t*);
00052     void (*m_pCb)(int, int, uint8_t*);
00053     uint8_t m_output_mode;
00054 };
00055 
00056 #endif // SIMPLE_JPEG_DECODE_H