This is the David Smart RA8875 Library with mods for working with FRDM-K64F
Diff: GraphicsDisplay.h
- Revision:
- 115:c9862fd0c689
- Parent:
- 114:dbfb996bfbf3
- Child:
- 122:79e431f98fa9
--- a/GraphicsDisplay.h Sun May 15 18:57:06 2016 +0000 +++ b/GraphicsDisplay.h Mon May 16 02:05:37 2016 +0000 @@ -13,8 +13,10 @@ #ifndef MBED_GRAPHICSDISPLAY_H #define MBED_GRAPHICSDISPLAY_H + #include "Bitmap.h" #include "TextDisplay.h" +#include "GraphicsDisplayJPEG.h" /// The GraphicsDisplay class /// @@ -284,6 +286,16 @@ /// RetCode_t RenderImageFile(loc_t x, loc_t y, const char *FileName); + /// This method reads a disk file that is in jpeg format and + /// puts it on the screen. + /// + /// @param[in] x is the horizontal pixel coordinate + /// @param[in] y is the vertical pixel coordinate + /// @param[in] Name_JPG is the filename on the mounted file system. + /// @returns success or error code. + /// + RetCode_t RenderJpegFile(loc_t x, loc_t y, const char *Name_JPG); + /// This method reads a disk file that is in bitmap format and /// puts it on the screen. /// @@ -420,6 +432,46 @@ /// RetCode_t _RenderBitmap(loc_t x, loc_t y, uint32_t fileOffset, FILE * Image); +private: + JRESULT jd_prepare(JDEC * jd, uint16_t(* infunc)(JDEC * jd, uint8_t * buffer, uint16_t bufsize), void * pool, uint16_t poolsize, void * filehandle); + + JRESULT jd_decomp(JDEC * jd, uint16_t(* outfunct)(JDEC * jd, void * stream, JRECT * rect), uint8_t scale); + + uint16_t privInFunc(JDEC * jd, uint8_t * buff, uint16_t ndata); + + uint16_t getJpegData(JDEC * jd, uint8_t *buff, uint16_t ndata); + + uint16_t privOutFunc(JDEC * jd, void * bitmap, JRECT * rect); + + JRESULT mcu_output ( + JDEC * jd, /* Pointer to the decompressor object */ + uint16_t (* outfunc)(JDEC * jd, void * stream, JRECT * rect), /* RGB output function */ + uint16_t x, /* MCU position in the image (left of the MCU) */ + uint16_t y /* MCU position in the image (top of the MCU) */ + ); + + int16_t bitext ( /* >=0: extracted data, <0: error code */ + JDEC * jd, /* Pointer to the decompressor object */ + uint16_t nbit /* Number of bits to extract (1 to 11) */ + ); + + int16_t huffext ( /* >=0: decoded data, <0: error code */ + JDEC * jd, /* Pointer to the decompressor object */ + const uint8_t * hbits, /* Pointer to the bit distribution table */ + const uint16_t * hcode, /* Pointer to the code word table */ + const uint8_t * hdata /* Pointer to the data table */ + ); + + JRESULT restart ( + JDEC * jd, /* Pointer to the decompressor object */ + uint16_t rstn /* Expected restert sequense number */ + ); + + JRESULT mcu_load ( + JDEC * jd /* Pointer to the decompressor object */ + ); + +protected: /// Pure virtual method to write a boolean stream to the display. /// /// This takes a bit stream in memory and using the current color settings