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

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

?? gui_fillpolygon.c

?? Samsung ARM7 s3c44b0 + uC-OSii + uC-GUI 完美的綜合到了一起
?? 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        : GUI_FillPolygon.CPurpose     : Fill polygon routine---------------------------END-OF-HEADER------------------------------*/#include <stddef.h>           /* needed for definition of NULL */#include "GUI_Protected.H"#include "GUIDebug.h"/**********************************************************              Configurable defines***********************************************************//*#define GUI_USE_POLYV2 1*//*        *********************************************************        *                                                       *        *              Fill Polygon                             *        *                                                       *        **********************************************************//*    **********************************    *                                *    *      Helper functions          *    *                                *    ***********************************//*  This function returns the x-coordinate of the intersection  of the given line at the given y-coordinate.  If there is no intersection, GUI_XMAX is returned.  This routine does not work for horizontal lines, as there  would be more than a single point as intersection. This situation  needs to be checked prior to calling the routine.*/int GL_CheckYInterSect(int y, const GUI_POINT*paPoint0                            , const GUI_POINT*paPoint1) {  int x0,y0,x1,y1;  if (paPoint0->y <= (paPoint1)->y) {    y0 = paPoint0->y;    if (y0>y)      /* Check if there is an intersection ... (early out) */      return GUI_XMAX+1;    y1 = paPoint1->y;    if (y1<y)      /* Check if there is an intersection ... (early out) */      return GUI_XMAX+1;    x0 = paPoint0->x;    x1 = paPoint1->x;  } else {    y0 = paPoint1->y;    if (y0>y)      /* Check if there is an intersection ... (early out) */      return GUI_XMAX+1;    y1 = paPoint0->y;    if (y1<y)      /* Check if there is an intersection ... (early out) */      return GUI_XMAX+1;    x0 = paPoint1->x;    x1 = paPoint0->x;  }/* Calc intermediate variables *//* Calculate intersection */  {    I32 Mul = (I32)(x1-x0)* (I32)(y-y0);    if (Mul >0)      Mul += (y1-y0)>>1;	  /* for proper rounding */    else      Mul -= ((y1-y0)>>1)-1;	  /* for proper rounding */    x0 +=Mul/(y1-y0);  }  return x0;} int GL_GetSign(int v) {  if (v>0)    return 1;  if (v<0)    return -1;  return 0;}/***********************************************************************      GL_FillPolygon   - Old Version***********************************************************************  The routine(s) below fill a given polygon.*/#if !defined(GUI_USE_POLYV2) /* Old proven, but slow version */void GL_FillPolygon  (const GUI_POINT*paPoint, int NumPoints, int xOff, int yOff) {  int i;  int y;  int yMin = GUI_YMAX;  int yMax = GUI_YMIN;/* First step : find uppermost and lowermost coordinates */  for (i=0; i<NumPoints; i++) {    y = (paPoint+i)->y;    if (y<yMin)      yMin = y;    if (y>yMax)      yMax = y;  }/* Use Clipping rect to reduce calculation (if possible) */  if (GUI_Context.pClipRect_HL) {    if (yMax > (GUI_Context.pClipRect_HL->y1 -yOff))      yMax = (GUI_Context.pClipRect_HL->y1 -yOff);    if (yMin < (GUI_Context.pClipRect_HL->y0 -yOff))      yMin = (GUI_Context.pClipRect_HL->y0 -yOff);  }/* Second step: Calculate and draw horizontal lines */  for (y=yMin; y<=yMax; y++) {    int x0 = GUI_XMIN;         /* Left edge of line */    int LineCntTotal =0;    /* Draw all line segments */    while (x0<GUI_XMAX) {      char PointOnly=0;      char OnEdge =0;      char LineCntAdd =0;      int xX = GUI_XMAX;  /* x-coordinate of next intersection */      /* find next intersection and count lines*/      for (i=0; i<NumPoints; i++) {        int x;        int iPrev = i ? (i-1) : NumPoints-1;        int i1 = (i <(NumPoints-1)) ? i +1 : 0;        int i2 = (i1<(NumPoints-1)) ? i1+1 : 0;        /* Check if end-point is on the line */        if ((paPoint+i1)->y ==y) {          /* Start-point also on the line ?*/          if ((paPoint+i)->y ==y) {            /* Get xmin, xmax */            int xmin = (paPoint+i)->x;            int xmax = (paPoint+i1)->x;            if (xmin > xmax) {              int t = xmin; xmin = xmax; xmax =t;            }            /* left point */            if ((xmin>x0) && (xmin<=xX)) {              xX = xmin;              LineCntAdd =0;            }            if ((xmax>x0) && (xmax<=xX)) {              xX = xmax;              OnEdge =1;              /* Check if the line crosses ... */              LineCntAdd = (GL_GetSign((paPoint+i2)->y-y)                         == GL_GetSign((paPoint+iPrev)->y-y))                         ? 0 : 1;            }          } else { /* end-point.y == y, start-point.y !=y */            x = (paPoint+i1)->x;            if ((x>x0) && (x<=xX)) {              if (xX > x) {                xX = x;                if (GL_GetSign((paPoint+i2)->y -y) == GL_GetSign((paPoint+i)->y -y))                {                  PointOnly  = 1;                  LineCntAdd = 0;                } else {                  LineCntAdd=1;                }              }            }          }        } else { /* end point not on the line, find intersection */          if (y != (paPoint+i)->y) { /* if startpoint not on y */            x = GL_CheckYInterSect(y, paPoint+i, paPoint+i1);            if ((x>x0) && (x<=xX)) {              if (x==xX)                 LineCntAdd++;              else                LineCntAdd=1;              xX = x;            }          }         }      }      if ((LineCntTotal&1) || OnEdge) {        LCD_HL_DrawHLine(x0+xOff,y+yOff,xX+xOff);      } else {      /* We are looking at a endpoint ... */    		if (PointOnly) {          LCD_HL_DrawHLine(xX+xOff,y+yOff,xX+xOff); /* LCD_HL_DrawPixel(xX+xOff,y+yOff); */        }      }      x0 = xX;      LineCntTotal += LineCntAdd;    }  }  }#else/***********************************************************************      GL_FillPolygon   - New Version***********************************************************************  The routine(s) below fill a given polygon.*/#define GUI_FP_MAXCOUNT 10#define FP_TYPE_X    0#define FP_TYPE_V    1static int GL_FP_Cnt;static struct {  I16 x;  U8  Type;} GL_FP_a[GUI_FP_MAXCOUNT];static void GL_FP_Add(int x, U8 Type) {  if (GL_FP_Cnt < GUI_FP_MAXCOUNT) {    int i;    /* Move all entries to the right (bigger x-value) */    for (i=GL_FP_Cnt; i ; i--) {      if (GL_FP_a[i-1].x < x)        break;      GL_FP_a[i] = GL_FP_a[i-1];    }    /* Insert new entry */    GL_FP_a[i].x = x;    GL_FP_a[i].Type = Type;    GL_FP_Cnt++;  }}void GL_FP_Init(void) {  GL_FP_Cnt = 0;}void GL_FP_Flush(int x0, int y) {  int i;  int x;  char On=0;  for (i=0; i<GL_FP_Cnt; i++) {    int xNew = GL_FP_a[i].x;    switch (GL_FP_a[i].Type) {    case FP_TYPE_X:      if (On) {        LCD_HL_DrawHLine(x0+x, y, x0+xNew);      }      On ^= 1;      break;    case FP_TYPE_V:      if (On) {        LCD_HL_DrawHLine(x0+x, y, x0+xNew);      } else {        LCD_HL_DrawHLine(x0+x, y, x0); /* Do not use LCD_HL_DrawPixel(x0+xNew, y); --- AA module does not support SetPixel */      }      break;    }    x = xNew+1;  }}void GL_FillPolygon  (const GUI_POINT*paPoint, int NumPoints, int xOff, int yOff) {  int i;  int y;  int yMin = GUI_YMAX;  int yMax = GUI_YMIN;/* First step : find uppermost and lowermost coordinates */  for (i=0; i<NumPoints; i++) {    y = (paPoint+i)->y;    if (y<yMin)      yMin = y;    if (y>yMax)      yMax = y;  }/* Use Clipping rect to reduce calculation (if possible) */  if (GUI_Context.pClipRect_HL) {    if (yMax > (GUI_Context.pClipRect_HL->y1 -yOff))      yMax = (GUI_Context.pClipRect_HL->y1 -yOff);    if (yMin < (GUI_Context.pClipRect_HL->y0 -yOff))      yMin = (GUI_Context.pClipRect_HL->y0 -yOff);  }/* Second step: Calculate and draw horizontal lines */  for (y=yMin; y<=yMax; y++) {    GL_FP_Init();    /* find next intersection and count lines*/    for (i=0; i<NumPoints; i++) {      int i1 = (i <(NumPoints-1)) ? i +1 : 0;      int y0 = (paPoint+i)->y;      int y1 = (paPoint+i1)->y;      /* Check if starting point is on line */      if (y0 == y) {        if (y1 == y) {  /* Add the entire line */          GL_FP_Add((paPoint+i )->x, FP_TYPE_X);          GL_FP_Add((paPoint+i1)->x, FP_TYPE_X);        } else {        /* Add only one point */          GL_FP_Add((paPoint+i )->x, FP_TYPE_V);        }      }      else if (y1 != y) {  /* Ignore if end-point is on the line */        if (((y1 >= y) && (y0 <= y)) || ((y0 >= y) && (y1 <= y))) {          int x = GL_CheckYInterSect(y, paPoint+i, paPoint+i1);          GL_FP_Add(x, FP_TYPE_X);        }      }    }    GL_FP_Flush(xOff, y+yOff);  }  }#endifvoid GUI_FillPolygon  (const GUI_POINT* pPoints, int NumPoints, int x0, int y0) {  GUI_LOCK();  #if (GUI_WINSUPPORT)    WM_ADDORG(x0,y0);    WM_ITERATE_START(NULL); {  #endif  GL_FillPolygon (pPoints, NumPoints, x0, y0);  #if (GUI_WINSUPPORT)    } WM_ITERATE_END();  #endif  GUI_UNLOCK();}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区在线影院| 精品一区二区影视| 国产曰批免费观看久久久| eeuss鲁一区二区三区| 欧美日韩色一区| 国产精品网曝门| 久久99国产精品尤物| 色婷婷香蕉在线一区二区| 国产视频一区在线观看| 日本美女一区二区| 欧美午夜精品一区二区三区| 国产精品日日摸夜夜摸av| 久久99在线观看| 在线不卡的av| 五月婷婷激情综合| 欧美性感一区二区三区| 亚洲欧美在线视频| 成人免费精品视频| 欧美国产成人精品| 国产成人丝袜美腿| 久久久精品综合| 国产呦精品一区二区三区网站| 欧美一区二区三区公司| 香蕉加勒比综合久久| 欧美综合一区二区| 亚洲一卡二卡三卡四卡| 99精品欧美一区| 亚洲天堂免费看| 一本久道中文字幕精品亚洲嫩| 国产精品福利一区二区三区| a4yy欧美一区二区三区| 国产精品剧情在线亚洲| av电影在线观看不卡| 国产精品久久久久久久久免费桃花 | 国产午夜精品久久久久久久 | 91在线小视频| 日韩美女视频一区二区| 91视频国产资源| 亚洲国产日日夜夜| 欧美日韩视频在线观看一区二区三区| 亚洲一二三四在线观看| 欧美区在线观看| 久久99久久精品欧美| 久久久精品人体av艺术| 99久久99久久久精品齐齐| 亚洲欧美自拍偷拍色图| 欧美日韩一区二区三区在线 | 制服丝袜激情欧洲亚洲| 麻豆精品视频在线观看免费 | 精品乱人伦小说| 国产精一品亚洲二区在线视频| 欧美韩国日本不卡| 91免费在线播放| 日本强好片久久久久久aaa| 欧美成人三级电影在线| 成人综合日日夜夜| 亚洲午夜久久久| 亚洲精品一区在线观看| 99re在线精品| 美腿丝袜在线亚洲一区| 国产精品青草久久| 欧美私模裸体表演在线观看| 久久精品99久久久| 亚洲色图视频免费播放| 日韩午夜中文字幕| av午夜一区麻豆| 秋霞午夜鲁丝一区二区老狼| 亚洲国产精品成人久久综合一区 | 亚欧色一区w666天堂| 精品国产一区二区精华 | 国产v综合v亚洲欧| 亚洲一区二区中文在线| 久久久一区二区| 欧美日韩国产成人在线免费| 国产v综合v亚洲欧| 日产国产欧美视频一区精品| 国产精品国产馆在线真实露脸 | 国产精品久久久久一区| 日韩欧美国产一区二区在线播放| 国产高清在线观看免费不卡| 午夜精品久久久久久久99樱桃| 国产欧美日韩综合| 91麻豆精品国产无毒不卡在线观看| 懂色av中文字幕一区二区三区| 蜜桃视频在线观看一区| 一区二区在线免费观看| 国产亚洲一区二区三区| 日韩一级二级三级| 欧美丝袜第三区| 91原创在线视频| 国产成人综合在线观看| 免费高清成人在线| 午夜精品123| 亚洲在线一区二区三区| 亚洲区小说区图片区qvod| 久久久五月婷婷| 欧美www视频| 91精品啪在线观看国产60岁| 精品视频在线免费看| 99国产精品久久久| 粉嫩aⅴ一区二区三区四区| 久久99精品久久久久久动态图| 99这里只有久久精品视频| 成人高清视频在线观看| 青青草原综合久久大伊人精品| 亚洲一区二三区| 亚洲国产欧美在线| 欧美成人综合网站| 欧美一区二区大片| 欧美精品丝袜中出| 欧美日本一区二区三区四区| 欧美婷婷六月丁香综合色| 91精彩视频在线| 在线观看亚洲专区| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 94-欧美-setu| 欧洲精品在线观看| 欧美中文字幕一区| 欧美日韩久久不卡| 欧美一区二区三区啪啪| 日韩一级在线观看| 久久久久国产一区二区三区四区| 精品剧情在线观看| 国产人伦精品一区二区| 国产精品美女久久久久久2018| 136国产福利精品导航| 亚洲欧美激情一区二区| 亚洲一区二区三区中文字幕在线| 香港成人在线视频| 美女视频黄免费的久久| 国产做a爰片久久毛片| 国产毛片精品视频| 日韩一区二区视频在线观看| 欧美亚洲精品一区| 欧美一区二区三区喷汁尤物| 久久一区二区三区四区| 国产亚洲成年网址在线观看| 国产精品久久99| 亚洲午夜三级在线| 国产一区二区三区免费在线观看| 成人免费福利片| 欧美精品亚洲一区二区在线播放| 精品久久免费看| 综合婷婷亚洲小说| 午夜精彩视频在线观看不卡| 国产精品一线二线三线| 日本久久一区二区| 精品久久久久久久久久久久久久久久久 | 一区二区三区免费看视频| 亚洲aaa精品| 国产成人三级在线观看| 欧美日韩高清一区二区不卡| 久久尤物电影视频在线观看| 亚洲精品成人在线| 国产综合色精品一区二区三区| 99精品视频在线观看免费| 欧美精品丝袜久久久中文字幕| 欧美精彩视频一区二区三区| 一区二区三区精品在线观看| 国产乱码精品一品二品| 欧美性三三影院| 欧美激情一区二区三区在线| 午夜精品免费在线| 91女神在线视频| 久久久久久久久久久久久久久99| 亚洲第一综合色| 91丨porny丨户外露出| 337p粉嫩大胆色噜噜噜噜亚洲| 亚洲精品视频免费看| 国产河南妇女毛片精品久久久| 91精品国产麻豆| 亚洲精品福利视频网站| 成人黄色在线看| 久久蜜桃av一区精品变态类天堂| 五月天欧美精品| 色哟哟国产精品| 中文字幕av一区二区三区免费看| 免费一级片91| 欧美精品久久一区二区三区| 亚洲欧美一区二区三区国产精品| 国产高清不卡一区二区| 日韩欧美的一区二区| 亚洲不卡一区二区三区| 色网综合在线观看| 中文幕一区二区三区久久蜜桃| 久久99深爱久久99精品| 91精品国产入口| 日韩成人午夜精品| 欧美日韩国产高清一区二区 | 欧美电影在线免费观看| 亚洲色图视频网站| av激情亚洲男人天堂| 国产精品日日摸夜夜摸av| 国产精品亚洲视频| 久久精品视频在线免费观看| 国产精品一区二区视频| 国产日韩精品一区二区三区| 国产一区二区三区香蕉| 国产日韩欧美不卡在线| 丁香婷婷综合网|