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

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

?? lcd_rotate180.c

?? UC_GUI開發源代碼,里面含有范例,源文件
?? C
字號:
/*
*********************************************************************************************************
*                                             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        : LCD_Rotate180.c
Purpose     : Implementation of GUI_SetRotation
---------------------------END-OF-HEADER------------------------------
*/

#include "GUI_Private.h"
#include "LCD.h"
#if GUI_WINSUPPORT
  #include "WM.h"
#endif

#if GUI_SUPPORT_ROTATION

/*********************************************************************
*
*       Static code
*
**********************************************************************
*/
/*********************************************************************
*
*       _DrawBitLine1BPP
*/
static void  _DrawBitLine1BPP(int x, int y, U8 const GUI_UNI_PTR *p, int Diff, int xsize, const LCD_PIXELINDEX*pTrans) {
  LCD_PIXELINDEX Index0 = *(pTrans+0);
  LCD_PIXELINDEX Index1 = *(pTrans+1);
  x -= Diff;
  switch (GUI_Context.DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
  case 0:
    do {
      LCDDEV_L0_SetPixelIndex(x--, y, (*p & (0x80 >> Diff)) ? Index1 : Index0);
			if (++Diff == 8) {
        Diff = 0;
				p++;
			}
		} while (--xsize);
    break;
  case LCD_DRAWMODE_TRANS:
    do {
  		if (*p & (0x80 >> Diff))
        LCDDEV_L0_SetPixelIndex(x, y, Index1);
      x--;
			if (++Diff == 8) {
        Diff = 0;
				p++;
			}
		} while (--xsize);
    break;
  case LCD_DRAWMODE_XOR:;
    do {
  		if (*p & (0x80 >> Diff)) {
        int Pixel = LCD_L0_GetPixelIndex(x, y);
        LCDDEV_L0_SetPixelIndex(x, y, LCD_NUM_COLORS - 1 - Pixel);
      }
      x--;
			if (++Diff == 8) {
        Diff = 0;
				p++;
			}
		} while (--xsize);
    break;
	}
}

/*********************************************************************
*
*       _DrawBitmap
*
* Purpose:
*   Draws a bitmap (1bpp) rotated by 180 degrees.
*/
static void _DrawBitmap(int x0, int y0,
                       int xsize, int ysize,
                       int BitsPerPixel, 
                       int BytesPerLine,
                       const U8 GUI_UNI_PTR * pData, int Diff,
                       const LCD_PIXELINDEX* pTrans)
{
  int i;
  /* Use _DrawBitLineXBPP */
  for (i = 0; i < ysize; i++) {
    switch (BitsPerPixel) {
    case 1:
      _DrawBitLine1BPP(x0, y0 - i, pData, Diff, xsize, pTrans);
      break;
    }
    pData += BytesPerLine;
  }
}

/*********************************************************************
*
*       _Rect2TextRect
*
* Purpose:
*   This function transforms a given rectangle (window coordinates)
*   to the rectangle used to clip the text.
*/
static void _Rect2TextRect(GUI_RECT * pRect) {
  GUI_USE_PARA(pRect);
  /* nothing to do in case of rotating text by 180 degrees */
}

/*********************************************************************
*
*       _TransformPoint180
*
* Purpose:
*   This function transforms an unrotated point (window
*   coordinates) into a rotated point in desktop coordinates
*   and handles the rotation of the current text rectangle.
*/
static void _TransformPoint180(int * pXPos, int * pYPos) {
  GUI_RECT ClientRect = {0};
  int xPos, yPos, xNumPixel, yNumPixel;
  /* Get the client rectangle */
  #if GUI_WINSUPPORT
    WM_GetWindowRect(&ClientRect);
  #else
    GUI_GetClientRect(&ClientRect);
  #endif
  xNumPixel = LCD_GetXSize() - 1;
  yNumPixel = LCD_GetYSize() - 1;
  if (ClientRect.x1 > xNumPixel) {
    ClientRect.x1 = xNumPixel;
  }
  if (ClientRect.y1 > yNumPixel) {
    ClientRect.y1 = yNumPixel;
  }
  /* Save old positions */
  xPos = *pXPos;
  yPos = *pYPos;
  /* Handle rotation of text rectangle */
  *pXPos = ClientRect.x0 + GUI_RectDispString.x1 - (xPos - GUI_RectDispString.x0);
  *pYPos = ClientRect.y0 + GUI_RectDispString.y1 - (yPos - GUI_RectDispString.y0);
}

