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

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

?? lcd_rotatecw.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_RotateCW.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);
  y -= Diff;
  switch (GUI_Context.DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
  case 0:
    do {
      LCDDEV_L0_SetPixelIndex(x, y, (*p & (0x80 >> Diff)) ? Index1 : Index0);
      y++;
			if (++Diff == 8) {
        Diff = 0;
				p++;
			}
		} while (--xsize);
    break;
  case LCD_DRAWMODE_TRANS:
    do {
  		if (*p & (0x80 >> Diff))
        LCDDEV_L0_SetPixelIndex(x, y, Index1);
      y++;
			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);
      }
      y++;
			if (++Diff == 8) {
        Diff = 0;
				p++;
			}
		} while (--xsize);
    break;
	}
}

/*********************************************************************
*
*       _DrawBitmap
*
* Purpose:
*   Draws a bitmap (1bpp) clockwise.
*/
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 - i, y0, 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) {
  int x1, y1;
  x1 = pRect->x1;
  y1 = pRect->y1;
  pRect->x1 = pRect->x0 + (y1 - pRect->y0);
  pRect->y1 = pRect->y0 + (x1 - pRect->x0);
}

/*********************************************************************
*
*       _TransformPointCW
*
* 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 _TransformPointCW(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;
  /* Rotate and add window origin */
  *pXPos = ClientRect.x0 - yPos;
  *pYPos = ClientRect.y0 + xPos;
  /* Handle rotation of text rectangle */
  *pXPos = *pXPos + GUI_RectDispString.x1 + GUI_RectDispString.y0;
  *pYPos = *pYPos + GUI_RectDispString.y0 - GUI_RectDispString.x0;
}

/*********************************************************************
*
*       _DrawBitmapCW
*/
static void _DrawBitmapCW(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 */
  _TransformPointCW(&x0, &y0);
  _TransformPointCW(&x1, &y1);
  /*  Handle BITMAP without magnification */
  if ((xMul == 1) && (yMul == 1)) {
    int Diff = 0;
    /* Clip top */
    if (y1 > GUI_Context.ClipRect.y1) {
      int Diff = y1 - GUI_Context.ClipRect.y1; 
      xsize -= Diff;
    }
    /* Clip bottom */
    if (y0 < GUI_Context.ClipRect.y0) {
      Diff = GUI_Context.ClipRect.y1 - y0;
			xsize -= Diff;
			switch (BitsPerPixel) {
			case 1:
  			pPixel += (Diff >> 3); y0 -= (Diff >> 3) << 3; Diff &= 7;
				break;
			}
    }
    if (ysize <=0) {
		  return;
    }
    /* Clip right side */
    if (x0 > GUI_Context.ClipRect.x1) {
      int Diff = x0 - GUI_Context.ClipRect.x1;
      ysize -= Diff;
      x0 -= Diff;
      pPixel += Diff * BytesPerLine;
    }
    /* Clip left side */
    if (x1 < GUI_Context.ClipRect.x0) {
      int Diff = GUI_Context.ClipRect.x0 - x1;
      x1 += Diff;
      ysize -= Diff;
    }
    if (xsize <= 0) {
		  return;
    }
    _DrawBitmap(x0, y0, xsize, ysize, BitsPerPixel, BytesPerLine, pPixel, Diff, pTrans);
  } else {
    /* Handle BITMAP with magnification */
    int x, y, xi, yi;
    int Shift = 8 - BitsPerPixel;
    for (x = x0, xi = 0; xi < ysize; xi++, x -= yMul, pPixel += BytesPerLine) {
      int xMax = x - yMul + 1;
      if ((xMax >= GUI_Context.ClipRect.x0) && (x <= GUI_Context.ClipRect.x1)) {
        int BitsLeft = 0;
        const U8 GUI_UNI_PTR * pDataLine = pPixel;
        for (y = y0, yi = 0; yi < xsize; yi++, y += 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(xMax, y, x, y + xMul - 1);
            LCD_COLORINDEX = OldColor;
          }
        }
      }
    }
  }
}

