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

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

?? gui_gif.c

?? UC_GUI開發源代碼,里面含有范例,源文件
?? C
?? 第 1 頁 / 共 3 頁
字號:
    default:
      return 1;
    }
  } while (Introducer != GIF_INTRO_TERMINATOR); /* We do not support more than one image, so stop when the first terminator has been read */
  pInfo->NumImages = ImageCnt;
  return 0;
}

/*********************************************************************
*
*       _GetImageInfo
*/
static int _GetImageInfo(const U8 * pData, U32 NumBytes, GUI_GIF_IMAGE_INFO * pInfo, int Index) {
  U8 Flags, Introducer;
  int NumColors, ImageCnt;
  /* Initialize decoding and get size and global color table */
  if (_GetSizeAndColorTable(pData, NumBytes, NULL, NULL, &NumColors)) {
    return 1; /* Error */
  }
  ImageCnt = 0;
  /* Iterate over the blocks */
  do {
    Introducer = _ReadU8();
    switch (Introducer) {
    case GIF_INTRO_IMAGE:
      if (Index == ImageCnt) {
        pInfo->xPos  = _ReadU16();
        pInfo->xPos  = _ReadU16();
        pInfo->xSize = _ReadU16();
        pInfo->ySize = _ReadU16();
        return 0;
      }
      _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, (Index == ImageCnt) ? pInfo : NULL, NULL)) {
        return 1;
      }
      break;
    default:
      return 1;
    }
  } while (Introducer != GIF_INTRO_TERMINATOR); /* We do not support more than one image, so stop when the first terminator has been read */
  return 0;
}

/*********************************************************************
*
*       _GetGIFComment
*
* Purpose:
*   Returns the given comment of the GIF image.
*
* Parameters:
*   pData            - Pointer to start of the GIF file
*   NumBytes         - Number of bytes in the file
*   pBuffer          - Pointer to buffer to be filled by the routine
*   MaxSize          - Number of bytes in buffer
*   Index            - Index of the comment to be returned
*
* Return value:
*   0 on success, 1 on error
*/
static int _GetGIFComment(const U8 * pData, U32 NumBytes, U8 * pBuffer, int MaxSize, int Index) {
  U8 Flags, Introducer;
  int NumColors, CommentCnt, Size;
  /* Initialize decoding and skip size and global color table */
  if (_GetSizeAndColorTable(pData, NumBytes, NULL, NULL, &NumColors)) {
    return 1; /* Error */
  }
  CommentCnt = Size = 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 */
      break;
    case GIF_INTRO_TERMINATOR:
      break;
    case GIF_INTRO_EXTENSION:
      _ReadComment((Index == CommentCnt) ? pBuffer : NULL, MaxSize, &Size);
      if ((Size) && (Index == CommentCnt)) {
        return 0;
      }
      break;
    default:
      return 1;
    }
  } while (Introducer != GIF_INTRO_TERMINATOR); /* We do not support more than one image, so stop when the first terminator has been read */
  return 1;
}

/*********************************************************************
*
*       _ClearUnusedPixels
*
* Purpose:
*   Clears the pixels between the border of the previous drawn image and
*   the current image.
*/
static void _ClearUnusedPixels(int x0, int y0, IMAGE_DESCRIPTOR * pDescriptor, GUI_GIF_IMAGE_INFO * pInfo) {
  LCD_SetColorIndex(LCD_GetBkColorIndex());
  if (pDescriptor->YPos > pInfo->yPos) {
    LCD_FillRect(x0 + pInfo->xPos,
                 y0 + pInfo->yPos,
                 x0 + pInfo->xPos + pInfo->xSize - 1,
                 y0 + pDescriptor->YPos - 1);
  }
  if (pDescriptor->XPos > pInfo->xPos) {
    LCD_FillRect(x0 + pInfo->xPos,
                 y0 + pInfo->yPos,
                 x0 + pDescriptor->XPos - 1,
                 y0 + pInfo->yPos + pInfo->ySize - 1);
  }
  if ((pDescriptor->YPos + pDescriptor->YSize) < (pInfo->yPos + pInfo->ySize)) {
    LCD_FillRect(x0 + pInfo->xPos,
                 y0 + pDescriptor->YPos + pDescriptor->YSize - 1,
                 x0 + pInfo->xPos + pInfo->xSize - 1,
                 y0 + pInfo->yPos + pInfo->ySize - 1);
  }
  if ((pDescriptor->XPos + pDescriptor->XSize) < (pInfo->xPos + pInfo->xSize)) {
    LCD_FillRect(x0 + pDescriptor->XPos + pDescriptor->XSize - 1,
                 y0 + pInfo->yPos,
                 x0 + pInfo->xPos + pInfo->xSize - 1,
                 y0 + pInfo->yPos + pInfo->ySize - 1);
  }
}

