亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? gui_gif.c

?? UC_GUI開發源代碼,里面含有范例,源文件
?? C
?? 第 1 頁 / 共 3 頁
字號:
/*
*********************************************************************************************************
*                                             uC/GUI V3.98
*                        Universal graphic software for embedded applications
*
*                       (c) Copyright 2002, Micrium Inc., Weston, FL
*                       (c) Copyright 2002, SEGGER Microcontroller Systeme GmbH
*
*              礐/GUI is protected by international copyright laws. Knowledge of the
*              source code may not be used to write a similar product. This file may
*              only be used in accordance with a license and should not be redistributed
*              in any way. We appreciate your understanding and fairness.
*
----------------------------------------------------------------------
File        : GUI_GIF.c
Purpose     : Implementation of rendering GIF images
---------------------------END-OF-HEADER------------------------------
*/

#include <stdlib.h>
#include <string.h>

#include "GUI_Private.h"

/*********************************************************************
*
*       Defines
*
**********************************************************************
*/
#define GIF_INTRO_TERMINATOR ';'
#define GIF_INTRO_EXTENSION  '!'
#define GIF_INTRO_IMAGE      ','

#define GIF_COMMENT     0xFE
#define GIF_APPLICATION 0xFF
#define GIF_PLAINTEXT   0x01
#define GIF_GRAPHICCTL  0xF9

#define MAX_NUM_LWZ_BITS 12

/*********************************************************************
*
*       Types
*
**********************************************************************
*/
typedef struct {
  const U8 * pSrc; /* Pointer used for reading the data */
  int RemBytes;    /* Number of remaining bytes */
} SOURCE;

typedef struct {
  int XPos;
  int YPos;
  int XSize;
  int YSize;
  int Flags;
  int NumColors;
} IMAGE_DESCRIPTOR;

typedef struct {
  U8    aBuffer[258];                     /* Input buffer for data block */
  short aCode  [(1 << MAX_NUM_LWZ_BITS)]; /* This array stores the LZW codes for the compressed strings */
  U8    aPrefix[(1 << MAX_NUM_LWZ_BITS)]; /* Prefix character of the LZW code. */
  U8    aDecompBuffer[3000];              /* Decompression buffer. The higher the compression, the more bytes are needed in the buffer. */
  U8 *  sp;                               /* Pointer into the decompression buffer */
  int   CurBit;
  int   LastBit;
  int   GetDone;
  int   LastByte;
  int   ReturnClear;
  int   CodeSize;
  int   SetCodeSize;
  int   MaxCode;
  int   MaxCodeSize;
  int   ClearCode;
  int   EndCode;
  int   FirstCode;
  int   OldCode;
} LZW_CONTEXT;

/*********************************************************************
*
*       Static const
*
**********************************************************************
*/
static const int _aMaskTbl[16] = {
  0x0000, 0x0001, 0x0003, 0x0007,
  0x000f, 0x001f, 0x003f, 0x007f,
  0x00ff, 0x01ff, 0x03ff, 0x07ff,
  0x0fff, 0x1fff, 0x3fff, 0x7fff,
};

static const int _aInterlaceOffset[] = {  8, 8, 4, 2 };
static const int _aInterlaceYPos[]   = {  0, 4, 2, 1 };

/*********************************************************************
*
*       Static data
*
**********************************************************************
*/
LZW_CONTEXT _LZWContext;
GUI_COLOR   _aColorTable[256];
SOURCE      _Source;
static U8   _aBuffer[256];

/*********************************************************************
*
*       Static code
*
**********************************************************************
*/
/*********************************************************************
*
*       _ReadU8
*
* Purpose:
*   Reads one byte from the given pointer if possible and increments the pointer
*/
static U8 _ReadU8(void) {
  U8 Value;
  _Source.RemBytes -= 1;
  if (_Source.RemBytes < 0) {
    return 0;
  }
  Value = *(_Source.pSrc++);
  return Value;
}

/*********************************************************************
*
*       _ReadU16
*
* Purpose:
*   Reads a word from the given pointer if possible and increments the pointer
*/
static U16 _ReadU16(void) {
  U16 Value;
  U8 Byte0, Byte1;
  Byte0 = _ReadU8();
  Byte1 = _ReadU8();
  Value = (Byte1 << 8) | Byte0;
  return Value;
}

/*********************************************************************
*
*       _ReadBytes
*
* Purpose:
*   Reads a string from the given pointer if possible and increments the pointer
*/
static void _ReadBytes(U8 * pBuffer, int Len) {
  if (_Source.RemBytes < 0) {
    return;
  }
  if (_Source.RemBytes < Len) {
    Len = _Source.RemBytes;
    return;
  }
  _Source.RemBytes -= Len;
  memcpy(pBuffer, _Source.pSrc, Len);
  _Source.pSrc += Len;
}

