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

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

?? lcd_rotateccw.c

?? C語言和ucGUI實現的電子地圖功能,地圖的移動(方向鍵),縮放,查找
?? C
字號:
/*
*********************************************************************************************************
*                                                uC/GUI
*                        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_RotateCCW.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) counter 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);
}

/*********************************************************************
*
*       _TransformPointCCW
*
* 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 _TransformPointCCW(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.y1 - xPos;
  /* Handle rotation of text rectangle */
  *pXPos = *pXPos + GUI_RectDispString.x0 - GUI_RectDispString.y0;
  *pYPos = *pYPos + GUI_RectDispString.y1 - (ClientRect.y1 - ClientRect.y0) + GUI_RectDispString.x0;
}

/*********************************************************************
*
*       _DrawBitmapCCW
*/
static void _DrawBitmapCCW(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 */
  _TransformPointCCW(&x0, &y0);
  _TransformPointCCW(&x1, &y1);
  /*  Handle BITMAP without magnification */
  if ((xMul == 1) && (yMul == 1)) {
    int Diff = 0;
    /* Clip top */
    if (y1 < GUI_Context.ClipRect.y0) {
      int Diff = GUI_Context.ClipRect.y0 - y1;
      xsize -= Diff;
    }
    /* Clip bottom */
    if (y0 > GUI_Context.ClipRect.y1) {
      Diff = y0 - GUI_Context.ClipRect.y1;
			xsize -= Diff;
			switch (BitsPerPixel) {
			case 1:
  			pPixel += (Diff >> 3); y0 -= (Diff >> 3) << 3; Diff &= 7;
				break;
			}
    }
    if (ysize <= 0) {
		  return;
    }
    /* Clip right side */
    if (x1 > GUI_Context.ClipRect.x1) {
      int Diff = x1 - GUI_Context.ClipRect.x1;
      ysize -= Diff;
    }
    /* Clip left side */
    if (x0 < GUI_Context.ClipRect.x0) {
      int Diff = GUI_Context.ClipRect.x0 - x0;
      pPixel += Diff * BytesPerLine;
      x0 += 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(x, y - xMul + 1, xMax, y);
            LCD_COLORINDEX = OldColor;
          }
        }
      }
    }
  }
}

