NuMaker emWin HMI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers GUI_GIF_Private.h Source File

GUI_GIF_Private.h

00001 /*********************************************************************
00002 *                 SEGGER Software GmbH                               *
00003 *        Solutions for real time microcontroller applications        *
00004 **********************************************************************
00005 *                                                                    *
00006 *        (c) 1996 - 2018  SEGGER Microcontroller GmbH                *
00007 *                                                                    *
00008 *        Internet: www.segger.com    Support:  support@segger.com    *
00009 *                                                                    *
00010 **********************************************************************
00011 
00012 ** emWin V5.48 - Graphical user interface for embedded applications **
00013 All  Intellectual Property rights in the Software belongs to  SEGGER.
00014 emWin is protected by  international copyright laws.  Knowledge of the
00015 source code may not be used to write a similar product. This file may
00016 only be used in accordance with the following terms:
00017 
00018 The  software has  been licensed by SEGGER Software GmbH to Nuvoton Technology Corporationat the address: No. 4, Creation Rd. III, Hsinchu Science Park, Taiwan
00019 for the purposes  of  creating  libraries  for its 
00020 Arm Cortex-M and  Arm9 32-bit microcontrollers, commercialized and distributed by Nuvoton Technology Corporation
00021 under  the terms and conditions  of  an  End  User  
00022 License  Agreement  supplied  with  the libraries.
00023 Full source code is available at: www.segger.com
00024 
00025 We appreciate your understanding and fairness.
00026 ----------------------------------------------------------------------
00027 Licensing information
00028 Licensor:                 SEGGER Software GmbH
00029 Licensed to:              Nuvoton Technology Corporation, No. 4, Creation Rd. III, Hsinchu Science Park, 30077 Hsinchu City, Taiwan
00030 Licensed SEGGER software: emWin
00031 License number:           GUI-00735
00032 License model:            emWin License Agreement, signed February 27, 2018
00033 Licensed platform:        Cortex-M and ARM9 32-bit series microcontroller designed and manufactured by or for Nuvoton Technology Corporation
00034 ----------------------------------------------------------------------
00035 Support and Update Agreement (SUA)
00036 SUA period:               2018-03-26 - 2019-03-27
00037 Contact to extend SUA:    sales@segger.com
00038 ----------------------------------------------------------------------
00039 File        : GUI_GIF_Private.h
00040 Purpose     : Private header file for GUI_GIF... functions
00041 ---------------------------END-OF-HEADER------------------------------
00042 */
00043 
00044 #ifndef GUI_GIF_PRIVATE_H
00045 #define GUI_GIF_PRIVATE_H
00046 
00047 #include "GUI_Private.h"
00048 
00049 /*********************************************************************
00050 *
00051 *       Defines
00052 *
00053 **********************************************************************
00054 */
00055 #define MAX_NUM_LWZ_BITS 12
00056 
00057 /*********************************************************************
00058 *
00059 *       Types
00060 *
00061 **********************************************************************
00062 */
00063 /* Context structure */
00064 typedef struct {
00065   /* Required for getting input */
00066   unsigned            NumBytesInBuffer;     /* Remaining bytes in buffer */
00067   const U8          * pBuffer;              /* Pointer into buffer for reading data */
00068   GUI_GET_DATA_FUNC * pfGetData;            /* Function pointer */
00069   void              * pParam;               /* Parameter pointer passed to function */
00070   U32                 Off;                  /* Data pointer */
00071   /* Decompression data */
00072   U8    aBuffer[258];                       /* Input buffer for data block */
00073   short aCode  [(1 << MAX_NUM_LWZ_BITS)];   /* This array stores the LZW codes for the compressed strings */
00074   U8    aPrefix[(1 << MAX_NUM_LWZ_BITS)];   /* Prefix character of the LZW code. */
00075   U8    aDecompBuffer[3000];                /* Decompression buffer. The higher the compression, the more bytes are needed in the buffer. */
00076   U8 *  sp;                                 /* Pointer into the decompression buffer */
00077   int   CurBit;
00078   int   LastBit;
00079   int   GetDone;
00080   int   LastByte;
00081   int   ReturnClear;
00082   int   CodeSize;
00083   int   SetCodeSize;
00084   int   MaxCode;
00085   int   MaxCodeSize;
00086   int   ClearCode;
00087   int   EndCode;
00088   int   FirstCode;
00089   int   OldCode;
00090   /* Palette buffer */
00091   GUI_COLOR aColorTable[256];
00092 } GUI_GIF_CONTEXT;
00093 
00094 typedef struct {
00095   int XPos;
00096   int YPos;
00097   int XSize;
00098   int YSize;
00099   int Flags;
00100   int NumColors;
00101 } IMAGE_DESCRIPTOR;
00102 
00103 /* Default parameter structure for reading data from memory */
00104 typedef struct {
00105   const U8 * pFileData;
00106   U32   FileSize;
00107 } GUI_GIF_PARAM;
00108 
00109 typedef int  DRAW_FROM_DATABLOCK(GUI_GIF_CONTEXT * pContext, IMAGE_DESCRIPTOR * pDescriptor, int x0, int y0, int Transparency, int Disposal, int Num, int Denom);
00110 typedef void CLEAR_UNUSED_PIXELS(int x0, int y0, IMAGE_DESCRIPTOR * pDescriptor, GUI_GIF_IMAGE_INFO * pInfo, int Num, int Denom);
00111 
00112 /*********************************************************************
00113 *
00114 *       Private data
00115 *
00116 **********************************************************************
00117 */
00118 extern const int GUI_GIF__aInterlaceOffset[4];
00119 extern const int GUI_GIF__aInterlaceYPos[4];
00120 
00121 /*********************************************************************
00122 *
00123 *       Interface
00124 *
00125 **********************************************************************
00126 */
00127 int  GUI_GIF__ReadData(GUI_GIF_CONTEXT * pContext, unsigned NumBytes, const U8 ** ppData, unsigned StartOfFile);
00128 int  GUI_GIF__GetData(void * p, const U8 ** ppData, unsigned NumBytesReq, U32 Off);
00129 int  GUI_GIF__DrawFromFilePointer(GUI_GIF_CONTEXT * pContext, int x0, int y0, int Index, int Num, int Denom, DRAW_FROM_DATABLOCK pfDrawFromDataBlock, CLEAR_UNUSED_PIXELS pfClearUnusedPixels);
00130 void GUI_GIF__InitLZW(GUI_GIF_CONTEXT * pContext, int InputCodeSize);
00131 int  GUI_GIF__GetNextByte(GUI_GIF_CONTEXT * pContext);
00132 
00133 #endif /* GUI_GIF_PRIVATE_H */