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

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

?? gui_gif.c

?? UC_GUI開發源代碼,里面含有范例,源文件
?? C
?? 第 1 頁 / 共 3 頁
字號:
    }
  }
  return Code;
}

/*********************************************************************
*
*       _ReadExtension
*
* Purpose:
*   Reads an extension block. One extension block can consist of several data blocks.
*   If an unknown extension block occures, the routine failes.
*/
static int _ReadExtension(int * pTransIndex, GUI_GIF_IMAGE_INFO * pInfo, U8 * pDisposal) {
  U8 Label;
  Label = _ReadU8();
  switch (Label) {
  case GIF_PLAINTEXT:
  case GIF_APPLICATION:
  case GIF_COMMENT:
    while (_GetDataBlock(_aBuffer) > 0);
    return 0;
  case GIF_GRAPHICCTL:
    if (_GetDataBlock(_aBuffer) != 4) { /* Length of a graphic control block must be 4 */
      return 1;
    }
    if (pInfo) {
      pInfo->Delay    = (_aBuffer[2] << 8) | _aBuffer[1];
    }
    if (pDisposal) {
      *pDisposal = (_aBuffer[0] >> 2) & 0x7;
    }
    if (pTransIndex) {
      if ((_aBuffer[0] & 0x1) != 0) {
        *pTransIndex = _aBuffer[3];
      }
    }
    if (_ReadU8() != 0) { /* Read block terminator */
      return 1;
    }
    return 0;
  }
  return 1; /* Error */
}

/*********************************************************************
*
*       _ReadComment
*
* Purpose:
*   Reads a comment from the extension block if available and returns the number
*   of comment bytes.
*/
static int _ReadComment(U8 * pBuffer, int MaxSize, int * pSize) {
  U8 Label;
  int Size;
  Label = _ReadU8();
  switch (Label) {
  case GIF_PLAINTEXT:
  case GIF_APPLICATION:
    while (_GetDataBlock(_aBuffer) > 0);
    return 0;
  case GIF_COMMENT:
    Size = _GetDataBlock(_aBuffer);
    if (Size > MaxSize) {
      Size = MaxSize;
    }
    if (pBuffer) {
      *pSize = Size;
      memcpy(pBuffer, _aBuffer, Size);
    }
    return 0;
  case GIF_GRAPHICCTL:
    if (_GetDataBlock(_aBuffer) != 4) { /* Length of a graphic control block must be 4 */
      return 1;
    }
    if (_ReadU8() != 0) { /* Read block terminator, must be 0 */
      return 1;
    }
    return 0;
  }
  return 1; /* Error */
}

