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

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

?? lcd.c

?? ucCos移植到廣州友善nano2410
?? 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羞羞动漫久久久 | 国产亚洲精品aa午夜观看| 中文字幕第一区第二区| 亚洲欧美日本韩国| 午夜电影网亚洲视频| 国产成人在线视频免费播放| 91亚洲精品久久久蜜桃网站| 日韩欧美一级二级三级| 亚洲日本一区二区| 激情综合五月婷婷| 欧洲人成人精品| 欧美高清在线一区二区| 男人的天堂亚洲一区| 色婷婷精品久久二区二区蜜臂av| 精品剧情在线观看| 亚洲男人的天堂网| 偷窥少妇高潮呻吟av久久免费| 日本伊人精品一区二区三区观看方式| 日本强好片久久久久久aaa| 91麻豆免费观看| 欧美哺乳videos| 亚洲国产成人高清精品| 国产91高潮流白浆在线麻豆| 在线看国产日韩| 中文字幕一区二区三区精华液| 亚洲一区二区三区中文字幕| 不卡高清视频专区| 日韩欧美电影一二三| 亚洲午夜精品在线| 91黄色激情网站| 18欧美亚洲精品| 91网站最新地址| 1000部国产精品成人观看| 韩国v欧美v亚洲v日本v| 91麻豆精品国产| 午夜激情综合网| 欧美精品精品一区| 婷婷国产v国产偷v亚洲高清| 欧美日韩在线综合| 亚洲在线观看免费视频| 欧美亚洲精品一区| 亚洲一区二区五区| 欧美日韩国产影片| 奇米精品一区二区三区在线观看一| 色婷婷精品久久二区二区蜜臀av| 亚洲美女在线国产| 欧美日韩国产精选| 精品一区二区影视| 欧美v亚洲v综合ⅴ国产v| 国产一区不卡在线| 欧美国产精品专区| 一本色道久久综合亚洲精品按摩| 亚洲高清视频在线| 日韩三级在线免费观看| 国产91富婆露脸刺激对白| 亚洲精品国产一区二区精华液 | 成人免费毛片a| 亚洲精品免费在线观看| 欧美一级爆毛片| 色av成人天堂桃色av| 天堂成人国产精品一区| 亚洲国产精品激情在线观看| 欧美日韩你懂的| 99精品视频中文字幕| 美女一区二区三区在线观看| 亚洲美女免费视频| 久久伊人中文字幕| 91蝌蚪porny九色| 国产一区在线视频| 视频在线在亚洲| 国产精品剧情在线亚洲| 正在播放一区二区| 欧美专区日韩专区| 色综合天天天天做夜夜夜夜做| 精品在线免费视频| 一区二区三区日韩精品| 国产亚洲1区2区3区| 日韩视频免费观看高清完整版在线观看| 成人精品一区二区三区四区| 性感美女极品91精品| 一区二区高清免费观看影视大全| 中日韩av电影| 日韩一区欧美小说| 国产精品网曝门| 中文字幕五月欧美| 亚洲欧美视频一区| 亚洲欧美激情小说另类| 日韩精品中午字幕| 精品日韩在线观看| 欧美成人bangbros| 国产日韩欧美精品在线| 精品国产免费一区二区三区四区| 日韩一区二区免费在线电影| 欧美一区二区二区| 久久先锋影音av| 1区2区3区欧美| 亚洲综合色丁香婷婷六月图片| 一区二区三区蜜桃| 免费观看30秒视频久久| 成a人片亚洲日本久久| 日本韩国欧美在线| 日韩视频一区在线观看| 国产校园另类小说区| 亚洲第一狼人社区| 国产精品自拍av| 欧美日韩三级一区| 日韩视频免费观看高清在线视频| 中文字幕不卡一区| 日韩国产一区二| 欧美成人在线直播| 日本一区二区综合亚洲| 亚洲免费看黄网站| 国产成人在线网站| 日韩色在线观看| 亚洲成人一区在线| 91福利国产成人精品照片| 国产偷国产偷亚洲高清人白洁| 午夜影院久久久| 国产成人av一区二区三区在线观看| 成人ar影院免费观看视频| 欧美成人高清电影在线| 天天影视色香欲综合网老头| 99精品视频一区二区三区| www国产亚洲精品久久麻豆| 天天操天天色综合| 色一情一乱一乱一91av| 亚洲男人都懂的| 99精品视频在线观看免费| 国产精品久久毛片a| 国产a级毛片一区| 国产精品久久久久永久免费观看| 精品写真视频在线观看 | 欧美午夜影院一区| 亚洲精品成人少妇| 97se亚洲国产综合自在线| 国产精品久久久99| 欧美性大战xxxxx久久久| 美腿丝袜亚洲综合| 国产精品传媒入口麻豆| 欧洲色大大久久| 国产最新精品免费| 一区二区三区日韩精品| 亚洲精品一区二区三区99| 成人av影视在线观看| 免费成人小视频| 亚洲国产日韩一级| 综合久久久久综合| 国产欧美日韩激情| 91精品国产91久久久久久一区二区| 丁香一区二区三区| 免费的国产精品| 亚洲第一主播视频| 亚洲美女屁股眼交3| 亚洲欧美激情视频在线观看一区二区三区| 欧美日韩精品一区二区三区蜜桃| 国产精品性做久久久久久| 日日噜噜夜夜狠狠视频欧美人 | av电影在线不卡| 国产最新精品免费| 久久国产精品区| 日本中文字幕一区二区视频| 亚洲小说欧美激情另类| 亚洲欧美一区二区三区久本道91| 国产欧美日韩另类视频免费观看 | 麻豆精品视频在线| 欧美aaaaa成人免费观看视频| 日韩高清在线不卡| 亚洲一区二区三区爽爽爽爽爽| 日韩一区日韩二区| 一区二区三区日韩精品| 国产精品电影一区二区三区| 久久久激情视频| 亚洲欧洲av另类| 亚洲美女一区二区三区| 午夜天堂影视香蕉久久| 激情久久五月天| 99久久免费精品| 欧美日韩黄色一区二区| 精品久久久久久久久久久久久久久久久 | 国产一区二区在线免费观看| 盗摄精品av一区二区三区| 色狠狠色噜噜噜综合网| 91精品欧美福利在线观看| 久久先锋资源网| 亚洲一级二级三级在线免费观看| 日韩二区三区四区| www.亚洲国产| 日韩一区二区三区精品视频| 国产精品美女久久久久aⅴ国产馆| 亚洲欧美日本韩国| 国产精品综合av一区二区国产馆| 97精品国产97久久久久久久久久久久| 欧美日韩日本视频|