/*********************************************************************
*
*       _SkipBytes
*
* Purpose:
*   Skips the number of given bytes and increments the pointer
*/
static void _SkipBytes(int Len) {
  if (_Source.RemBytes < 0) {
    return;
  }
  if (_Source.RemBytes < Len) {
    Len = _Source.RemBytes;
    return;
  }
  _Source.RemBytes -= Len;
  _Source.pSrc += Len;
}

/*********************************************************************
*
*       _InitLWZ
*
* Purpose:
*   Initializes the given LZW with the input code size
*/
static void _InitLZW(int InputCodeSize) {
  GUI__memset((U8 *)&_LZWContext, 0, sizeof(LZW_CONTEXT));
  _LZWContext.SetCodeSize  = InputCodeSize;
  _LZWContext.CodeSize     = InputCodeSize + 1;
  _LZWContext.ClearCode    = (1 << InputCodeSize);
  _LZWContext.EndCode      = (1 << InputCodeSize) + 1;
  _LZWContext.MaxCode      = (1 << InputCodeSize) + 2;
  _LZWContext.MaxCodeSize  = (1 << InputCodeSize) << 1;
  _LZWContext.ReturnClear  = 1;
  _LZWContext.LastByte     = 2;
  _LZWContext.sp           = _LZWContext.aDecompBuffer;
}

/*********************************************************************
*
*       _GetDataBlock
*
* Purpose:
*   Reads a LZW data block. The first byte contains the length of the block,
*   so the maximum length is 256 byte
*
* Return value:
*   Length of the data block
*/
static int _GetDataBlock(U8 * pBuffer) {
  U8 Count;
  Count = _ReadU8(); /* Read the length of the data block */
  if (Count) {
    if (pBuffer) {
      _ReadBytes(pBuffer, Count);
    } else {
      _Source.pSrc += Count;
    }
  }
  return((int)Count);
}

/*********************************************************************
*
*       _GetNextCode
*
* Purpose:
*   Returns the next LZW code from the LZW stack. One LZW code contains up to 12 bits.
*
* Return value:
*   >= 0 if succeed
*   <  0 if not succeed
*/
static int _GetNextCode(void) {
  int i, j, End;
  long Result;
  if (_LZWContext.ReturnClear) {
    /* The first code should be a clear code. */
    _LZWContext.ReturnClear = 0;
    return _LZWContext.ClearCode;
  }
  End = _LZWContext.CurBit + _LZWContext.CodeSize;
  if (End >= _LZWContext.LastBit) {
    int Count;
    if (_LZWContext.GetDone) {
      return -1; /* Error */
    }
    _LZWContext.aBuffer[0] = _LZWContext.aBuffer[_LZWContext.LastByte - 2];
    _LZWContext.aBuffer[1] = _LZWContext.aBuffer[_LZWContext.LastByte - 1];
    if ((Count = _GetDataBlock(&_LZWContext.aBuffer[2])) == 0) {
      _LZWContext.GetDone = 1;
    }
    if (Count < 0) {
      return -1; /* Error */
    }
    _LZWContext.LastByte = 2 + Count;
    _LZWContext.CurBit   = (_LZWContext.CurBit - _LZWContext.LastBit) + 16;
    _LZWContext.LastBit  = (2 + Count) * 8 ;
    End                  = _LZWContext.CurBit + _LZWContext.CodeSize;
  }
  j = End >> 3;
  i = _LZWContext.CurBit >> 3;
  if (i == j) {
    Result = (long)_LZWContext.aBuffer[i];
  } else if (i + 1 == j) {
    Result = (long)_LZWContext.aBuffer[i] | ((long)_LZWContext.aBuffer[i + 1] << 8);
  }  else {
    Result = (long)_LZWContext.aBuffer[i] | ((long)_LZWContext.aBuffer[i + 1] << 8) | ((long)_LZWContext.aBuffer[i + 2] << 16);
  }
  Result = (Result >> (_LZWContext.CurBit & 0x7)) & _aMaskTbl[_LZWContext.CodeSize];
  _LZWContext.CurBit += _LZWContext.CodeSize;
  return (int)Result;
}

