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

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

?? lcd.c

?? Keil C下通過的UCGUI,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.c
Purpose     : Link between GUI and LCD_L0
              Performs most of the clipping.
---------------------------END-OF-HEADER------------------------------
*/

#define LCD_C

#include <stdio.h>
#include "gui\Core\GUI_Private.h"
#include "gui\Core\LCD_Private.h"
#include "gui\Core\GUIDebug.h"

/*
        *********************************************************
        *                                                       *
        *       Macros for internal use                         *
        *                                                       *
        *********************************************************
*/

#define RETURN_IF_Y_OUT() \
  if (y < GUI_Context.ClipRect.y0) return;             \
  if (y > GUI_Context.ClipRect.y1) return;

#define RETURN_IF_X_OUT() \
  if (x < GUI_Context.ClipRect.x0) return;             \
  if (x > GUI_Context.ClipRect.x1) return;

#define CLIP_X() \
  if (x0 < GUI_Context.ClipRect.x0) { x0 = GUI_Context.ClipRect.x0; } \
  if (x1 > GUI_Context.ClipRect.x1) { x1 = GUI_Context.ClipRect.x1; }

#define CLIP_Y() \
  if (y0 < GUI_Context.ClipRect.y0) { y0 = GUI_Context.ClipRect.y0; } \
  if (y1 > GUI_Context.ClipRect.y1) { y1 = GUI_Context.ClipRect.y1; }


/*
        *********************************************************
        *                                                       *
        *       LCD_SetColorIndex                               *
        *       LCD_SetBkColorIndex                             *
        *                                                       *
        *********************************************************
*/
static int GetColorIndex(int i)  /* i is 0 or 1 */ {
  return  (GUI_Context.DrawMode & LCD_DRAWMODE_REV) ? i-1 : i;
}

void LCD_SetColorIndex(int Index)   { LCD_ACOLORINDEX[GetColorIndex(1)] = Index; }
void LCD_SetBkColorIndex(int Index) { LCD_ACOLORINDEX[GetColorIndex(0)] = Index; }

/*
        *********************************************************
        *                                                       *
        *       LCD_SetDrawMode                                 *
        *                                                       *
        *********************************************************

*/
LCD_DRAWMODE LCD_SetDrawMode  (LCD_DRAWMODE dm) {
  LCD_DRAWMODE OldDM = GUI_Context.DrawMode;
  if ((GUI_Context.DrawMode^dm) & LCD_DRAWMODE_REV) {
    LCD_PIXELINDEX temp = LCD_BKCOLORINDEX;
    LCD_BKCOLORINDEX    = LCD_COLORINDEX;
    LCD_COLORINDEX = temp;
  }
  GUI_Context.DrawMode = dm;
  return OldDM;
}


/*
        *********************************************************
        *                                                       *
        *       LCD_DrawPixel                                   *
        *                                                       *
        *********************************************************

Purpose:  This routine is called by emWin. It writes 1 pixel into the
          display using the current drawing mode.

*/


void LCD_DrawPixel(int x, int y) {
  RETURN_IF_Y_OUT();
  RETURN_IF_X_OUT();
  if (GUI_Context.DrawMode & LCD_DRAWMODE_XOR) {
    LCDDEV_L0_XorPixel(x, y);
  } else {
    LCDDEV_L0_SetPixelIndex(x, y, LCD_COLORINDEX);
  }
}

/*
        *********************************************************
        *                                                       *
        *          LCD_DrawLine  vertical/horizontal            *
        *          LCD_DrawRect                                 *
        *                                                       *
        *********************************************************
*/

void LCD_DrawHLine  (int x0, int y,  int x1) {
  /* Perform clipping and check if there is something to do */
  RETURN_IF_Y_OUT();
  CLIP_X();
  if (x1<x0)
    return;
  /* Call driver to draw */
  LCDDEV_L0_DrawHLine(x0, y, x1);
}

void LCD_FillRect(int x0, int y0, int x1, int y1) {
  /* Perform clipping and check if there is something to do */
  CLIP_X();
  if (x1<x0)
    return;
  CLIP_Y();
  if (y1<y0)
    return;
  /* Call driver to draw */
  LCDDEV_L0_FillRect(x0,y0,x1,y1);
}