/*********************************************************************
*
*       _DrawGIFImage
*
* Purpose:
*   Draws the given sub image of a GIF file.
*
* Parameters:
*   pData    - Pointer to start of the GIF file
*   NumBytes - Number of bytes in the file
*   x0       - Drawing position x
*   y0       - Drawing position y
*   Index    - Index of sub image to be drawn
*
* Return value:
*   0 on success, 1 on error
*/
static int _DrawGIFImage(const U8 * pData, U32 NumBytes, int x0, int y0, int Index) {
  U8 Disposal;
  int XSize, YSize, TransIndex, ImageCnt;
  IMAGE_DESCRIPTOR Descriptor = {0};
  GUI_GIF_IMAGE_INFO Info = {0};
  U8 Introducer;
  ImageCnt   =  0;
  TransIndex = -1;
  /* Initialize decoding and get size and global color table */
  if (_GetSizeAndColorTable(pData, NumBytes, &XSize, &YSize, &Descriptor.NumColors)) {
    return 1; /* Error */
  }
  /* Iterate over the blocks */
  do {
    Introducer = _ReadU8();
    switch (Introducer) {
    case GIF_INTRO_IMAGE:
      /* Read image descriptor */
      Descriptor.XPos  = _ReadU16();
      Descriptor.YPos  = _ReadU16();
      Descriptor.XSize = _ReadU16();
      Descriptor.YSize = _ReadU16();
      Descriptor.Flags = _ReadU8 ();
      if (_Source.RemBytes < 0) {
        return 1; /* Error */
      }
      if (Descriptor.Flags & 0x80) {
        /* Read local color table */
        if (_ReadColorMap(Descriptor.NumColors)) {
          return 1; /* Error */
        }
      }
      if (ImageCnt == Index - 1) {
        Info.xPos  = Descriptor.XPos;
        Info.yPos  = Descriptor.YPos;
        Info.xSize = Descriptor.XSize;
        Info.ySize = Descriptor.YSize;
      }
      if (Index == ImageCnt) {
        if (Disposal == 2) {
          _ClearUnusedPixels(x0, y0, &Descriptor, &Info);
        }
        if (_DispGIFImage(&Descriptor, x0 + Descriptor.XPos, y0 + Descriptor.YPos, TransIndex, Disposal)) {
          return 1; /* Error */
        }
        if (_ReadU8() != 0) {
          return 1; /* Error */
        }
        return 0;
      } else {
        _ReadU8();                    /* Skip codesize */
        while (_GetDataBlock(0) > 0); /* Skip data blocks */
      }
      ImageCnt++;
      break;
    case GIF_INTRO_TERMINATOR:
      break;
    case GIF_INTRO_EXTENSION:
      /* Read image extension */
      if (_ReadExtension(&TransIndex, (Index == ImageCnt) ? &Info : NULL, (Index == ImageCnt) ? &Disposal : NULL)) {
        return 1;
      }
      break;
    default:
      return 1;
    }
  } while (Introducer != GIF_INTRO_TERMINATOR); /* We do not support more than one image, so stop when the first terminator has been read */
  return 0;
}

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       GUI_GIF_GetXSize
*
* Purpose:
*   Returns the XSize of the given GIF image without further tests.
*/
int GUI_GIF_GetXSize(const void * pGIF) {
  const U8 * pSrc;
  if (!pGIF) {
    return 0;
  }
  pSrc = (const U8 *)pGIF + 6;
  return GUI__Read16(&pSrc);
}

/*********************************************************************
*
*       GUI_GIF_GetYSize
*
* Purpose:
*   Returns the YSize of the given GIF image without further tests.
*/
int GUI_GIF_GetYSize(const void * pGIF) {
  const U8 * pSrc;
  if (!pGIF) {
    return 0;
  }
  pSrc = (const U8 *)pGIF + 8;
  return GUI__Read16(&pSrc);
}