/*********************************************************************
*
*       _GetNextByte
*
* Purpose:
*   Reads the next LZW code from the LZW stack and returns the first byte from the LZW code.
*
* Return value:
*   >= 0 if succeed
*   -1   if not succeed
*   -2   if end code has been read
*/
static int _GetNextByte(void) {
  int i, Code, Incode;
  while ((Code = _GetNextCode()) >= 0) {
    if (Code == _LZWContext.ClearCode) {
      /* Corrupt GIFs can make this happen */
      if (_LZWContext.ClearCode >= (1 << MAX_NUM_LWZ_BITS)) {
        return -1; /* Error */
      }
      /* Clear the tables */
      GUI__memset((U8 *)_LZWContext.aCode, 0, sizeof(_LZWContext.aCode));
      for (i = 0; i < _LZWContext.ClearCode; ++i) {
        _LZWContext.aPrefix[i] = i;
      }
      /* Calculate the 'special codes' in dependence of the initial code size
         and initialize the stack pointer */
      _LZWContext.CodeSize    = _LZWContext.SetCodeSize + 1;
      _LZWContext.MaxCodeSize = _LZWContext.ClearCode << 1;
      _LZWContext.MaxCode     = _LZWContext.ClearCode + 2;
      _LZWContext.sp          = _LZWContext.aDecompBuffer;
      /* Read the first code from the stack after clearing and initializing */
      do {
        _LZWContext.FirstCode = _GetNextCode();
      } while (_LZWContext.FirstCode == _LZWContext.ClearCode);
      _LZWContext.OldCode = _LZWContext.FirstCode;
      return _LZWContext.FirstCode;
    }
    if (Code == _LZWContext.EndCode) {
      return -2; /* End code */
    }
    Incode = Code;
    if (Code >= _LZWContext.MaxCode) {
      *(_LZWContext.sp)++ = _LZWContext.FirstCode;
      Code = _LZWContext.OldCode;
    }
    while (Code >= _LZWContext.ClearCode) {
      *(_LZWContext.sp)++ = _LZWContext.aPrefix[Code];
      if (Code == _LZWContext.aCode[Code]) {
        return Code;
      }
      if ((_LZWContext.sp - _LZWContext.aDecompBuffer) >= sizeof(_LZWContext.aDecompBuffer)) {
        return Code;
      }
      Code = _LZWContext.aCode[Code];
    }
    *(_LZWContext.sp)++ = _LZWContext.FirstCode = _LZWContext.aPrefix[Code];
    if ((Code = _LZWContext.MaxCode) < (1 << MAX_NUM_LWZ_BITS)) {
      _LZWContext.aCode  [Code] = _LZWContext.OldCode;
      _LZWContext.aPrefix[Code] = _LZWContext.FirstCode;
      ++_LZWContext.MaxCode;
      if ((_LZWContext.MaxCode >= _LZWContext.MaxCodeSize) && (_LZWContext.MaxCodeSize < (1 << MAX_NUM_LWZ_BITS))) {
        _LZWContext.MaxCodeSize <<= 1;
        ++_LZWContext.CodeSize;
      }
    }
    _LZWContext.OldCode = Incode;
    if (_LZWContext.sp > _LZWContext.aDecompBuffer) {
      return *--(_LZWContext.sp);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av在线资源网站| 亚洲成人综合在线| 欧美午夜一区二区三区| 日本大胆欧美人术艺术动态| 日本一区二区三区视频视频| 欧美在线观看一区| 五月综合激情日本mⅴ| www国产精品av| 色综合久久久久综合体桃花网| 午夜精品久久久久久久久| 精品国产乱子伦一区| 91丨九色丨蝌蚪丨老版| 久久精品国产77777蜜臀| 亚洲少妇中出一区| 精品国产91乱码一区二区三区| 成人av免费在线| 狠狠色丁香久久婷婷综| 国产精品伦一区| 欧美mv和日韩mv的网站| 欧美亚洲国产一区二区三区va | 欧美日韩精品一区视频| 国产成人在线影院| 美腿丝袜亚洲色图| 亚洲国产精品ⅴa在线观看| 在线播放亚洲一区| 在线免费精品视频| 成人激情免费视频| 国产精品资源网| 日本不卡在线视频| 中文字幕一区二区不卡 | 久久这里只有精品视频网| 在线观看三级视频欧美| 不卡一区二区三区四区| 国产自产视频一区二区三区| 日韩精品成人一区二区三区| 亚洲免费av网站| 国产精品久久久久久久久久久免费看| 欧美日韩一区二区三区免费看| 不卡的电影网站| 国产乱码精品一区二区三| 免费在线看一区| 日本午夜一区二区| 一区在线播放视频| 国产精品理伦片| 国产欧美日韩久久| 久久精品一级爱片| 日韩一级片在线观看| 欧美日韩大陆在线| 欧美日韩精品一区视频| a亚洲天堂av| 91小视频免费观看| 99精品视频在线观看| 成人精品鲁一区一区二区| 国产乱一区二区| 国产高清精品久久久久| 国产一区不卡视频| 国产美女在线观看一区| 精彩视频一区二区三区| 激情亚洲综合在线| 狠狠色丁香久久婷婷综| 国产一区 二区| 国产xxx精品视频大全| 奇米一区二区三区av| 亚洲成人动漫在线观看| 日本成人在线不卡视频| 国产精品自拍毛片| 欧美高清在线视频| 亚洲女同女同女同女同女同69| 午夜精品一区二区三区电影天堂 | 国产一本一道久久香蕉| 97久久超碰精品国产| 欧美日本在线播放| 久久婷婷久久一区二区三区| 最近日韩中文字幕| 日韩av中文字幕一区二区| 国产河南妇女毛片精品久久久| 91女厕偷拍女厕偷拍高清| 欧美日韩免费一区二区三区视频 | 亚洲超丰满肉感bbw| 久久99精品久久久久久| 97精品久久久久中文字幕| 欧美人伦禁忌dvd放荡欲情| 久久久久久久综合日本| 亚洲国产精品久久久久秋霞影院| 国产在线播精品第三| 欧美性一区二区| 欧美高清在线一区二区| 青青草国产精品97视觉盛宴| a美女胸又www黄视频久久| 欧美一区二区视频在线观看| 国产精品国产自产拍高清av| 日日摸夜夜添夜夜添亚洲女人| 大白屁股一区二区视频| 51精品视频一区二区三区| 国产成人99久久亚洲综合精品| 欧美影视一区在线| 久久久亚洲国产美女国产盗摄 | 久久精品国产精品亚洲精品| 91麻豆精品一区二区三区| 2023国产精品视频| 日韩成人精品在线| 色综合久久中文字幕| 国产精品无圣光一区二区| 免费高清视频精品| 精品视频在线看| 亚洲欧美色图小说| 成人性色生活片| 久久久久久免费| 美女任你摸久久| 91精品啪在线观看国产60岁| 亚洲你懂的在线视频| 懂色av一区二区三区免费看| 精品久久免费看| 日本vs亚洲vs韩国一区三区| 欧美伊人精品成人久久综合97| 国产精品久久久久影视| 国产一区二区女| 亚洲精品一区二区精华| 麻豆成人av在线| 欧美麻豆精品久久久久久| 亚洲小说春色综合另类电影| 99re免费视频精品全部| 欧美激情一区二区三区不卡| 国产成人自拍在线| 国产亚洲一区二区三区在线观看| 美女免费视频一区| 欧美电影免费观看高清完整版| 午夜免费欧美电影| 制服.丝袜.亚洲.另类.中文| 午夜久久福利影院| 欧美乱熟臀69xxxxxx| 丝袜美腿成人在线| 91精品国产综合久久久久久久久久 | 精品美女一区二区| 久久国产人妖系列| 日韩精品一区二区三区在线播放| 蜜桃视频免费观看一区| 日韩欧美一区二区免费| 久99久精品视频免费观看| 日韩欧美综合一区| 国产在线视频一区二区三区| 国产亚洲综合av| 不卡的av中国片| 成人欧美一区二区三区| 色悠悠久久综合| 性欧美疯狂xxxxbbbb| 日韩无一区二区| 国产精品一区一区| 国产精品乱子久久久久| 91福利在线免费观看| 亚洲国产成人91porn| 日韩欧美国产综合一区| 国产最新精品精品你懂的| 中文字幕av不卡| 在线观看一区二区精品视频| 天天影视色香欲综合网老头| 欧美第一区第二区| 懂色av一区二区三区蜜臀| 一片黄亚洲嫩模| 欧美一区二区三区在线视频| 国内精品国产成人国产三级粉色 | 国内精品不卡在线| 中文字幕制服丝袜成人av| 色综合天天天天做夜夜夜夜做| 亚洲一区在线免费观看| 日韩亚洲欧美在线观看| 成人午夜视频在线| 午夜日韩在线电影| 国产午夜精品一区二区三区视频| 91视视频在线观看入口直接观看www| 亚洲综合在线免费观看| 精品国产乱码久久久久久图片| 99综合电影在线视频| 男人的天堂亚洲一区| 国产精品免费网站在线观看| 欧美日韩免费高清一区色橹橹 | 亚洲国产精品自拍| 久久久亚洲综合| 欧美主播一区二区三区| 国产一区二区三区四区五区美女 | 国产精品99久久久久久有的能看| 亚洲欧美日韩综合aⅴ视频| 日韩欧美国产一区二区在线播放| 成人在线视频首页| 日韩av午夜在线观看| 中文一区二区在线观看| 欧美精品v日韩精品v韩国精品v| 国产91清纯白嫩初高中在线观看| 亚洲成人激情自拍| 国产精品久久综合| 日韩精品一区二区三区老鸭窝| 在线精品视频一区二区三四| 国产乱码精品一品二品| 日韩国产在线一| 亚洲日本va午夜在线影院| 日韩精品一区二区三区在线播放| 欧美影视一区在线| 久久久精品国产免大香伊| 在线不卡免费欧美| 欧美影视一区在线|