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

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

?? lcd_rotate180.c

?? 這套代碼已經成功一直到S3C44B0X開發板上
?? 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_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一区二区三区免费野_久草精品视频
亚洲影视在线播放| 激情综合网av| 欧美美女bb生活片| 国产精品视频观看| 91网址在线看| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 中文字幕成人av| 一道本成人在线| 午夜精品福利久久久| 欧美大片在线观看一区二区| 精品一区二区综合| 国产精品午夜久久| 欧美日韩一区二区三区不卡| 亚洲一区二区在线免费观看视频| 91福利国产精品| 国产一区二区三区高清播放| 亚洲欧美一区二区不卡| 欧美日韩免费观看一区二区三区| 亚洲午夜精品在线| 国产精品三级视频| 欧美日韩美女一区二区| 成人激情动漫在线观看| 日本视频中文字幕一区二区三区 | 99精品在线观看视频| 亚洲成人黄色影院| 有坂深雪av一区二区精品| 久久综合色鬼综合色| 欧美自拍偷拍一区| 欧美日精品一区视频| 欧美撒尿777hd撒尿| 在线成人高清不卡| 欧美日韩免费观看一区二区三区| 欧美人狂配大交3d怪物一区 | 国产成人av福利| 国产九色sp调教91| 色综合久久综合| 在线免费观看不卡av| 欧美精品日韩一本| 中文字幕的久久| 最新国产成人在线观看| 依依成人精品视频| 三级欧美韩日大片在线看| 久久精品久久精品| 白白色亚洲国产精品| 欧美夫妻性生活| 国产精品视频在线看| 午夜精品影院在线观看| 国产91露脸合集magnet | 欧美一区二区三区四区久久 | 亚洲免费观看高清| 麻豆精品一区二区av白丝在线| 国产 日韩 欧美大片| 欧美日韩国产影片| 国产网红主播福利一区二区| 亚洲成人你懂的| 风间由美一区二区av101| 7777精品久久久大香线蕉| 国产欧美日韩在线观看| 久久国产婷婷国产香蕉| 欧美三级电影网| 一区二区三区四区高清精品免费观看 | 欧美日韩电影一区| 亚洲老司机在线| 91国在线观看| 亚洲三级在线播放| 91蜜桃在线观看| 亚洲精品欧美专区| 色妞www精品视频| 欧美国产1区2区| av在线综合网| 国产精品动漫网站| 91免费在线播放| 亚洲欧美一区二区三区极速播放| 国产成人鲁色资源国产91色综| 精品国产一区二区精华| 日韩高清一区在线| 日韩视频免费直播| 国产美女精品一区二区三区| 国产欧美日韩在线观看| 丁香亚洲综合激情啪啪综合| 中文字幕国产一区| a级高清视频欧美日韩| 亚洲蜜桃精久久久久久久| 色狠狠色狠狠综合| 精品制服美女久久| 最好看的中文字幕久久| 欧美性一级生活| 精品无码三级在线观看视频| 国产视频一区二区在线观看| 在线观看视频一区| 国产一区二区三区观看| 五月天亚洲婷婷| 日本一二三四高清不卡| 欧美一区二区福利视频| 91视频一区二区三区| 精品一区免费av| 亚洲不卡在线观看| 亚洲美女免费视频| 久久久久久久久久美女| 欧美精品自拍偷拍动漫精品| 99视频精品免费视频| 国产麻豆9l精品三级站| 久久精品国产网站| 五月天激情综合| 亚洲福利视频导航| 亚洲精品午夜久久久| 综合欧美亚洲日本| 亚洲国产岛国毛片在线| 久久久精品免费免费| 精品久久久久久久久久久久包黑料| 欧美在线你懂得| 欧美日韩日日骚| 欧美人伦禁忌dvd放荡欲情| 在线免费视频一区二区| 欧美丝袜丝交足nylons| 欧美日韩一区在线观看| 欧美最新大片在线看| 欧美日韩一区二区欧美激情| 91麻豆精品国产91久久久资源速度| 91女厕偷拍女厕偷拍高清| 国产suv一区二区三区88区| 国产精品亚洲专一区二区三区 | 精品国产电影一区二区| 日韩一区二区电影| 国产拍欧美日韩视频二区| 国产精品久久久久久久第一福利| 国产欧美一区二区精品婷婷| 中文字幕一区二区三区不卡在线| 亚洲视频资源在线| 日韩av中文在线观看| 高清在线观看日韩| 在线免费观看视频一区| 国产午夜精品久久久久久久| 亚洲国产日韩一区二区| 国产一区二区中文字幕| 欧美午夜不卡在线观看免费| 欧美精品一区二区三区蜜桃| 亚洲精品日产精品乱码不卡| 精品一区二区三区在线播放 | 91丨porny丨蝌蚪视频| 欧美大片在线观看一区| 亚洲在线视频一区| 成人午夜av电影| 精品毛片乱码1区2区3区| 亚洲乱码国产乱码精品精98午夜| 国产一区二区美女| 欧美丰满少妇xxxxx高潮对白| 亚洲日本va午夜在线影院| 国产麻豆日韩欧美久久| 日韩欧美成人一区| 日本成人中文字幕| 欧美日本精品一区二区三区| 一区二区免费在线播放| 91在线视频免费观看| 国产精品乱人伦一区二区| 国产一区二区三区在线观看精品 | 欧美国产综合色视频| 激情综合色播五月| 久久色视频免费观看| 韩国在线一区二区| 国产人久久人人人人爽| 国产成人av电影在线| 亚洲欧洲精品一区二区精品久久久| 国产91丝袜在线观看| 亚洲图片另类小说| 欧美日韩视频专区在线播放| 美女一区二区三区在线观看| 精品美女一区二区| 91女神在线视频| 日韩电影在线观看一区| 精品国产乱码久久久久久牛牛| 岛国精品在线观看| 日韩精品高清不卡| 中文字幕av一区 二区| 欧美伊人久久大香线蕉综合69| 五月天婷婷综合| 国产精品乱人伦中文| 欧美大度的电影原声| 色哟哟精品一区| 国产精品一区二区三区网站| 亚洲日本一区二区| 久久亚洲综合色一区二区三区 | 国产成人在线视频免费播放| 亚洲va中文字幕| 亚洲品质自拍视频| 国产欧美日韩一区二区三区在线观看 | 日韩一二三区视频| 欧美色涩在线第一页| eeuss鲁片一区二区三区在线观看| 亚洲国产精品久久不卡毛片| 中文字幕不卡在线| 国产欧美日韩麻豆91| 精品国产污网站| 久久久久久久电影| 久久一区二区三区四区| 国产日韩精品一区二区三区在线| 日韩精品影音先锋| 精品美女在线观看| 日本一区二区三区四区| 国产精品女同一区二区三区|