/*********************************************************************
*
*       GUI_GIF_DrawEx
*/
int GUI_GIF_DrawEx(const void * pGIF, U32 NumBytes, int x0, int y0, int Index) {
  const U8 * pSrc;
  int Result, OldColorIndex;
  #if (GUI_WINSUPPORT)
    int Width, Height;
    GUI_RECT r;
    Width  = GUI_GIF_GetXSize(pGIF);
    Height = GUI_GIF_GetYSize(pGIF);
  #endif
  GUI_LOCK();
  OldColorIndex = LCD_GetColorIndex();
  pSrc          = (const U8 *)pGIF;
  #if (GUI_WINSUPPORT)
    WM_ADDORG(x0,y0);
    r.x1 = (r.x0 = x0) + Width - 1;
    r.y1 = (r.y0 = y0) + Height - 1;
    WM_ITERATE_START(&r) {
  #endif
  Result = _DrawGIFImage(pSrc, NumBytes, x0, y0, Index);
  #if (GUI_WINSUPPORT)
    } WM_ITERATE_END();
  #endif
  LCD_SetColorIndex(OldColorIndex);
  GUI_UNLOCK();
  return Result;
}

/*********************************************************************
*
*       GUI_GIF_Draw
*/
int GUI_GIF_Draw(const void * pGIF, U32 NumBytes, int x0, int y0) {
  return GUI_GIF_DrawEx(pGIF, NumBytes, x0, y0, 0);
}

/*********************************************************************
*
*       GUI_GIF_GetInfo
*/
int GUI_GIF_GetInfo(const void * pGIF, U32 NumBytes, GUI_GIF_INFO * pInfo) {
  const U8 * pSrc;
  pSrc = (const U8 *)pGIF;
  if (_GetGIFInfo(pSrc, NumBytes, pInfo)) {
    return 1;
  }
  return 0;
}

/*********************************************************************
*
*       GUI_GIF_GetImageInfo
*/
int GUI_GIF_GetImageInfo(const void * pGIF, U32 NumBytes, GUI_GIF_IMAGE_INFO * pInfo, int Index) {
  const U8 * pSrc;
  pSrc = (const U8 *)pGIF;
  if (_GetImageInfo(pSrc, NumBytes, pInfo, Index)) {
    return 1;
  }
  return 0;
}

/*********************************************************************
*
*       GUI_GIF_GetComment
*/
int GUI_GIF_GetComment(const void * pGIF, U32 NumBytes, U8 * pBuffer, int MaxSize, int Index) {
  const U8 * pSrc;
  pSrc = (const U8 *)pGIF;
  if (_GetGIFComment(pSrc, NumBytes, pBuffer, MaxSize, Index)) {
    return 1;
  }
  return 0;
}

