LCD LIB
Fork of RA8875 by
Revision 122:79e431f98fa9, committed 2016-05-17
- Comitter:
- WiredHome
- Date:
- Tue May 17 22:33:06 2016 +0000
- Parent:
- 121:6bc4911f5e55
- Child:
- 123:2f45e80fec5f
- Commit message:
- Added support for JPEG rendering
Changed in this revision
--- a/DisplayDefs.h Tue May 17 22:05:43 2016 +0000 +++ b/DisplayDefs.h Tue May 17 22:33:06 2016 +0000 @@ -18,7 +18,7 @@ not_supported_format, ///< file format is not yet supported (e.g. bits per pixel, compression) image_too_big, ///< image is too large for the screen not_enough_ram, ///< could not allocate ram for scanline - touch_cal_timeout, ///< timeout while trying to calibrate touchscreen, perhaps it is not installed + touch_cal_timeout, ///< timeout while trying to calibrate touchscreen, perhaps it is not installed. external_abort, ///< an external process caused an abort LastErrCode, // Private marker. } RetCode_t;
--- a/GraphicsDisplay.cpp Tue May 17 22:05:43 2016 +0000 +++ b/GraphicsDisplay.cpp Tue May 17 22:33:06 2016 +0000 @@ -396,7 +396,6 @@ } } - RetCode_t GraphicsDisplay::RenderJpegFile(loc_t x, loc_t y, const char *Name_JPG) { #define JPEG_WORK_SPACE_SIZE 3100
--- a/GraphicsDisplay.h Tue May 17 22:05:43 2016 +0000 +++ b/GraphicsDisplay.h Tue May 17 22:33:06 2016 +0000 @@ -13,7 +13,6 @@ #ifndef MBED_GRAPHICSDISPLAY_H #define MBED_GRAPHICSDISPLAY_H - #include "Bitmap.h" #include "TextDisplay.h" #include "GraphicsDisplayJPEG.h" @@ -433,14 +432,25 @@ RetCode_t _RenderBitmap(loc_t x, loc_t y, uint32_t fileOffset, FILE * Image); private: + + /// Analyze the jpeg data in preparation for decompression. + /// JRESULT jd_prepare(JDEC * jd, uint16_t(* infunc)(JDEC * jd, uint8_t * buffer, uint16_t bufsize), void * pool, uint16_t poolsize, void * filehandle); + /// Decompress the jpeg and render it. + /// JRESULT jd_decomp(JDEC * jd, uint16_t(* outfunct)(JDEC * jd, void * stream, JRECT * rect), uint8_t scale); + /// helper function to read data from the file system + /// uint16_t privInFunc(JDEC * jd, uint8_t * buff, uint16_t ndata); + /// helper function to read data from the file system + /// uint16_t getJpegData(JDEC * jd, uint8_t *buff, uint16_t ndata); + /// helper function to write data to the display + /// uint16_t privOutFunc(JDEC * jd, void * bitmap, JRECT * rect); JRESULT mcu_output ( @@ -471,6 +481,7 @@ JDEC * jd /* Pointer to the decompressor object */ ); + protected: /// Pure virtual method to write a boolean stream to the display. ///