/*********************************************************************
*
*       _DrawBitmap180
*/
static void _DrawBitmap180(int x0, int y0, int xsize, int ysize, int xMul, int yMul,
                           int BitsPerPixel, int BytesPerLine,
                           const U8 GUI_UNI_PTR * pPixel, const LCD_PIXELINDEX* pTrans)
{
  U8  Data = 0;
  int x1, y1;
  /* Handle the optional Y-magnification */
  y1 = y0 + ysize - 1;
  x1 = x0 + xsize - 1;
  /* Rotate positions */
  _TransformPoint180(&x0, &y0);
  _TransformPoint180(&x1, &y1);
  /*  Handle BITMAP without magnification */
  if ((xMul == 1) && (yMul == 1)) {
    int Diff;
    /* Clip top */
    if (y0 > GUI_Context.ClipRect.y1) {
      int Diff = y0 - GUI_Context.ClipRect.y1;
      y0       = GUI_Context.ClipRect.y1;
      pPixel  += Diff * BytesPerLine;
      ysize   -= Diff;
    }
    /* Clip bottom */
    if (y1 < GUI_Context.ClipRect.y0) {
      int Diff = GUI_Context.ClipRect.y0 - y1;
      ysize -= Diff;
    }
    if (ysize <= 0) {
		  return;
    }
    /* Clip right side */
    if (x1 < GUI_Context.ClipRect.x0) {
      int Diff = GUI_Context.ClipRect.x0 - x1;
      xsize   -= Diff;
    }
    /* Clip left side */
    Diff = 0;
    if (x0 > GUI_Context.ClipRect.x1) {
      Diff   = x0 - GUI_Context.ClipRect.x1;
			xsize -= Diff;
			switch (BitsPerPixel) {
			case 1:
  			pPixel += (Diff >> 3); x0 += (Diff >> 3) << 3; Diff &= 7;
				break;
			}
    }
    if (xsize <= 0) {
		  return;
    }
    _DrawBitmap(x0, y0, xsize, ysize, BitsPerPixel, BytesPerLine, pPixel, Diff, pTrans);
  } else {
    /* Handle BITMAP with magnification */
    int x, y;
    int yi;
    int Shift = 8 - BitsPerPixel;
    for (y = y0, yi = 0; yi < ysize; yi++, y -= yMul, pPixel += BytesPerLine) {
      int yMax = y + yMul - 1;
      /* Draw if within clip area (Optimization ... "if" is not required !) */
      if ((yMax >= GUI_Context.ClipRect.y0) && (y <= GUI_Context.ClipRect.y1)) {
        int BitsLeft = 0;
        int xi;
        const U8 GUI_UNI_PTR * pDataLine = pPixel;
        for (x = x0, xi = 0; xi < xsize; xi++, x -= xMul) {
          U8  Index;
          if (!BitsLeft) {
            Data = *pDataLine++;
            BitsLeft =8;
          }
          Index = Data >> Shift;
          Data    <<= BitsPerPixel;
          BitsLeft -= BitsPerPixel;
          if (Index || ((GUI_Context.DrawMode & LCD_DRAWMODE_TRANS) == 0)) {
            LCD_PIXELINDEX OldColor = LCD_COLORINDEX;
            if (pTrans) {
              LCD_COLORINDEX = *(pTrans + Index);
            } else {
              LCD_COLORINDEX = Index;
            }
            LCD_FillRect(x - xMul + 1, y, x, yMax);
            LCD_COLORINDEX = OldColor;
          }
        }
      }
    }
  }
}

/*********************************************************************
*
*       Global data
*
**********************************************************************
*/
/*********************************************************************
*
*       LCD_APIList180
*
* Purpose:
*   Function pointer table for rotating text 180
*/
tLCD_APIList LCD_APIList180 = {
  (tLCD_DrawBitmap*)&_DrawBitmap180,
  &_Rect2TextRect
};