/*********************************************************************
*
*       _DispGIFImage
*
* Purpose:
*   This routine draws a GIF image from the current pointer which should point to a
*   valid GIF data block. The size of the desired image is given in the image descriptor.
*
* Return value:
*   0 if succeed
*   1 if not succeed
*
* Parameters:
*   pDescriptor  - Points to a IMAGE_DESCRIPTOR structure, which contains infos about size, colors and interlacing.
*   x0, y0       - Obvious.
*   Transparency - Color index which should be treated as transparent.
*   Disposal     - Contains the disposal method of the previous image. If Disposal == 2, the transparent pixels
*                  of the image are rendered with the background color.
*/
static int _DispGIFImage(IMAGE_DESCRIPTOR * pDescriptor, int x0, int y0, int Transparency, int Disposal) {
  int Codesize, Index, OldIndex, XPos, YPos, YCnt, Pass, Interlace, XEnd;
  int Width, Height, NumColors, Cnt, BkColorIndex, ColorIndex;
  LCD_LOGPALETTE LogPalette;
  const LCD_PIXELINDEX * pTrans;
  Width     = pDescriptor->XSize;
  Height    = pDescriptor->YSize;
  NumColors = pDescriptor->NumColors;
  XEnd      = Width + x0 - 1;
  BkColorIndex = LCD_GetBkColorIndex();
  /* Get color translation table  */
  LogPalette.NumEntries  = NumColors;
  LogPalette.HasTrans    = 0;
  LogPalette.pPalEntries = _aColorTable;
  if ((pTrans = LCD_GetpPalConvTable((const LCD_LOGPALETTE *)&LogPalette)) == NULL) {
    return 1; /* Error */
  }
  Codesize  = _ReadU8();                 /* Read the LZW codesize */
  _InitLZW(Codesize);                    /* Initialize the LZW stack with the LZW codesize */
  Interlace = pDescriptor->Flags & 0x40; /* Evaluate if image is interlaced */
  for (YCnt = 0, YPos = y0, Pass = 0; YCnt < Height; YCnt++) {
    Cnt      = 0;
    OldIndex = -1;    
    for (XPos = x0; XPos <= XEnd; XPos++) {
      if (_LZWContext.sp > _LZWContext.aDecompBuffer) {
        Index = *--(_LZWContext.sp);
      } else {
        Index = _GetNextByte();
      }
      if (Index == -2) {
        return 0; /* End code */
      }
      if ((Index < 0) || (Index >= NumColors)) {
        /* If Index out of legal range stop decompressing */
        return 1; /* Error */
      }
      /* If current index equals old index increment counter */
      if ((Index == OldIndex) && (XPos <= XEnd)) {
        Cnt++;
      } else {
        if (Cnt) {
          if (OldIndex != Transparency) {
            LCD_SetColorIndex(*(pTrans + OldIndex));
            LCD_DrawHLine(XPos - Cnt - 1, YPos, XPos - 1);
          } else if (Disposal == 2) {
            LCD_SetColorIndex(BkColorIndex);
            LCD_DrawHLine(XPos - Cnt - 1, YPos, XPos - 1);
          }
          Cnt = 0;
        } else {
          if (OldIndex >= 0) {
            if (OldIndex != Transparency) {
              LCD_SetPixelIndex(XPos - 1, YPos, *(pTrans + OldIndex));
            } else if (Disposal == 2) {
              LCD_SetPixelIndex(XPos - 1, YPos, BkColorIndex);
            }
          }
        }
      }
      OldIndex = Index;
    }
    if ((OldIndex != Transparency) || (Disposal == 2)) {
      if (OldIndex != Transparency) {
        ColorIndex = *(pTrans + OldIndex);
      } else {
        ColorIndex = BkColorIndex;
      }
      if (Cnt) {
        LCD_SetColorIndex(ColorIndex);
        LCD_DrawHLine(XPos - Cnt - 1, YPos, XPos - 1);
      } else {
        LCD_SetPixelIndex(XEnd, YPos, ColorIndex);
      }
    }
    /* Adjust YPos if image is interlaced */
    if (Interlace) {
      YPos += _aInterlaceOffset[Pass];
      if ((YPos - y0) >= Height) {
        ++Pass;
        YPos = _aInterlaceYPos[Pass] + y0;
      }
    } else {
      YPos++;
    }
  }
  return 0;
}

/*********************************************************************
*
*       _ReadColorMap
*/
static int _ReadColorMap(int NumColors) {
  int i;
  for (i = 0; i < NumColors; i++) {
    U8 r, g, b;
    r = _ReadU8 ();
    g = _ReadU8 ();
    b = _ReadU8 ();
    if (_Source.RemBytes < 0) {
      return 1; /* Error */
    }
    _aColorTable[i] = r | ((U16)g << 8) | ((U32)b << 16);
  }
  return 0;
}

/*********************************************************************
*
*       _InitGIFDecoding
*
* Purpose:
*   The routine initializes the static SOURCE structure and checks
*   if the file is a legal GIF file.
*
* Return value:
*   0 on success, 1 on error
*/
static int _InitGIFDecoding(const U8 * pData, U32 NumBytes) {
  U8 acVersion[7] = {0};
  _Source.pSrc     = pData;
  _Source.RemBytes = NumBytes;
  /* Check if the file is a legal GIF file by checking the 6 byte file header */
  _ReadBytes(acVersion, 6); if (!_Source.RemBytes) { return 0; }
  if ( (acVersion[0] != 'G') || 
       (acVersion[1] != 'I') || 
       (acVersion[2] != 'F') || 
       (acVersion[3] != '8') ||
      ((acVersion[4] != '7') && (acVersion[4] != '9')) ||
       (acVersion[5] != 'a')) {
    return 1;
  }
  return 0;
}

/*********************************************************************
*
*       _GetImageDimension
*
* Purpose:
*   Reads the image dimension from the logical screen descriptor
*
* Return value:
*   0 on success, 1 on error
*/
static int _GetImageDimension(int * pxSize, int * pySize) {
  int XSize, YSize;
  /* Read image size */
  XSize = _ReadU16();
  YSize = _ReadU16();
  if ((XSize > 2000) || (YSize > 2000)) {
    return 1; /* Error if image is too large */
  }
  if (pxSize) {
    *pxSize = XSize;
  }
  if (pySize) {
    *pySize = YSize;
  }
  return 0;
}