/*********************************************************************
*
*       Global data
*
**********************************************************************
*/
/*********************************************************************
*
*       LCD_APIListCCW
*
* Purpose:
*   Function pointer table for rotating text CCW
*/
tLCD_APIList LCD_APIListCCW = {
  (tLCD_DrawBitmap*)&_DrawBitmapCCW,
  &_Rect2TextRect
};

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品天美传媒沈樵| 91小视频在线| 精品国产99国产精品| 免播放器亚洲一区| 日韩午夜小视频| 1024成人网| 午夜精品久久久久久久久久久| 国产欧美日韩在线观看| 波多野结衣精品在线| 樱花影视一区二区| 精品国产亚洲一区二区三区在线观看| 国产一区二区h| 亚洲免费观看高清完整版在线观看熊| 欧美日韩成人高清| 成人性生交大片免费| 亚洲不卡av一区二区三区| 久久青草国产手机看片福利盒子 | 欧美性感一类影片在线播放| 午夜精彩视频在线观看不卡| 久久久久久久久久久久久久久99 | 日产国产欧美视频一区精品| 国产午夜精品福利| 9191国产精品| 91视频免费看| 国产精品99久久久久| 日韩高清一区在线| 亚洲美女视频在线观看| 久久蜜桃av一区精品变态类天堂| 欧美色视频一区| 99视频精品全部免费在线| 久久爱www久久做| 亚洲高清久久久| 亚洲男人的天堂网| 国产精品久久久久影院| 欧美一区二区三区人| 91性感美女视频| 成人综合婷婷国产精品久久| 韩国女主播一区| 裸体在线国模精品偷拍| 亚洲成人一区二区| 一区二区成人在线视频| 日韩码欧中文字| 中文字幕日韩精品一区| 国产日产欧美一区二区三区| 欧美大肚乱孕交hd孕妇| 91精品国产综合久久精品性色| 在线免费观看一区| 色狠狠一区二区三区香蕉| 91在线精品一区二区| 91色视频在线| 欧美三级三级三级爽爽爽| 欧美最猛性xxxxx直播| 色综合久久综合网| 色一区在线观看| 欧美在线看片a免费观看| 色噜噜久久综合| 91九色最新地址| 欧美人伦禁忌dvd放荡欲情| 欧美调教femdomvk| 在线91免费看| 日韩一区二区三区三四区视频在线观看| 亚洲国产精品成人久久综合一区| 日韩一区二区三区电影| 日韩午夜电影在线观看| 欧美xxx久久| 国产精品网站一区| 亚洲日本va午夜在线影院| 亚洲五月六月丁香激情| 日韩av一区二区三区| 狠狠色丁香婷婷综合久久片| 国产成人精品免费网站| 91丨九色丨尤物| 欧美日韩国产a| 欧美精品一区二区高清在线观看 | 粉嫩高潮美女一区二区三区 | 亚洲精品美国一| 日韩国产精品久久久久久亚洲| 另类中文字幕网| 成人久久视频在线观看| 色综合久久88色综合天天免费| 欧美视频一区二区三区在线观看| 欧美一区二区在线观看| 日本一区二区三区在线不卡 | 欧美日韩国产天堂| 欧美精品一区二区在线观看| 国产精品欧美综合在线| 天天操天天干天天综合网| 国产成人亚洲综合色影视| 91美女视频网站| 精品美女在线播放| 亚洲欧美怡红院| 久久99久久久欧美国产| 色狠狠色噜噜噜综合网| 26uuu欧美| 亚洲第一搞黄网站| 国产成人综合网| 欧美精三区欧美精三区| 国产精品国产三级国产a| 麻豆成人91精品二区三区| 欧洲人成人精品| 中文字幕中文字幕一区| 麻豆freexxxx性91精品| 欧美天堂一区二区三区| 国产精品久久久久久久浪潮网站| 视频一区在线播放| 色综合咪咪久久| 亚洲国产高清在线| 黄色精品一二区| 欧美高清www午色夜在线视频| 亚洲欧美另类久久久精品| 国产麻豆一精品一av一免费| 日韩一区二区三区免费看| 亚洲激情第一区| 成人看片黄a免费看在线| 26uuu国产电影一区二区| 蜜臀av性久久久久蜜臀aⅴ流畅| 欧美四级电影在线观看| 亚洲乱码日产精品bd| www.欧美.com| 成人免费视频在线观看| 成人黄色片在线观看| 久久精品视频网| 国产麻豆91精品| 亚洲精品在线观看视频| 麻豆精品在线播放| 18成人在线观看| 不卡视频免费播放| 中文字幕精品一区| 国产白丝精品91爽爽久久 | 国产99久久久久久免费看农村| 精品国产sm最大网站免费看| 麻豆精品精品国产自在97香蕉| 欧美一级片在线看| 九九精品一区二区| www久久精品| 国产福利一区二区三区视频在线| 精品少妇一区二区三区视频免付费| 美女国产一区二区| 精品国产91乱码一区二区三区| 另类中文字幕网| 久久久国产一区二区三区四区小说 | 亚洲激情图片小说视频| 欧美综合视频在线观看| 亚洲国产毛片aaaaa无费看| 欧美熟乱第一页| 久久99国产精品成人| 久久久久久久综合色一本| 99国产欧美另类久久久精品| 有码一区二区三区| 欧美一区二区视频观看视频 | 国产欧美一区二区精品性| 99久久综合99久久综合网站| 亚洲欧美另类小说视频| 91精品久久久久久久91蜜桃| 国产精品亚洲成人| 亚洲美腿欧美偷拍| 日韩视频中午一区| av在线播放不卡| 麻豆国产精品一区二区三区 | 韩国一区二区三区| 中文字幕亚洲视频| 欧美日韩在线不卡| 国产99久久久精品| 天天做天天摸天天爽国产一区| 久久免费视频色| 欧美亚洲综合网| 国产成人免费视频一区| 亚洲动漫第一页| 久久精品人人做人人爽97| 欧美日韩一区在线| 成人成人成人在线视频| 日韩激情av在线| 亚洲欧洲精品成人久久奇米网| 日韩欧美电影一区| 色久优优欧美色久优优| 国产成人在线视频网站| 日韩国产成人精品| 亚洲美女在线一区| 国产欧美日韩精品一区| 欧美日韩精品电影| 91麻豆福利精品推荐| 国内成人精品2018免费看| 亚洲国产精品欧美一二99| 国产精品午夜电影| 欧美成人艳星乳罩| 4438成人网| 欧美在线一区二区| 99久久99久久免费精品蜜臀| 免费不卡在线观看| 国产99精品在线观看| 午夜精品久久久久久| 亚洲视频一区在线观看| 日本一区二区三级电影在线观看 | 亚洲毛片av在线| 国产日韩视频一区二区三区| 日韩精品资源二区在线| 欧美日韩国产天堂| 欧美日韩精品一区二区三区四区 | 精品一区二区三区日韩| 婷婷一区二区三区|