#else
void LCD_Rotate180_C(void);
void LCD_Rotate180_C(void){}
#endif
	 	 			 		    	 				 	  			   	 	 	 	 	 	  	  	      	   		 	 	 		  		  	 		 	  	  			     			       	   	 			  		    	 	     	 				  	 					 	 			   	  	  			 				 		 	 	 			     			 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人一区二区在线观看| 日韩视频一区二区| 欧美一区二区三区视频免费| 国产精品视频免费看| 亚洲国产日韩综合久久精品| 国产91对白在线观看九色| 欧美日韩精品久久久| 国产精品免费人成网站| 蓝色福利精品导航| 欧美日本免费一区二区三区| 中文字幕亚洲电影| 国产一区二区看久久| 欧美巨大另类极品videosbest | 偷拍与自拍一区| 成人午夜在线播放| 久久久久久免费毛片精品| 日韩中文字幕91| 在线免费不卡视频| 亚洲丝袜美腿综合| 91在线视频观看| 亚洲欧洲无码一区二区三区| 国产suv精品一区二区883| www国产成人免费观看视频 深夜成人网| 亚洲超碰精品一区二区| 欧美色视频一区| 亚洲午夜激情网页| 欧美精品日韩一区| 秋霞午夜av一区二区三区| 88在线观看91蜜桃国自产| 日韩精品亚洲专区| 欧美一卡二卡三卡| 久久91精品国产91久久小草| 日韩免费高清av| 国产在线精品免费av| 久久精品欧美一区二区三区不卡| 国产美女一区二区三区| 日本一区二区三区dvd视频在线| 国产精品88av| 欧美激情艳妇裸体舞| www.色综合.com| 自拍偷拍国产精品| 色婷婷久久久久swag精品 | 亚洲在线观看免费| 欧美情侣在线播放| 另类小说欧美激情| 国产喷白浆一区二区三区| 成人精品gif动图一区| 亚洲欧美日韩人成在线播放| 在线观看一区二区视频| 亚洲第一狼人社区| 欧美电影免费提供在线观看| 国产a久久麻豆| 一区二区三区四区亚洲| 欧美一区二区视频观看视频| 国模少妇一区二区三区| 欧美激情中文不卡| 在线精品视频免费播放| 蜜臀91精品一区二区三区 | 精品日韩一区二区三区| 国产激情视频一区二区在线观看 | 日韩一区二区在线观看| 国产一区二区女| 综合激情成人伊人| 欧美一区二区大片| 国产91色综合久久免费分享| 一区二区三区在线高清| 日韩精品一区二区三区四区视频 | 日产精品久久久久久久性色| 26uuu久久天堂性欧美| 91首页免费视频| 看电视剧不卡顿的网站| 综合激情成人伊人| 精品久久久三级丝袜| 91黄视频在线| 国产成人免费视频网站| 日本欧美大码aⅴ在线播放| 国产精品久久久久久久午夜片| 6080午夜不卡| 91麻豆免费看| 国产99久久精品| 精品一区二区免费看| 一区二区理论电影在线观看| 久久精品一区二区三区四区| 欧美午夜一区二区三区免费大片| 粉嫩av一区二区三区粉嫩| 日本亚洲最大的色成网站www| 亚洲欧美色图小说| 久久久久一区二区三区四区| 69久久99精品久久久久婷婷| 97精品超碰一区二区三区| 国产一区二区三区久久久| 琪琪一区二区三区| 午夜欧美在线一二页| 一区二区三区视频在线看| 日本一区二区动态图| 久久久久久久久久久黄色| 日韩一区二区在线观看视频播放| 欧美日韩一区国产| 日本黄色一区二区| www.成人在线| 成人黄色av电影| 国产不卡视频在线播放| 久久激五月天综合精品| 青青草一区二区三区| 三级一区在线视频先锋 | 欧美xxxxx裸体时装秀| 7777精品伊人久久久大香线蕉经典版下载| 色香蕉久久蜜桃| 一本大道久久a久久综合| 色噜噜狠狠色综合中国| 91无套直看片红桃| 99re视频精品| 色综合久久中文字幕| 色哟哟一区二区| 欧美午夜一区二区三区免费大片| 在线视频国产一区| 欧美亚洲自拍偷拍| 欧美精品亚洲二区| 日韩欧美成人激情| 精品美女在线播放| 久久麻豆一区二区| 亚洲国产精品国自产拍av| 国产精品久久福利| 亚洲女人****多毛耸耸8| 亚洲专区一二三| 五月婷婷欧美视频| 麻豆精品视频在线观看| 国产麻豆成人传媒免费观看| 成人网在线免费视频| 色嗨嗨av一区二区三区| 欧美一区二区在线播放| 26uuu另类欧美亚洲曰本| 中文字幕中文字幕在线一区 | 另类综合日韩欧美亚洲| 国内精品国产三级国产a久久| 成人午夜电影小说| 91极品视觉盛宴| 欧美va亚洲va| 中文字幕一区二区三区乱码在线| 亚洲综合免费观看高清完整版 | 一区二区三区欧美激情| 日日夜夜免费精品| 国产福利不卡视频| 色婷婷狠狠综合| 精品国产一区二区在线观看| 中文字幕欧美激情一区| 亚洲第一成年网| 高清国产一区二区三区| 欧美伊人久久大香线蕉综合69| 日韩美女一区二区三区| 一区精品在线播放| 久热成人在线视频| 91丨九色丨黑人外教| 日韩一区二区三区电影在线观看 | 久久免费午夜影院| 亚洲主播在线播放| 懂色av中文字幕一区二区三区| 欧美在线一区二区三区| 国产丝袜欧美中文另类| 亚洲v中文字幕| 91小宝寻花一区二区三区| 在线不卡免费av| 国产精品国产三级国产aⅴ入口| 亚洲国产日韩a在线播放| 国产精品一区二区在线播放| 欧洲av在线精品| 中文字幕在线不卡视频| 久久av中文字幕片| 日本电影亚洲天堂一区| 欧美国产精品一区| 午夜精品在线看| eeuss影院一区二区三区| 日韩欧美精品在线| 亚洲一区二区五区| 成人激情黄色小说| 久久综合九色综合97婷婷女人| 亚洲自拍偷拍九九九| 91尤物视频在线观看| 26uuu亚洲综合色| 亚洲不卡在线观看| 色综合色综合色综合| 综合久久一区二区三区| 七七婷婷婷婷精品国产| 色综合天天综合网天天狠天天| 国产日韩欧美综合在线| 久草热8精品视频在线观看| 欧美在线999| 亚洲综合无码一区二区| 波多野结衣亚洲| 欧美高清在线精品一区| 国产成人av福利| 久久理论电影网| 经典一区二区三区| 久久久久久久久久久久久久久99| 美女在线视频一区| 日韩欧美精品在线| 精品一区二区影视| 久久只精品国产| 国内欧美视频一区二区| 欧美精品一区二区三区在线|