/*********************************************************************
*
*       _GetGlobalColorTable
*
* Purpose:
*   Reads the global color table if there is one. Returns the number of
*   available colors over the pointer pNumColors (can be NULL).
*
* Return value:
*   0 on success, 1 on error
*/
static int _GetGlobalColorTable(int * pNumColors) {
  U8 Flags;
  int NumColors;
  /* Read flags from logical screen descriptor */
  Flags = _ReadU8 ();
  _ReadU8 ();
  _ReadU8 ();
  if (_Source.RemBytes < 0) {
    return 1; /* Error */
  }
  NumColors = 2 << (Flags & 0x7);
  if (Flags & 0x80) {
    /* Read global color table */
    if (_ReadColorMap(NumColors)) {
      return 1; /* Error */
    }
  }
  if (pNumColors) {
    *pNumColors = NumColors;
  }
  return 0;
}

/*********************************************************************
*
*       _GetSizeAndColorTable
*/
static int _GetSizeAndColorTable(const U8 * pData, U32 NumBytes, int * pxSize, int * pySize, int * pNumColors) {
  /* Initialize decoding */
  if (_InitGIFDecoding(pData, NumBytes)) {
    return 1; /* Error */
  }
  /* Get image size */
  if (_GetImageDimension(pxSize, pySize)) {
    return 1; /* Error */
  }
  /* Get global color table (if available) */
  if (_GetGlobalColorTable(pNumColors)) {
    return 1; /* Error */
  }
  return 0;
}