/*************************** End of file ****************************/
	 	 			 		    	 				 	  			   	 	 	 	 	 	  	  	      	   		 	 	 		  		  	 		 	  	  			     			       	   	 			  		    	 	     	 				  	 					 	 			   	  	  			 				 		 	 	 			     			 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本伦理一区二区| 韩日精品视频一区| 综合久久久久久久| 中文字幕一区二区三区色视频| 久久久蜜臀国产一区二区| 精品国产乱码久久久久久免费| 日韩精品一区二区三区在线 | 久久精品综合网| 色哟哟在线观看一区二区三区| 蜜臀av性久久久久蜜臀aⅴ| 国产欧美va欧美不卡在线 | 美美哒免费高清在线观看视频一区二区 | 日韩美女在线视频| 亚洲精品伦理在线| 在线观看精品一区| 91国偷自产一区二区开放时间| 亚洲日本va午夜在线电影| 精品日韩一区二区| 欧美三级韩国三级日本三斤| 91福利在线导航| 一本色道久久综合精品竹菊| 成人午夜av电影| 一区二区在线观看不卡| 制服丝袜一区二区三区| 欧美日韩中文精品| 欧美日韩在线三区| 欧美精选一区二区| 国产乱子轮精品视频| 中文字幕欧美国产| 在线精品视频一区二区三四| 亚洲男人天堂一区| 欧美zozozo| 欧美精品精品一区| 欧美一区二区三区视频免费播放 | 天堂一区二区在线| 丝袜诱惑制服诱惑色一区在线观看 | 洋洋成人永久网站入口| 一区二区激情视频| 日本亚洲免费观看| 国产91富婆露脸刺激对白| 色综合中文字幕| 日韩午夜激情免费电影| 中文字幕国产精品一区二区| 亚洲成a天堂v人片| 国产精品18久久久久久久久久久久| 91在线一区二区三区| 日韩亚洲欧美成人一区| 中文字幕成人av| 日韩高清不卡一区二区三区| 国产成人免费av在线| 欧美性色黄大片手机版| 精品久久久久一区| 一区二区三区在线免费视频| 九九**精品视频免费播放| 91网站最新网址| 精品国产一区久久| 一区二区三区中文在线观看| 国产剧情一区二区三区| 欧美男同性恋视频网站| 国产精品大尺度| 毛片基地黄久久久久久天堂| 91在线视频官网| 久久久久久久久久久久久久久99 | 国产精品久久久久久久久搜平片| 同产精品九九九| av资源网一区| 欧美精品一区二区三区蜜臀| 亚洲国产成人va在线观看天堂| 豆国产96在线|亚洲| 欧美一区二区高清| 一区二区三区在线观看动漫| 国产福利精品导航| 日韩三级精品电影久久久| 亚洲最新在线观看| 99麻豆久久久国产精品免费| 久久香蕉国产线看观看99| 水野朝阳av一区二区三区| 91丝袜美腿高跟国产极品老师 | 中文字幕佐山爱一区二区免费| 美女爽到高潮91| 一本色道久久综合精品竹菊| 精品乱码亚洲一区二区不卡| 欧美偷拍一区二区| 亚洲自拍偷拍麻豆| 色综合久久久久久久久| 日韩理论片网站| 欧美吻胸吃奶大尺度电影| 一区二区三区91| 欧美日本韩国一区二区三区视频| 日韩成人精品在线观看| 欧美一区二区成人| 精彩视频一区二区三区 | 国产91精品精华液一区二区三区 | 欧美日韩国产精选| 亚洲国产精品嫩草影院| 在线国产亚洲欧美| 一区二区三区在线影院| 91女人视频在线观看| 亚洲欧洲日韩在线| av资源站一区| 亚洲免费观看高清完整| 91麻豆国产福利在线观看| 亚洲免费av高清| 欧美性猛交xxxxxx富婆| 夜夜爽夜夜爽精品视频| 欧美视频精品在线观看| 日韩综合小视频| 欧美麻豆精品久久久久久| 日韩极品在线观看| 日韩精品在线看片z| 美洲天堂一区二卡三卡四卡视频 | 日韩国产在线一| 欧美精品色综合| 麻豆精品久久久| 精品动漫一区二区三区在线观看| 国产一区欧美日韩| 国产精品毛片久久久久久| 色综合天天综合给合国产| 一区二区三区毛片| 欧美日韩激情一区二区三区| 美女爽到高潮91| 欧美激情综合网| 日本韩国视频一区二区| 五月激情综合网| 精品精品国产高清一毛片一天堂| 国产精品一区二区视频| 国产精品妹子av| 色婷婷久久久综合中文字幕| 石原莉奈一区二区三区在线观看| 日韩精品一区二区三区视频在线观看 | 一区二区三区色| 欧美美女bb生活片| 国产精品一色哟哟哟| 亚洲色大成网站www久久九九| 欧美三级资源在线| 男人的天堂久久精品| 中文在线免费一区三区高中清不卡| 91亚洲精品久久久蜜桃网站| 亚洲成人午夜电影| 久久日韩粉嫩一区二区三区| 91小视频免费观看| 欧美日韩在线一区二区| 成人午夜视频网站| 欧美人与禽zozo性伦| 亚洲成人av中文| 精品一区二区三区在线视频| 美腿丝袜亚洲综合| 狠狠网亚洲精品| 色呦呦国产精品| 欧美三级中文字幕| 欧美一区二区三区电影| 欧美一区二区三区免费视频| 日韩一区二区三区免费观看 | 欧美电影精品一区二区| 国产精品1区2区| 亚洲第四色夜色| 久久久精品日韩欧美| 欧美视频你懂的| 成人免费观看男女羞羞视频| 亚洲高清视频的网址| 国产网红主播福利一区二区| 欧美视频在线播放| 粉嫩在线一区二区三区视频| 日韩成人精品在线| 亚洲激情在线激情| 国产日产欧美一区二区三区| 欧美日本视频在线| 色综合久久久久综合99| 国产精选一区二区三区| 午夜伊人狠狠久久| 亚洲天堂网中文字| 久久久久一区二区三区四区| 欧美日韩一区在线观看| 不卡一卡二卡三乱码免费网站| 蜜桃av一区二区| 亚洲va韩国va欧美va精品| 日韩美女视频一区二区| 久久精品视频一区二区三区| 91精品福利在线一区二区三区| 一本久久a久久免费精品不卡| 国产精品一卡二卡| 精品一区二区三区在线观看| 亚洲国产成人porn| 伊人色综合久久天天| 国产精品久久久久影院色老大| 精品对白一区国产伦| 日韩一区二区精品葵司在线| 欧美精品丝袜中出| 欧美午夜免费电影| 欧洲人成人精品| 91在线观看成人| www.欧美亚洲| 暴力调教一区二区三区| 成人一级视频在线观看| 国产精品一区二区不卡| 国产乱人伦偷精品视频不卡| 精品一区二区三区视频在线观看| 日本视频一区二区| 日韩电影免费在线| 蜜臀av一级做a爰片久久|