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

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

?? lcd.c

?? ucgui3.90原嗎,有memdev部分,支持彩旦
?? 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_Private.h"
#include "LCD_Private.h"
#include "GUIDebug.h"

/*********************************************************************
*
*       Defines
*
**********************************************************************
*/

#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; }

/*********************************************************************
*
*       Static code
*
**********************************************************************
*/
/*********************************************************************
*
*       _GetColorIndex
*/
static int _GetColorIndex(int i)  /* i is 0 or 1 */ {
  return  (GUI_Context.DrawMode & LCD_DRAWMODE_REV) ? i-1 : i;
}

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/
/*********************************************************************
*
*       LCD_SetColorIndex
*/
void LCD_SetColorIndex(int Index) {
  LCD_ACOLORINDEX[_GetColorIndex(1)] = Index;
}

/*********************************************************************
*
*       LCD_SetBkColorIndex
*/
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
*/
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_DrawHLine
*/
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);
}

/*********************************************************************
*
*       LCD_FillRect
*/
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);
}

/*********************************************************************
*
*       LCD_DrawBitmap
*/
void LCD_DrawBitmap(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 rotation if necessary */
  #if GUI_SUPPORT_ROTATION
  if (GUI_pLCD_APIList) {
    GUI_pLCD_APIList->pfDrawBitmap(x0, y0, xsize, ysize, xMul, yMul, BitsPerPixel, BytesPerLine, pPixel, pTrans);
    return;
  }
  #endif
  /* Handle the optional Y-magnification */
  y1 = y0 + ysize - 1;
  x1 = x0 + xsize - 1;
/*  Handle BITMAP without magnification */
  if ((xMul | yMul) == 1) {
    int Diff;
    /*  Clip y0 (top) */
    Diff = GUI_Context.ClipRect.y0 - y0;
    if (Diff > 0) {
      ysize -= Diff;
      if (ysize <= 0) {
		    return;
      }
      y0     = GUI_Context.ClipRect.y0;
      #if GUI_SUPPORT_LARGE_BITMAPS                       /* Required only for 16 bit CPUs if some bitmaps are >64kByte */
        pPixel += (U32)     Diff * (U32)     BytesPerLine;
      #else
        pPixel += (unsigned)Diff * (unsigned)BytesPerLine;
      #endif
    }
    /*  Clip y1 (bottom) */
    Diff = y1 - GUI_Context.ClipRect.y1;
    if (Diff > 0) {
      ysize -= Diff;
      if (ysize <= 0) {
		    return;
      }
    }
    /*        Clip right side    */
    Diff = x1 - GUI_Context.ClipRect.x1;
    if (Diff > 0) {
      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 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,y, x+xMul-1, yMax);
            LCD_COLORINDEX = OldColor;
          }
        }
      }
    }
  }
}

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