/*********************************************************************
*
*       _GetGIFInfo
*/
static int _GetGIFInfo(const U8 * pData, U32 NumBytes, GUI_GIF_INFO * pInfo) {
  U8 Flags, Introducer;
  int NumColors, ImageCnt;
  /* Initialize decoding and get size and global color table */
  if (_GetSizeAndColorTable(pData, NumBytes, &pInfo->xSize, &pInfo->ySize, &NumColors)) {
    return 1; /* Error */
  }
  ImageCnt = 0;
  /* Iterate over the blocks */
  do {
    Introducer = _ReadU8();
    switch (Introducer) {
    case GIF_INTRO_IMAGE:
      _SkipBytes(8);                /* Skip the first 8 bytes of the image descriptor */
      Flags = _ReadU8();            /* Only 'Flags' are intresting */
      if (Flags & 0x80) {
        _SkipBytes(NumColors * 3);  /* Skip local color table */
      }
      _SkipBytes(1);                /* Skip codesize */
      while (_GetDataBlock(0) > 0); /* Skip data blocks */
      ImageCnt++;
      break;
    case GIF_INTRO_TERMINATOR:
      break;
    case GIF_INTRO_EXTENSION:
      if (_ReadExtension(NULL, NULL, NULL)) { /* Skip image extension */
        return 1;
      }
      break;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人深夜在线观看| 国产精品一二三四| 国产精品系列在线| 欧美激情一区不卡| 国产精品嫩草影院av蜜臀| 欧美激情中文字幕| 亚洲视频一区在线观看| 亚洲欧美在线aaa| 一区二区三区色| 亚洲一区二区三区视频在线播放| 亚洲国产视频在线| 日韩国产精品久久久久久亚洲| 青青草97国产精品免费观看| 老司机精品视频导航| 国产精品综合在线视频| 成人动漫视频在线| 欧美日韩国产经典色站一区二区三区 | 国产乱理伦片在线观看夜一区| 国产麻豆成人精品| 91丨porny丨首页| 欧美日韩一区精品| wwww国产精品欧美| 亚洲乱码国产乱码精品精可以看 | 一个色妞综合视频在线观看| 亚洲chinese男男1069| 日本中文字幕不卡| 成人黄色网址在线观看| 欧美日韩五月天| 久久免费国产精品| 夜夜夜精品看看| 国产盗摄女厕一区二区三区 | 亚洲国产欧美在线| 国产在线视频一区二区| 91网页版在线| 欧美va亚洲va| 亚洲自拍与偷拍| 狠狠色狠狠色综合系列| 在线免费亚洲电影| 精品国产sm最大网站| 一区二区三区色| 成人激情免费网站| 日韩女优av电影在线观看| 一区二区三区在线播放| 九九**精品视频免费播放| 91在线视频网址| 国产视频在线观看一区二区三区| 亚洲自拍偷拍图区| av亚洲精华国产精华精| 欧美一区二区三区的| 亚洲伦理在线免费看| 国产成人精品影视| 日韩一区二区在线观看视频播放| 亚洲女性喷水在线观看一区| 国产精品一区二区在线观看不卡 | 色美美综合视频| 欧美mv日韩mv国产| 首页国产欧美日韩丝袜| 91国偷自产一区二区三区成为亚洲经典| 91麻豆精品国产91久久久久| 尤物在线观看一区| av欧美精品.com| 日本一区二区三区国色天香 | 看电视剧不卡顿的网站| 欧美丝袜丝nylons| 亚洲永久免费视频| 在线免费不卡视频| 亚洲精品你懂的| 色综合天天在线| 亚洲男女毛片无遮挡| av在线播放不卡| 中文字幕中文在线不卡住| 福利一区福利二区| 中文字幕第一区| 不卡的av电影| 成人欧美一区二区三区黑人麻豆 | 久久美女艺术照精彩视频福利播放| 日本中文字幕一区二区视频| 欧美美女激情18p| 婷婷综合另类小说色区| 欧美日韩成人高清| 日韩精品一二三| 精品日韩欧美一区二区| 韩国午夜理伦三级不卡影院| 26uuu色噜噜精品一区| 国产麻豆日韩欧美久久| 欧美韩日一区二区三区| k8久久久一区二区三区| 亚洲免费观看高清完整版在线观看熊| 色狠狠一区二区| 奇米影视一区二区三区| 精品盗摄一区二区三区| 成人一区二区三区视频在线观看| 亚洲欧洲日韩综合一区二区| 一本久久a久久精品亚洲| 亚洲第一搞黄网站| 欧美一区二区三区在线看| 国产一区二区精品久久99| 中文字幕欧美一区| 欧美精品久久天天躁| 国产一区二区三区四区五区美女 | 欧美一级艳片视频免费观看| 久久se精品一区二区| 1区2区3区国产精品| 4438成人网| 成人性视频免费网站| 偷偷要91色婷婷| 国产精品亲子乱子伦xxxx裸| 欧美三级日韩在线| 国产精品一色哟哟哟| 一区二区三区不卡在线观看| 精品久久久久久久久久久久包黑料 | 国产精品久久三区| 欧美三区在线观看| 国产成人啪午夜精品网站男同| 亚洲久草在线视频| 精品999久久久| 欧美午夜电影在线播放| 国产精品 日产精品 欧美精品| 亚洲永久精品国产| 国产精品日韩精品欧美在线| 91精品在线麻豆| 色综合中文字幕| 国产高清在线观看免费不卡| 午夜精品久久久久久久99樱桃| 国产精品国产自产拍高清av王其| 日韩一区二区三区免费观看| 99精品桃花视频在线观看| 国产专区综合网| 视频一区视频二区中文| 亚洲人成亚洲人成在线观看图片| 精品久久久网站| 欧美精品丝袜久久久中文字幕| voyeur盗摄精品| 成人美女在线观看| 国产成人午夜视频| 精彩视频一区二区| 日本vs亚洲vs韩国一区三区二区 | 久久色在线观看| 欧美美女黄视频| 欧洲精品一区二区三区在线观看| 波多野结衣欧美| 国产成人精品亚洲日本在线桃色| 久久99精品国产91久久来源| 日本不卡高清视频| 日本vs亚洲vs韩国一区三区 | 国产精品三级av| 国产午夜亚洲精品午夜鲁丝片| 日韩精品一区二区三区视频 | 国产精品一二一区| 久久精品国产一区二区三| 丝袜美腿成人在线| 亚洲成人免费观看| 日本免费在线视频不卡一不卡二 | 欧美激情一区二区三区| 中文字幕av免费专区久久| 久久久久99精品国产片| 国产日韩精品久久久| 国产亚洲一区二区三区四区| 久久久99精品免费观看| 国产日产欧产精品推荐色 | 亚洲一级二级三级| 亚洲国产精品自拍| 天天影视色香欲综合网老头| 日韩av电影天堂| 国产一区欧美日韩| 国产不卡免费视频| 一本一道久久a久久精品综合蜜臀| 91视频com| 欧美日韩高清不卡| 欧美精品一区二区三区高清aⅴ| 久久久久久夜精品精品免费| 亚洲欧美自拍偷拍| 午夜精品福利一区二区三区蜜桃| 日韩高清在线一区| 国产成人亚洲综合a∨婷婷图片| av成人动漫在线观看| 欧美日韩精品一区二区天天拍小说| 日韩视频一区二区在线观看| 久久精品欧美一区二区三区不卡 | 国产真实乱子伦精品视频| 成人爱爱电影网址| 欧美日韩色一区| 欧美精品一区二区三区蜜臀| 亚洲免费在线看| 美女久久久精品| av不卡免费电影| 日韩欧美aaaaaa| 亚洲精品国产品国语在线app| 日韩福利电影在线| 不卡的av在线播放| 欧美一区二区在线免费观看| 国产精品免费人成网站| 五月婷婷综合在线| 99精品在线观看视频| 日韩精品最新网址| 亚洲一区二三区| 成人黄页毛片网站| 亚洲精品一区二区三区四区高清| 亚洲美女少妇撒尿| 国产精品一卡二卡|