/*
    **********************************************************************
    *                                                                    *
    *             Universal draw Bitmap routine                          *
    *                                                                    *
    **********************************************************************
*/
void LCD_DrawBitmap   (int x0, int y0,
                       int xsize, int ysize,
                       int xMul, int yMul,
                       int BitsPerPixel,
                       int BytesPerLine,
                       const U8* pPixel,
                       const LCD_PIXELINDEX* pTrans) {
  U8  Data;
  int x1, y1;
//  const LCD_PIXELINDEX* pTrans;
  /* Handle the optional Y-magnification */
  y1 = y0+ysize-1;
  x1 = x0+xsize-1;
/*  Handle BITMAP without magnification */
  if ((xMul==1) && (yMul==1)) {
    int Diff;
    /*    Clip Y    */
    if (y0 < GUI_Context.ClipRect.y0) {
      Diff = GUI_Context.ClipRect.y0 -y0;
      y0     = GUI_Context.ClipRect.y0;
      pPixel += Diff*BytesPerLine;
      ysize -= Diff;
    }
    if (y1 > GUI_Context.ClipRect.y1) {
      int Diff = y1-GUI_Context.ClipRect.y1;
      ysize -= Diff;
    }
    if (ysize <=0)
		  return;
    /*        Clip right side    */
    if (x1 > GUI_Context.ClipRect.x1) {
      int Diff = x1-GUI_Context.ClipRect.x1;
      xsize -= Diff;
    }
    /*        Clip left side ... (The difficult side ...)    */
    Diff =0;
    if (x0 < GUI_Context.ClipRect.x0) {
      Diff = GUI_Context.ClipRect.x0-x0;
			xsize-=Diff;
			switch (BitsPerPixel) {
			case 1:
  			pPixel+= (Diff>>3); x0 += (Diff>>3)<<3; Diff &=7;
				break;
			case 2:
	  		pPixel+= (Diff>>2); x0 += (Diff>>2)<<2; Diff &=3;
				break;
			case 4:
				pPixel+= (Diff>>1); x0 += (Diff>>1)<<1; Diff &=1;
				break;
			case 8:
				pPixel+= Diff;      x0 += Diff; Diff=0;
				break;
			case 16:
				pPixel+= (Diff<<1); x0 += Diff; Diff=0;
				break;
			}
    }
    if (xsize <=0)
		  return;
    LCDDEV_L0_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* 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,y, x+xMul-1, yMax);
            LCD_COLORINDEX = OldColor;
          }
        }
      }
    }
  }
}



/*********************************************************************
*
*           Set Max Clip Rect
*
**********************************************************************
*/

void LCD_SetClipRectMax(void) {
  LCDDEV_L0_GetRect(&GUI_Context.ClipRect);
}



/*
        *********************************************************
        *                                                       *
        *       LCD_Init : Init the display                     *
        *                                                       *
        *********************************************************
*/

int  LCD_Init(void) {
  int r;
  GUI_DEBUG_LOG("\nLCD_Init...");
  LCD_SetClipRectMax();
  if ((r = LCD_L0_Init()) != 0)
    return r;
#if LCD_NUM_DISPLAYS > 1
  if ((r = LCD_L0_1_Init()) != 0)
    return r;
#endif
  LCD_InitLUT();
/* Clear video memory */
  LCD_SetDrawMode(GUI_DRAWMODE_REV);
  LCD_FillRect(0,0, GUI_XMAX, GUI_YMAX);
  LCD_SetDrawMode(0);
/* Switch LCD on */
  LCD_On();
  return 0;
}


/*********************************************************************
*
*           LCD_Index2Color
*           LCD_Color2Index
*
**********************************************************************
*/

int LCD_Color2Index     (LCD_COLOR Color) {
  return LCDDEV_L0_Color2Index(Color);
}

LCD_COLOR LCD_Index2Color (int Index) {
  return LCDDEV_L0_Index2Color(Index);
}



/*********************************************************************
*
*           LCD_SetBkColor
*           LCD_SetColor
*
**********************************************************************

Purpose:  Assign color/index to foreground/ background
*/


void LCD_SetBkColor(GUI_COLOR color) {
  LCD_SetBkColorIndex(LCD_Color2Index(color));
}