/*********************************************************************
*
*       Global data
*
**********************************************************************
*/
/*********************************************************************
*
*       LCD_APIListCW
*
* Purpose:
*   Function pointer table for rotating text CW
*/
tLCD_APIList LCD_APIListCW = {
  (tLCD_DrawBitmap*)&_DrawBitmapCW,
  &_Rect2TextRect
};

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区在线观看乱码| 色哟哟国产精品| 91天堂素人约啪| 精品剧情v国产在线观看在线| 亚洲视频免费在线观看| 看国产成人h片视频| 91麻豆国产精品久久| 久久丝袜美腿综合| 日韩**一区毛片| 日本道色综合久久| 中文字幕精品一区| 男女男精品视频网| 欧美疯狂做受xxxx富婆| 亚洲欧洲日韩一区二区三区| 国产精品中文字幕日韩精品| 欧美一级xxx| 日韩专区一卡二卡| 色94色欧美sute亚洲线路一久| 国产日韩av一区二区| 国产自产高清不卡| 日韩一区二区三区免费观看| 亚洲综合丝袜美腿| 色婷婷综合五月| 亚洲欧美日韩国产手机在线 | 日韩**一区毛片| 欧美艳星brazzers| 亚洲黄色录像片| 97se亚洲国产综合自在线| 久久精品男人的天堂| 精品午夜一区二区三区在线观看| 欧美一区二区三区播放老司机| 亚洲第一电影网| 欧美日本在线播放| 天天射综合影视| 欧美一区二区三区在线观看| 日韩成人av影视| 日韩欧美国产系列| 久久黄色级2电影| 欧美精品一区二区三区在线播放| 男人的j进女人的j一区| 日韩欧美成人一区| 国产综合成人久久大片91| 国产欧美日韩卡一| 91亚洲精品久久久蜜桃网站 | 国产精品青草综合久久久久99| 国产成人一区在线| 最新热久久免费视频| 91久久人澡人人添人人爽欧美 | 欧美日本一区二区三区| 日韩专区欧美专区| 久久久久久久久一| 不卡一区中文字幕| 一区二区三区色| 日韩欧美精品三级| 成人av免费在线观看| 一区二区三区精品在线| 91.com在线观看| 国产久卡久卡久卡久卡视频精品| 久久嫩草精品久久久久| 97久久久精品综合88久久| 亚洲成人一区在线| 久久综合色之久久综合| 91视频一区二区| 麻豆一区二区三| 亚洲情趣在线观看| 日韩久久久精品| 91麻豆国产福利精品| 美美哒免费高清在线观看视频一区二区 | 欧美午夜一区二区三区| 看国产成人h片视频| 亚洲视频一区在线| 日韩亚洲欧美成人一区| 91影视在线播放| 精品一区二区三区在线观看国产| 欧美电影影音先锋| 国产成人亚洲综合a∨猫咪| 1024精品合集| 91捆绑美女网站| 极品少妇一区二区| 伊人开心综合网| 精品剧情在线观看| 欧美综合一区二区| 精品一区二区日韩| 亚洲欧美成aⅴ人在线观看| 在线亚洲免费视频| a亚洲天堂av| 久久成人免费电影| 最新久久zyz资源站| 97se狠狠狠综合亚洲狠狠| 亚洲日本青草视频在线怡红院 | 精品国产在天天线2019| 91麻豆国产在线观看| 精品一区中文字幕| 亚洲一级二级在线| 国产欧美一区二区精品仙草咪| 欧美色综合网站| 成人短视频下载| 99久久国产综合精品麻豆| 日本视频一区二区| 久久九九国产精品| 91精品国产美女浴室洗澡无遮挡| bt欧美亚洲午夜电影天堂| 寂寞少妇一区二区三区| 亚洲成人激情自拍| 久久女同精品一区二区| 欧美精品一区二区久久婷婷| 欧美色视频一区| 99视频一区二区三区| 国产麻豆视频精品| 麻豆视频一区二区| 亚洲午夜av在线| 一级特黄大欧美久久久| 国产精品污网站| 久久午夜羞羞影院免费观看| 3atv在线一区二区三区| 色94色欧美sute亚洲线路二 | 91视频.com| 粉嫩久久99精品久久久久久夜| 美女脱光内衣内裤视频久久影院| 亚洲一区二区三区三| 亚洲免费在线视频| 国产精品伦理在线| 精品久久一区二区三区| 久久精品夜夜夜夜久久| 日韩欧美综合在线| 91精品欧美久久久久久动漫| 欧美视频精品在线| 欧美日韩久久久久久| 欧美日韩在线观看一区二区| 97久久久精品综合88久久| 日本高清成人免费播放| 在线观看一区二区精品视频| 在线精品视频小说1| 欧洲一区二区三区在线| 色激情天天射综合网| 欧美亚洲国产bt| 国产精品羞羞答答xxdd| av亚洲精华国产精华| 91小视频在线观看| 在线精品亚洲一区二区不卡| 成人激情文学综合网| caoporm超碰国产精品| 在线免费av一区| 欧美一区二区三区在线视频| 欧美成人video| 欧美激情一区二区| 亚洲女人****多毛耸耸8| 亚洲愉拍自拍另类高清精品| 天堂一区二区在线| 国产一区二区三区香蕉| 99国产精品久久久久久久久久| 色噜噜夜夜夜综合网| 制服丝袜亚洲色图| 久久久亚洲国产美女国产盗摄 | 亚洲日本在线视频观看| 国产盗摄女厕一区二区三区| 同产精品九九九| 国产一区二区免费在线| 91麻豆123| 日韩欧美国产综合一区| 国产精品女主播av| 综合激情网...| 男人的天堂久久精品| 成人免费视频网站在线观看| 在线看日本不卡| 久久久久久影视| 亚洲动漫第一页| 久久99国内精品| 色999日韩国产欧美一区二区| 日韩一区二区免费高清| 中文字幕日韩一区| 视频在线观看国产精品| 美日韩一级片在线观看| 91久久线看在观草草青青| 精品国产免费久久| 一区二区不卡在线播放| 国产乱子伦一区二区三区国色天香 | 日韩在线播放一区二区| 丁香婷婷综合网| 日韩免费高清av| 最新高清无码专区| 韩日av一区二区| 欧美网站一区二区| 欧美韩国一区二区| 久久国产精品一区二区| 91浏览器打开| 国产欧美一区二区在线| 日本不卡在线视频| 色激情天天射综合网| 亚洲国产成人一区二区三区| 卡一卡二国产精品| 欧美日韩美少妇| 亚洲三级电影网站| 国产成人精品www牛牛影视| 欧美精品乱码久久久久久按摩| 中文字幕一区二区日韩精品绯色| 精品一区二区在线看| 欧美精品日日鲁夜夜添| 亚洲综合色在线| 在线免费亚洲电影|