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

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

?? lcd.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.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一区二区三区免费野_久草精品视频
亚洲国产岛国毛片在线| 亚洲综合色丁香婷婷六月图片| 91免费观看视频在线| 秋霞国产午夜精品免费视频| 综合中文字幕亚洲| 久久久噜噜噜久噜久久综合| 欧美肥妇毛茸茸| 91网站最新网址| 国产成人在线电影| 蜜臀精品久久久久久蜜臀| 一区二区三区在线观看国产| 欧美激情一区二区三区四区| 欧美xxxxxxxxx| 91精品国产综合久久福利 | 日欧美一区二区| 亚洲美女区一区| 国产欧美一区二区三区在线老狼| 欧美一区二区性放荡片| 欧洲中文字幕精品| av激情综合网| 丁香桃色午夜亚洲一区二区三区| 美女视频网站久久| 日产国产高清一区二区三区| 亚洲图片欧美色图| 亚洲综合男人的天堂| 亚洲三级在线免费| 国产精品麻豆欧美日韩ww| 久久美女艺术照精彩视频福利播放| 欧美一区二区三区成人| 欧美丰满少妇xxxxx高潮对白| 欧亚洲嫩模精品一区三区| 一本到三区不卡视频| 91丝袜美腿高跟国产极品老师| 成人免费毛片aaaaa**| 成人午夜看片网址| 99久久精品国产一区| 波多野结衣中文一区| 99久久免费国产| 久久久www成人免费毛片麻豆| 欧美电影免费观看高清完整版在| 日韩一区二区三区在线观看| 欧美一级免费观看| 日韩精品一区二区三区视频播放| 欧美一区二区黄色| 欧美sm美女调教| 久久亚洲二区三区| 国产日产欧美精品一区二区三区| 欧美极品美女视频| 亚洲欧美一区二区不卡| 一区二区免费视频| 日本视频中文字幕一区二区三区| 男人的j进女人的j一区| 激情综合色播激情啊| 国产成人啪免费观看软件| 成人av网站免费| 91福利国产成人精品照片| 欧美日韩一区二区三区在线看| 欧美精品日韩综合在线| 精品久久久久久久人人人人传媒 | 亚洲综合网站在线观看| 亚洲v中文字幕| 久久99蜜桃精品| 国产91精品在线观看| 91黄色免费观看| 欧美一级片在线看| 国产精品剧情在线亚洲| 亚洲成人资源在线| 极品美女销魂一区二区三区| 成人a级免费电影| 亚洲品质自拍视频| 天堂精品中文字幕在线| 国产精品一区免费视频| 99精品黄色片免费大全| 欧美日韩一区二区电影| 精品国产区一区| 亚洲欧美电影一区二区| 蜜桃视频一区二区| 91婷婷韩国欧美一区二区| 欧美一区二区三区爱爱| 国产精品乱码一区二区三区软件 | 亚洲一区免费视频| 久久国产精品99精品国产| eeuss鲁片一区二区三区在线观看| 欧美色中文字幕| 国产欧美精品一区aⅴ影院| 一区二区三区在线不卡| 国产乱码精品一品二品| 欧美日韩中文国产| 国产精品女同一区二区三区| 日韩电影在线一区二区三区| 成人午夜电影网站| 91精品国产91久久久久久一区二区| 久久久精品人体av艺术| 亚洲一区在线播放| 成人黄色免费短视频| 日韩亚洲欧美一区| 一区二区三区美女视频| 国产河南妇女毛片精品久久久| 欧美色大人视频| 综合欧美一区二区三区| 国产乱码精品一区二区三区五月婷| 欧美日韩一区二区在线观看| 国产精品免费丝袜| 国产精品一区二区你懂的| 5566中文字幕一区二区电影| 亚洲理论在线观看| bt欧美亚洲午夜电影天堂| 久久色视频免费观看| 免费在线观看精品| 欧美日韩精品免费| 亚洲女厕所小便bbb| 亚洲精品在线网站| 日本在线不卡视频一二三区| 日本精品视频一区二区三区| 国产精品久久久久三级| 国产99久久久国产精品| 欧美成人vps| 久久精品国产网站| 91精品国产欧美一区二区成人 | 亚洲欧美另类小说视频| 国产传媒久久文化传媒| 精品久久久久久最新网址| 蜜桃久久久久久| 日韩欧美成人一区| 日韩专区欧美专区| 欧美一区二区三区视频免费播放| 亚洲午夜在线电影| 欧美性大战久久久久久久 | 日韩av电影免费观看高清完整版 | a4yy欧美一区二区三区| 国产精品入口麻豆九色| 波多野结衣欧美| 欧美国产日本韩| 成人国产一区二区三区精品| 国产精品蜜臀在线观看| 成人午夜大片免费观看| 国产精品久久久久aaaa樱花| 成人18精品视频| 国产精品久久久久影院老司| 99国产精品国产精品久久| 亚洲免费av观看| 欧美日韩视频一区二区| 午夜精品aaa| 日韩欧美你懂的| 国产成人精品免费在线| 中文字幕欧美激情| 99国产精品国产精品久久| 亚洲一区二区三区四区不卡| 欧美久久一二区| 91麻豆精品国产无毒不卡在线观看| 午夜影院久久久| 日韩一区二区三| 风间由美性色一区二区三区| 亚洲欧美国产三级| 亚洲综合免费观看高清在线观看| 欧美激情综合五月色丁香小说| 成人午夜激情视频| 91精品国产91久久久久久一区二区| 欧美一级二级三级蜜桃| 日韩一区精品视频| 337p日本欧洲亚洲大胆精品 | 美女免费视频一区| 国产视频911| 在线观看亚洲精品| 美女视频黄a大片欧美| 中文字幕av免费专区久久| 日本精品一区二区三区高清 | 色吧成人激情小说| 日本视频免费一区| 国产精品毛片大码女人| 91国产福利在线| 激情六月婷婷久久| 亚洲免费伊人电影| 欧美mv日韩mv| 色综合网色综合| 精品一区二区影视| 亚洲视频中文字幕| 日韩免费观看高清完整版| av网站免费线看精品| 偷拍一区二区三区| 国产精品欧美久久久久无广告| 欧美狂野另类xxxxoooo| 欧美大片免费久久精品三p| 成人一区二区三区| 日韩国产在线观看一区| 亚洲国产岛国毛片在线| 91精品中文字幕一区二区三区| 懂色av一区二区三区免费观看| 亚洲影视在线观看| 国产精品热久久久久夜色精品三区| 欧美日韩dvd在线观看| 成人国产免费视频| 狠狠色丁香久久婷婷综| 亚洲一区二区三区四区不卡| 国产精品视频看| 欧美精品一区二区三区一线天视频| 欧美在线free| 成人av第一页| 国产成+人+日韩+欧美+亚洲| 热久久久久久久|