void LCD_SetColor(GUI_COLOR color) {
  LCD_SetColorIndex(LCD_Color2Index(color));
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大片一区二区| 亚洲图片有声小说| av一区二区不卡| 亚洲伦理在线精品| 精品视频1区2区| 日韩一区二区在线免费观看| 蜜桃视频在线一区| 久久久精品免费观看| 99视频精品在线| 亚洲国产成人av网| 日韩欧美激情四射| 成人一区二区三区视频在线观看 | 国产日韩欧美一区二区三区综合| 成人免费高清在线| 亚洲激情第一区| 日韩一区二区视频在线观看| 国产乱码精品1区2区3区| 自拍偷在线精品自拍偷无码专区| 在线免费观看成人短视频| 日本成人中文字幕在线视频| 久久九九99视频| 色综合久久久久久久| 秋霞成人午夜伦在线观看| 久久久国产综合精品女国产盗摄| 色偷偷久久一区二区三区| 视频一区中文字幕| 久久精品视频在线看| 色域天天综合网| 日本少妇一区二区| 国产精品色在线| 天天色 色综合| 久久久久久夜精品精品免费| 色综合中文字幕国产 | 一本色道久久加勒比精品| 日韩精品国产欧美| 中文在线一区二区| 在线播放一区二区三区| 国产成人精品三级麻豆| 亚洲国产成人porn| 欧美国产精品v| 欧美久久一二区| 国产91清纯白嫩初高中在线观看| 亚洲国产精品人人做人人爽| 久久久一区二区| 欧美日韩在线免费视频| 国产成人亚洲综合a∨猫咪| 性做久久久久久免费观看| 国产亚洲成av人在线观看导航| 欧美三级午夜理伦三级中视频| 国产精品一区二区在线观看不卡| 性做久久久久久久久| 中文字幕精品综合| 裸体在线国模精品偷拍| 亚洲欧美日韩国产另类专区| 久久看人人爽人人| 欧美人伦禁忌dvd放荡欲情| 成人激情午夜影院| 久久精品国产秦先生| 一区二区久久久久久| 国产欧美日韩三级| 欧美一区二区视频在线观看 | 久久亚洲一区二区三区四区| 欧日韩精品视频| 成人精品国产免费网站| 麻豆免费看一区二区三区| 一区二区三区不卡视频| 中文一区一区三区高中清不卡| 欧美一级理论片| 欧美日韩在线观看一区二区| 91在线观看成人| 国产成人h网站| 久久精品国产成人一区二区三区| 亚洲aⅴ怡春院| 亚洲免费高清视频在线| 国产精品色哟哟| 2024国产精品视频| 91精品国产综合久久国产大片| 色菇凉天天综合网| 一区二区三区在线观看动漫| 国产亚洲欧洲一区高清在线观看| 91精品综合久久久久久| 在线免费观看一区| 91丨porny丨国产入口| 国产成人精品免费看| 国产在线精品不卡| 精品亚洲aⅴ乱码一区二区三区| 五月天激情小说综合| 亚洲欧美日韩电影| 日韩一区有码在线| 国产精品美女一区二区在线观看| 精品91自产拍在线观看一区| 日韩一二在线观看| 4438x成人网最大色成网站| 欧美三级电影一区| 欧美性色综合网| 在线观看视频91| 欧洲另类一二三四区| 欧美最猛黑人xxxxx猛交| 色婷婷综合久久久久中文 | 成人免费av网站| 国产二区国产一区在线观看| 国产激情精品久久久第一区二区| 国产麻豆日韩欧美久久| 国产老肥熟一区二区三区| 久久er精品视频| 久久不见久久见中文字幕免费| 麻豆免费精品视频| 欧美sm极限捆绑bd| 精品国产免费一区二区三区四区| 精品日本一线二线三线不卡| 26uuu亚洲综合色| www成人在线观看| 国产肉丝袜一区二区| 日本一区二区三级电影在线观看| 欧美国产丝袜视频| 中文字幕日韩一区| 亚洲精品久久7777| 亚洲成人资源在线| 日韩精品久久理论片| 美女尤物国产一区| 国产美女精品一区二区三区| 国产91精品精华液一区二区三区| 成人免费黄色大片| 91免费精品国自产拍在线不卡| 欧美在线免费观看亚洲| 欧美乱熟臀69xxxxxx| 日韩三级在线观看| 久久久久久97三级| 国产精品久久久久一区二区三区| 自拍偷拍国产精品| 亚洲午夜激情网页| 另类人妖一区二区av| 国产91精品一区二区麻豆网站| 成人精品gif动图一区| 在线一区二区视频| 91精品国产综合久久久蜜臀图片| 久久久亚洲精品石原莉奈 | 日韩中文字幕1| 另类成人小视频在线| 国产精品1区2区| 91免费在线播放| 欧美精品亚洲二区| 精品久久久网站| 一区免费观看视频| 亚洲成人在线网站| 精东粉嫩av免费一区二区三区| 成人做爰69片免费看网站| 91精彩视频在线| 欧美va亚洲va| 亚洲欧美色综合| 日韩电影免费一区| 成人三级伦理片| 欧美日韩亚洲不卡| 久久久亚洲欧洲日产国码αv| 亚洲人成电影网站色mp4| 视频一区二区欧美| 国产精品1024久久| 天天av天天翘天天综合网色鬼国产 | 亚洲福利视频一区二区| 久久se这里有精品| 色域天天综合网| 欧美mv和日韩mv的网站| 国产精品久久久久aaaa樱花| 视频在线观看91| 成人av午夜电影| 欧美精品在线观看播放| 国产精品全国免费观看高清| 午夜在线成人av| 国产91高潮流白浆在线麻豆| 欧美色网一区二区| 国产欧美日韩不卡| 亚洲高清久久久| 国产不卡免费视频| 欧美日韩国产精品自在自线| 国产日韩v精品一区二区| 无码av免费一区二区三区试看| 国产传媒欧美日韩成人| 欧美狂野另类xxxxoooo| 国产精品青草久久| 久久精品久久精品| 欧美视频精品在线观看| 国产欧美日韩在线看| 日韩成人av影视| 色哟哟一区二区在线观看| 久久久av毛片精品| 五月综合激情婷婷六月色窝| 成人美女在线观看| 日韩午夜三级在线| 一级做a爱片久久| 国产成人免费视频一区| 欧美一级久久久| 欧美在线一区二区| 国产精品美女久久久久久| 青青草国产精品97视觉盛宴| 91国产视频在线观看| 国产欧美一区视频| 九九**精品视频免费播放| 欧美色综合网站| ...中文天堂在线一区| 国产在线麻豆精品观看|