BaseJpegDeocde exampe program
Dependencies: BaseJpegDecode Terminal BaseUsbHost mbed mbed-rtos
Fork of BaseJpegDecode by
SimpleJpegDecode.h@4:7d88de31c55a, 2012-10-30 (annotated)
- Committer:
- va009039
- Date:
- Tue Oct 30 15:35:36 2012 +0000
- Revision:
- 4:7d88de31c55a
- Child:
- 5:033432f9baf3
add simpleJpegDecode
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
va009039 | 4:7d88de31c55a | 1 | #ifndef SIMPLE_JPEG_DECODE_H |
va009039 | 4:7d88de31c55a | 2 | #define SIMPLE_JPEG_DECODE_H |
va009039 | 4:7d88de31c55a | 3 | |
va009039 | 4:7d88de31c55a | 4 | #include "BaseJpegDecode.h" |
va009039 | 4:7d88de31c55a | 5 | #include "inverseDCT.h" |
va009039 | 4:7d88de31c55a | 6 | |
va009039 | 4:7d88de31c55a | 7 | class SimpleJpegDecode : public BaseJpegDecode, public inverseDCT { |
va009039 | 4:7d88de31c55a | 8 | public: |
va009039 | 4:7d88de31c55a | 9 | SimpleJpegDecode(); |
va009039 | 4:7d88de31c55a | 10 | void output(int mcu, int block, int scan, int value); |
va009039 | 4:7d88de31c55a | 11 | virtual void outputDC(int mcu, int block, int value); |
va009039 | 4:7d88de31c55a | 12 | virtual void outputAC(int mcu, int block, int scan, int value); |
va009039 | 4:7d88de31c55a | 13 | virtual void outputMARK(uint8_t c); |
va009039 | 4:7d88de31c55a | 14 | virtual void outputBLOCK(int muc, int block, uint8_t* values); // iDCT |
va009039 | 4:7d88de31c55a | 15 | |
va009039 | 4:7d88de31c55a | 16 | uint8_t* m_block_data[6]; |
va009039 | 4:7d88de31c55a | 17 | int DC_count; |
va009039 | 4:7d88de31c55a | 18 | int AC_count; |
va009039 | 4:7d88de31c55a | 19 | int BLOCK_count; |
va009039 | 4:7d88de31c55a | 20 | |
va009039 | 4:7d88de31c55a | 21 | ///Setups the result callback |
va009039 | 4:7d88de31c55a | 22 | /** |
va009039 | 4:7d88de31c55a | 23 | @param pMethod : callback function |
va009039 | 4:7d88de31c55a | 24 | */ |
va009039 | 4:7d88de31c55a | 25 | void setOnResult( void (*pMethod)(int, int, uint8_t*) ); |
va009039 | 4:7d88de31c55a | 26 | |
va009039 | 4:7d88de31c55a | 27 | ///Setups the result callback |
va009039 | 4:7d88de31c55a | 28 | /** |
va009039 | 4:7d88de31c55a | 29 | @param pItem : instance of class on which to execute the callback method |
va009039 | 4:7d88de31c55a | 30 | @param pMethod : callback method |
va009039 | 4:7d88de31c55a | 31 | */ |
va009039 | 4:7d88de31c55a | 32 | class CDummy; |
va009039 | 4:7d88de31c55a | 33 | template<class T> |
va009039 | 4:7d88de31c55a | 34 | void setOnResult( T* pItem, void (T::*pMethod)(int, int, uint8_t*) ) |
va009039 | 4:7d88de31c55a | 35 | { |
va009039 | 4:7d88de31c55a | 36 | m_pCb = NULL; |
va009039 | 4:7d88de31c55a | 37 | m_pCbItem = (CDummy*) pItem; |
va009039 | 4:7d88de31c55a | 38 | m_pCbMeth = (void (CDummy::*)(int, int, uint8_t*)) pMethod; |
va009039 | 4:7d88de31c55a | 39 | } |
va009039 | 4:7d88de31c55a | 40 | void clearOnResult(); |
va009039 | 4:7d88de31c55a | 41 | protected: |
va009039 | 4:7d88de31c55a | 42 | void onResult(int x, int y, uint8_t* yuv); |
va009039 | 4:7d88de31c55a | 43 | CDummy* m_pCbItem; |
va009039 | 4:7d88de31c55a | 44 | void (CDummy::*m_pCbMeth)(int, int, uint8_t*); |
va009039 | 4:7d88de31c55a | 45 | void (*m_pCb)(int, int, uint8_t*); |
va009039 | 4:7d88de31c55a | 46 | }; |
va009039 | 4:7d88de31c55a | 47 | |
va009039 | 4:7d88de31c55a | 48 | #endif // SIMPLE_JPEG_DECODE_H |