/*********************************************************************
*
*       LCD_Init
*/
int LCD_Init(void) {
  int r = 0;
  GUI_DEBUG_LOG("\nLCD_Init...");
  LCD_SetClipRectMax();
  r |= LCD_L0_Init();
  #if GUI_NUM_LAYERS > 1
    r |= LCD_L0_1_Init();
  #endif
  #if GUI_NUM_LAYERS > 2
    r |= LCD_L0_2_Init();
  #endif
  #if GUI_NUM_LAYERS > 3
    r |= LCD_L0_3_Init();
  #endif
  #if GUI_NUM_LAYERS > 4
    r |= LCD_L0_4_Init();
  #endif
  LCD_InitLUT();
  {
  #if GUI_NUM_LAYERS > 1
    int i;
    for (i = GUI_NUM_LAYERS - 1; i >= 0; i--) {
      GUI_SelectLayer(i);
  #else
    {
  #endif
      #if (GUI_DEFAULT_BKCOLOR != GUI_INVALID_COLOR)
        /* Clear video memory */
        LCD_SetDrawMode(GUI_DRAWMODE_REV);
        LCD_FillRect(0,0, GUI_XMAX, GUI_YMAX);
        LCD_SetDrawMode(0);
      #endif
    }
  }
  /* Switch LCD on */
  LCD_On();
  return r;
}

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

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

/*********************************************************************
*
*       LCD_SetBkColor
*/
void LCD_SetBkColor(GUI_COLOR color) {
  if (GUI_Context.BkColor != color) {
    GUI_Context.BkColor = color;
    LCD_SetBkColorIndex(LCD_Color2Index(color));
  }
}

/*********************************************************************
*
*       LCD_SetColor
*/
void LCD_SetColor(GUI_COLOR color) {
  if (GUI_Context.Color != color) {
    GUI_Context.Color = color;
    LCD_SetColorIndex(LCD_Color2Index(color));
  }
}

/*************************** End of file ****************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
午夜视频在线观看一区| 成人av在线资源网| 日韩一区二区三区精品视频| 亚洲国产成人av好男人在线观看| 欧美丝袜自拍制服另类| 亚洲成人高清在线| 日韩欧美久久久| 国产一区二区91| 欧美高清在线视频| 91浏览器入口在线观看| 午夜精品久久久久久久99水蜜桃| 欧美一级在线视频| 国内国产精品久久| 亚洲欧洲99久久| 欧美色欧美亚洲另类二区| 蜜桃av一区二区三区电影| 久久五月婷婷丁香社区| 91在线视频观看| 丝袜美腿成人在线| 国产午夜精品久久久久久免费视| heyzo一本久久综合| 亚洲高清免费一级二级三级| 日韩一区二区高清| 丁香啪啪综合成人亚洲小说 | 亚洲精品国产精华液| 欧美精品在线观看一区二区| 国产精品一区在线观看你懂的| 亚洲色大成网站www久久九九| 欧美夫妻性生活| 成人免费看的视频| 日日夜夜精品视频天天综合网| 国产日韩欧美一区二区三区综合| 色吊一区二区三区| 国产一区二区日韩精品| 亚洲一区二区三区在线| 国产调教视频一区| 91精品国产综合久久精品麻豆| 成人精品视频网站| 免费一区二区视频| 一区二区三区在线不卡| 久久久久久久久久美女| 欧美日韩亚洲另类| 97精品视频在线观看自产线路二| 久久99这里只有精品| 亚洲在线中文字幕| 亚洲国产精品高清| 精品国产伦一区二区三区观看方式 | 久久精品夜色噜噜亚洲aⅴ| 91久久精品网| 波多野结衣一区二区三区| 久久精品国产久精国产| 亚洲成人午夜电影| 亚洲伦理在线精品| 国产精品伦理一区二区| 久久综合色婷婷| 日韩一区二区麻豆国产| 欧美高清dvd| 欧美天天综合网| 欧美综合一区二区三区| 99这里都是精品| 成人在线视频一区| 国产成人免费在线观看不卡| 伦理电影国产精品| 日本视频一区二区三区| 亚洲综合视频在线| 一区二区三区四区视频精品免费| 国产精品少妇自拍| 亚洲国产成人在线| 亚洲国产精品二十页| 国产色综合久久| 国产日韩欧美麻豆| 国产日韩欧美精品综合| 国产欧美一区二区精品秋霞影院| 久久综合视频网| 国产日产精品1区| 久久久精品中文字幕麻豆发布| 精品国产91九色蝌蚪| 精品国产一区二区三区忘忧草 | 欧美色图12p| 欧美日韩精品电影| 91精品久久久久久久99蜜桃| 在线成人午夜影院| 日韩一区二区三区观看| 精品国产麻豆免费人成网站| 久久久噜噜噜久久中文字幕色伊伊 | 中文字幕不卡在线| 91小视频在线| 91在线视频播放| 成人h动漫精品一区二| 成人一区二区三区| 成人h版在线观看| 99国产精品一区| 91久久精品一区二区二区| 91久久国产最好的精华液| 在线观看av不卡| 欧美片网站yy| 91精品国产综合久久久蜜臀图片| 国产精品久久久久久久久免费相片 | 337p亚洲精品色噜噜| 日韩欧美国产不卡| 精品国产不卡一区二区三区| 欧美videofree性高清杂交| 26uuu久久天堂性欧美| 精品国内二区三区| 色噜噜久久综合| 欧美精品一级二级三级| 正在播放一区二区| 精品国产乱码久久久久久免费| 久久众筹精品私拍模特| 中文字幕成人网| 国产三级三级三级精品8ⅰ区| 午夜精品国产更新| 日本成人在线看| 国产一区二区三区免费播放| 成人手机在线视频| 高清在线成人网| 欧美日本乱大交xxxxx| 欧美成人bangbros| 国产精品视频在线看| 玉米视频成人免费看| 日本va欧美va瓶| 国产精品影音先锋| 91丨porny丨首页| 51精品秘密在线观看| 国产亚洲一区二区三区在线观看| 国产精品成人免费在线| 亚洲.国产.中文慕字在线| 免费av成人在线| 99亚偷拍自图区亚洲| 欧美男男青年gay1069videost| www国产成人免费观看视频 深夜成人网| 欧美韩国日本不卡| 亚洲日穴在线视频| 国产精品亚洲一区二区三区在线 | 欧美一级欧美一级在线播放| 精品粉嫩aⅴ一区二区三区四区| 一区二区中文视频| 青青草伊人久久| 丰满亚洲少妇av| 日韩精品中文字幕在线不卡尤物 | 欧美一区二区三区免费大片| 国产精品欧美经典| 亚洲电影第三页| 高清国产一区二区三区| 欧美另类高清zo欧美| 国产精品入口麻豆九色| 人禽交欧美网站| 色老汉一区二区三区| 久久免费看少妇高潮| 三级亚洲高清视频| 色婷婷亚洲精品| 日韩免费性生活视频播放| 亚洲高清免费观看高清完整版在线观看| 国产一区二区主播在线| 欧美日韩精品欧美日韩精品一| 国产精品国产自产拍高清av| 久久99最新地址| 日韩精品自拍偷拍| 日韩国产成人精品| 久久一区二区三区国产精品| 午夜欧美视频在线观看| 99久久久免费精品国产一区二区| 欧美精品一区二区三区很污很色的| 亚洲久本草在线中文字幕| 国产不卡高清在线观看视频| 日韩欧美中文字幕一区| 五月婷婷色综合| 91丨九色丨国产丨porny| 国产精品免费视频一区| 国产一区二区三区日韩| 精品国产三级a在线观看| 日韩专区欧美专区| 91一区二区三区在线观看| 亚洲婷婷综合色高清在线| 成人小视频在线| 中文字幕第一区二区| 粉嫩一区二区三区性色av| 欧美不卡一区二区| 国产91精品精华液一区二区三区| 精品日韩欧美在线| 麻豆精品国产91久久久久久| 欧美精品丝袜久久久中文字幕| 中文字幕一区二区三区精华液| 99免费精品视频| 亚洲天堂精品在线观看| 99国产精品久久久久久久久久| 国产精品色一区二区三区| 国产一区视频导航| 亚洲天堂中文字幕| 91黄色小视频| 午夜欧美视频在线观看| 欧美日韩不卡一区二区| 久久不见久久见免费视频1| 欧美不卡在线视频| 国产99精品在线观看| 中文字幕色av一区二区三区| 国产成人免费高清| 一区二区三区四区在线免费观看| 欧美系列一区二区| 日本欧美一区二区三区|