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

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

?? lcd.c

?? 嵌入式系統(tǒng)
?? C
?? 第 1 頁 / 共 5 頁
字號:

    for (; p1.y <= y_max; p1.y++) {
        APD_LCD_LINE_WIDTH  lw_bak = current_gc.lw;

        p2.y = p1.y;
        current_gc.lw = APD_LCD_LINE_THIN;
        apd_LCDDrawHline(&p1, &p2);
        current_gc.lw = lw_bak;
    }
#if 0
    if (lt.y < 0 && p1.y > 0) {
/* If a part of horizontal line segment is in LCD graphic area */
        int     y_max = p1.y;
        unsigned char   lw_bak = current_gc.lw;
        current_gc.lw = 1;
        for (p1.y = 0; p1.y < y_max; p1.y++)
            apd_LCDDrawHline(&p1, &p2);

        current_gc.lw = lw_bak;
//      p1.y = y_max;
    } else {
/* If all of horizontal line segment is in LCD graphic area */
        p1.y = lt.y;
        apd_LCDDrawHline(&p1, &p2);
    }
#endif
/* Draw the lower horizontal line segment of a rectangle */
    p1.y = rb.y;

    if (current_gc.lw >> 1) {
        p1.y -= current_gc.lw >> 1;
        y_max = rb.y + (current_gc.lw % 2);
    } else
        y_max = rb.y;

    for (; p1.y <= y_max; p1.y++) {
        APD_LCD_LINE_WIDTH  lw_bak = current_gc.lw;

        p2.y = p1.y;
        current_gc.lw = APD_LCD_LINE_THIN;
        apd_LCDDrawHline(&p1, &p2);
        current_gc.lw = lw_bak;
    }
    return;
}

/******************************************************************************
@@ [Name]       : apd_LCDFillRect
@@ [Summary]    : The function to draw over a rectangle
@@ [Argument]   : point : Coordinate data
@@                dim   : Length and width
@@ [Return]     : None
@@ [Desc]       : Draw over the specific rectangle data according to
@@                the current attribute.
@@                Valid attribute : Color, Raster operation, Fill type
@@ [History]    : Date      Modifier    Comment
******************************************************************************/

void apd_LCDFillRect(APD_LCD_POINT *point,APD_LCD_DIM *dim)
{
    APD_LCD_POINT lt, rb;   /* The upper left and the lower right point
                               of a rectangle */
    APD_LCD_POINT p1, p2;   /* The start and end point of the straight line */
    unsigned long  *adrs;      /* The half word address of the start point
                               for one horaizontal line */
    unsigned char   hword, byte, bit;   /* Half word, byte, bit offset */
    unsigned short  fill_ofst;
    int     i;
    short   size;       /* The number of pixels on one horizontal line */

/* Check the area to draw */
    if (dim->width < 0) {
        lt.x = point->x + dim->width;
        rb.x = point->x + 1;
    } else {
        lt.x = point->x;
        rb.x = point->x + dim->width;
    }
    if (dim->height < 0) {
        lt.y = point->y + dim->height;
        rb.y = point->y + 1;
    } else {
        lt.y = point->y;
        rb.y = point->y + dim->height;
    }

/* If the area is specified out of LCD */
    if (rb.y < 0 || rb.x < 0 || lt.y >= APD_LCD_HEIGHT ||
        lt.x >= APD_LCD_WIDTH)
        return;

/* Set the lower horizontal line segment of a rectangle */
    p1 = lt;    /* The start point */
    p2.x = rb.x;    /* The end point */
    p2.y = lt.y;

    if (p1.x < 0)
        p1.x = 0;
    if (p2.x > APD_LCD_WIDTH)
        p2.x = APD_LCD_WIDTH;
    if (p1.y < 0)
        p1.y = 0;
    if (p2.y > APD_LCD_HEIGHT)
        p2.y = APD_LCD_HEIGHT;

    fill_ofst = 0;

/* Get the address of The start point  */
    LCDGetPixelAdrs(&p1, &adrs, &hword, &byte, &bit);
    size = p2.x - p1.x;
/* Draw over a rectangle by drawing horizontal line segments */
    for (; p1.y < rb.y; ) {
        for (i = 0; p1.y < rb.y && i < LCD_SIZE_FILLPAT_H; i++) {
/* If raster operation is APD_LCD_ROP_S or APD_LCD_ROP_nS,
   and fill pattern is APD_LCD_FILL_SOLID */
            if (((current_gc.rop == APD_LCD_ROP_S) ||
                 (current_gc.rop == APD_LCD_ROP_nS)) &&
                (current_gc.ft == APD_LCD_FILL_SOLID)) {
                APD_LCD_COLOR   color;
                if (current_gc.rop == APD_LCD_ROP_nS)
                    color = ~current_gc.c;
                else
                    color = current_gc.c;
                    LCDOverwriteHline(adrs, hword, byte, bit, size, color);
            }
/* The others */
            else {
            /* Set the current fill bit pattern */
#if (APD_LCD_BPP == 16)
                unsigned short  fill_pat;

                if ((char)LCD_FILL_NONE != LCD_FILL_PAT_H[current_gc.ft][i]) {
                    fill_pat = LCD_FILL_PAT_H[current_gc.ft][i]
                        * LCD_SIZE_FILLPAT;
                    current_line_pat = LCD_FILL_PAT[fill_pat+fill_ofst];

                    LCDFillHline(adrs, hword, byte, bit, size);
                }
#else
                if ((char)LCD_FILL_NONE != LCD_FILL_PAT_H[current_gc.ft][i]) {
                    current_line_pat = LCD_FILL_PAT_H[current_gc.ft][i];

                    LCDFillHline(adrs, hword, byte, bit, size);
                }
#endif
            }
/* Renew the next horizontal line */
            (p1.y)++;
            p2.y = p1.y;
/* Renew fill pattern */
            fill_ofst++;
            if (fill_ofst >= LCD_SIZE_FILLPAT)
                fill_ofst = 0;
/* Renew the start half word address of the next line */
            adrs += LCD_OFSTPL/2;
        }
    }

    /* Return the current bit pattern of bit pattern */
    current_line_pat = LCD_LINE_PAT[current_gc.lt];

    return;
}

/******************************************************************************
@@ [Name]       : apd_LCDDrawImage
@@ [Summary]    : Draw image
@@ [Argument]   : point : Coordinates data
@@                dim   : Length and width
@@                image : Pointer to image data
@@ [Return]     : None
@@ [Desc]       : Draw the specified image according to current attribute.
@@                Image is unrelated to format according to byte
@@                endian of ARM processor and LCD controller, and pixel endian
@@                of LCD controller.
@@                Valid attribute : Raster operation
@@                Coordinates data doesn't take negative value.
@@                If it is negative value, don't draw.
@@                Length and width data doesn't take negative value.
@@                If it is negative value, don't draw.
@@ [History]    : Date      Modifier    Comment
******************************************************************************/

void apd_LCDDrawImage(APD_LCD_POINT *point,APD_LCD_DIM *dim,APD_LCD_IMAGE *image)
{
    unsigned long *adrs;           /* address written pixel data */
    unsigned char hword, byte, bit; /* half word, byte and bit offset */
    APD_LCD_DIM dimWrite;       /* Rectangle data drawn image */

/* check domain drawn */
    if (point->x < 0 || point->x >= APD_LCD_WIDTH ||
        point->y < 0 || point->y >= APD_LCD_HEIGHT ||
        dim->width <= 0 || dim->height <= 0)
        return;
/* get address written pixel data */

    LCDGetPixelAdrs(point, &adrs, &hword, &byte, &bit);

/* write pixel data */
    if ((point->x + dim->width - 1) >= APD_LCD_WIDTH)
        dimWrite.width = APD_LCD_WIDTH - point->x;
    else
        dimWrite.width = dim->width;
    if ((point->y + dim->height - 1) >= APD_LCD_HEIGHT)
        dimWrite.height = APD_LCD_HEIGHT - point->y;
    else
        dimWrite.height = dim->height;
    

    LCDWriteImage(image, dim, &dimWrite, adrs, hword, byte, bit);
    return;
}

/******************************************************************************
@@ [Name]       : apd_LCDDrawBMP
@@ [Summary]    : Draw bit map image
@@ [Argument]   : point : Coordinates data
@@                dim   : Length and width
@@                image : Pointer to monochrome bit map data
@@ [Return]     : None
@@ [Desc]       : Draw the specified monochrome bit map data according to
@@                the current attribute.
@@                Valid attribute : Color, Raster operation
@@                Coordinates data doesn't take negative value.
@@                If it is negative, don't draw.
@@                Length and width data doesn't take negative value.
@@                If it is negative, don't draw.
@@ [History]    : Date      Modifier    Comment
******************************************************************************/

void apd_LCDDrawBMP(APD_LCD_POINT *point,APD_LCD_DIM *dim,APD_LCD_IMAGE *image)
{
    unsigned long *adrs;           /* address written pixel data */
    unsigned char hword, byte, bit; /* Half word, byte and bit offset */
    APD_LCD_DIM dimWrite;       /* Rectangle drawn bit map */

/* Check domain drawn */
    if (point->x < 0 || point->x >= APD_LCD_WIDTH ||
        point->y < 0 || point->y >= APD_LCD_HEIGHT ||
        dim->width <= 0 || dim->height <= 0)
        return;

/* get address written pixel data */
    LCDGetPixelAdrs(point, &adrs, &hword, &byte, &bit);

/* write pixel data */
    if ((point->x + dim->width - 1) >= APD_LCD_WIDTH) {
        dimWrite.width = APD_LCD_WIDTH - point->x;
    } else {
        dimWrite.width = dim->width;
    }
    if ((point->y + dim->height - 1) >= APD_LCD_HEIGHT) {
        dimWrite.height = APD_LCD_HEIGHT - point->y;
    } else {
        dimWrite.height = dim->height;
    }
    LCDWriteBMP(image, dim, &dimWrite, adrs, hword, byte, bit); 
    return;
}

/******************************************************************************
@@
@@ [Name]       : apd_LCDGetPixel
@@
@@ [Summary]    : Get pixel data
@@
@@ [Argument]   : point : Coordinates data
@@
@@ [Return]     : Color of pixel
@@
@@ [Desc]       : Read pixel data (color) of the specified coordinate.
@@
@@                If coordinates are outside the range, don't get pixel data
@@                and return 0.
@@
@@ [History]    : Date      Modifier    Comment
@@
@@ [END]
******************************************************************************/
APD_LCD_COLOR apd_LCDGetPixel(APD_LCD_POINT *point)
{
    APD_LCD_COLOR color;            /* pixel data */
    unsigned long *adrs;               /* address read pixel data */
    unsigned char hword, byte, bit;     /* half word, byte, bit offset */

/* Check coordinates data */
    if (point->x < 0 || point->x >= APD_LCD_WIDTH ||
        point->y < 0 || point->y >= APD_LCD_HEIGHT)
        return (APD_LCD_COLOR)0;

/* Get address read pixel data */
    LCDGetPixelAdrs(point, &adrs, &hword, &byte, &bit);

/* Read pixel data */
    color = LCDReadPixel(adrs, hword);	//, byte, bit);

    return(color);
}

/******************************************************************************
@@
@@ [Name]       : apd_LCDGetImage
@@
@@ [Summary]    : Get image data
@@
@@ [Argument]   : point : Coordinates data
@@                dim   : Length and width
@@                image : Pointer to the buffer written image data
@@
@@ [Return]     : none
@@
@@ [Desc]       : Read image data of the specified coordinates and size.
@@                Image data is unrelated to format according to byte endian
@@                of ARM processor and LCD controller, and pixel endian of
@@                LCD controller.
@@
@@                If coordinates are outside the range, don't get image data
@@
@@                If the domain specified by 'dim' is larger than LCD domain,
@@                read image data in data size within LCD domain, and
@@                the value of 'dim' is updated by the size which read.
@@
@@ [History]    : Date      Modifier    Comment
@@
@@ [END]
******************************************************************************/
void apd_LCDGetImage(APD_LCD_POINT *point,APD_LCD_DIM *dim,APD_LCD_IMAGE *image)
{
    unsigned long *adrs;               /* address read pixel data */
    unsigned char hword, byte, bit;     /* half word, byte, bit, offset */

/* Check the domain read */
    if (point->x < 0 || point->x >= APD_LCD_WIDTH ||
        point->y < 0 || point->y >= APD_LCD_HEIGHT)
        return;

    if (point->x + dim->width > APD_LCD_WIDTH)
        dim->width = APD_LCD_WIDTH - point->x - 1;

    if (point->y + dim->height > APD_LCD_HEIGHT)
        dim->height = APD_LCD_HEIGHT - point->y - 1;

/* Get address read pixel data */
    LCDGetPixelAdrs(point, &adrs, &hword, &byte, &bit);

/* Read pixel data */
    LCDReadImage(image, dim, adrs, hword, byte, bit);

    return;
}

/******************************************************************************
@@
@@ [Name]       : apd_LCDSetLineStyle
@@
@@ [Summary]    : Set line type
@@
@@ [Argument]   : line_type : Line type (either of the following)
@@                            APD_LCD_LINE_SOLID
@@                            APD_LCD_LINE_DOT
@@                            APD_LCD_LINE_DASH
@@                            APD_LCD_LINE_DASH_DOT
@@
@@ [Return]     : none
@@
@@ [Desc]       : Specify line type when drawing a line
@@                Valid drawing function : apd_LCDDrawVline, apd_LCDDrawHline,
@@                                         apd_LCDDrawLine, apd_LCDDrawRect
@@
@@ [History]    : Date      Modifier    Comment
@@
@@ [END]
******************************************************************************/
void apd_LCDSetLineStyle(
APD_LCD_LINE_TYPE line_type
)
{
    current_gc.lt = line_type;
    current_line_pat = LCD_LINE_PAT[current_gc.lt];
    return;
}

/******************************************************************************
@@
@@ [Name]       : apd_LCDSetLineWidth
@@
@@ [Summary]    : Set line width
@@
@@ [Argument]   : line_width : Line width (either of the following)
@@                             APD_LCD_LINE_THIN
@@                             APD_LCD_LINE_MID
@@                             APD_LCD_LINE_THICK
@@
@@ [Return]     : None
@@
@@ [Desc]       : Set line width when drawing a line
@@                Valid drawing function : apd_LCDDrawVline, apd_LCDDrawHline,
@@                                         apd_LCDDrawLine, apd_LCDDrawRect
@@
@@ [History]    : Date      Modifier    Comment
@@
@@ [END]
******************************************************************************/
void apd_LCDSetLineWidth(
APD_LCD_LINE_WIDTH line_width
)
{
    current_gc.lw = line_width;
    return;
}

/******************************************************************************
@@
@@ [Name]       : apd_LCDSetColor
@@
@@ [Summary]    : Set color
@@
@@ [Argument]   : color : Pixel color data
@@

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合激情久久| 日韩美女久久久| 久久一区二区三区四区| 日韩精品一区二区三区四区视频| 日韩欧美资源站| 欧美mv日韩mv国产网站| 久久综合丝袜日本网| 国产精品视频yy9299一区| 亚洲欧美激情视频在线观看一区二区三区 | 美国毛片一区二区| 精品一区二区三区香蕉蜜桃| 国产91对白在线观看九色| 91在线一区二区三区| 欧美少妇性性性| 欧美性色综合网| 在线观看视频一区| 日韩精品中文字幕在线不卡尤物| 久久精品一区二区三区四区| 国产精品久久久久久久蜜臀 | 大胆亚洲人体视频| 91国产免费看| 91精品国产综合久久久蜜臀粉嫩| 久久综合久久久久88| 最新国产精品久久精品| 午夜日韩在线观看| 国产一区二区三区综合| 97精品国产露脸对白| 在线不卡中文字幕播放| 日韩精品资源二区在线| 亚洲欧美另类小说| 美日韩一区二区三区| 99久久婷婷国产综合精品| 91精品国产欧美一区二区| 精品国产成人系列| 亚洲精品免费一二三区| 蜜桃91丨九色丨蝌蚪91桃色| 日韩欧美中文字幕制服| 亚洲情趣在线观看| 久久精品国产**网站演员| 国产激情一区二区三区| 欧美人与性动xxxx| 中文在线一区二区| 日韩精品欧美精品| av不卡一区二区三区| 日韩精品专区在线影院观看| 亚洲精品久久嫩草网站秘色| 国产在线播放一区二区三区| 91黄色免费观看| 日韩一区二区三区四区| 亚洲精品国久久99热| 国产麻豆精品在线观看| 一本到一区二区三区| 久久久国际精品| 毛片av一区二区三区| 欧美亚洲综合网| 欧美极品美女视频| 蜜桃免费网站一区二区三区| 在线观看一区二区精品视频| 国产精品私房写真福利视频| 久久99国产精品久久99果冻传媒| 欧美亚洲尤物久久| 国产欧美va欧美不卡在线| 亚洲成人av中文| 97久久精品人人澡人人爽| 国产亚洲精品bt天堂精选| 日本不卡不码高清免费观看| 日本国产一区二区| 国产女同性恋一区二区| 激情欧美日韩一区二区| 7777精品伊人久久久大香线蕉的 | 久久国产精品免费| 欧美日韩国产在线观看| 亚洲欧美日韩中文播放 | 久久婷婷色综合| 日本麻豆一区二区三区视频| 精品视频123区在线观看| 日韩美女啊v在线免费观看| 国产成人免费网站| 久久综合九色综合欧美就去吻| 蜜桃av噜噜一区| 日韩女优视频免费观看| 日韩精品欧美精品| 91精品国产综合久久国产大片 | 欧美主播一区二区三区| 亚洲欧美日本韩国| 色诱亚洲精品久久久久久| 最新中文字幕一区二区三区| 99精品视频在线免费观看| 精品国产亚洲在线| 国产最新精品精品你懂的| 精品88久久久久88久久久| 偷偷要91色婷婷| 91精品国产91综合久久蜜臀| 日韩国产精品91| 欧美大度的电影原声| 麻豆久久久久久| 亚洲一区二区三区自拍| 欧美午夜精品电影| 亚洲成人综合网站| 这里是久久伊人| 国产一区美女在线| 国产精品麻豆视频| 欧美日韩国产一二三| 国精品**一区二区三区在线蜜桃| 国产精品乱码人人做人人爱| 欧美性大战久久久久久久蜜臀| 蜜臀99久久精品久久久久久软件| 国产午夜亚洲精品理论片色戒| 91伊人久久大香线蕉| 日韩**一区毛片| 中文在线一区二区| 在线电影国产精品| 成人av小说网| 日韩国产在线一| 欧美国产日本视频| 欧美精品色综合| 成人教育av在线| 日韩高清一级片| 国产精品午夜在线观看| 欧美日韩不卡一区| 国产激情视频一区二区三区欧美| 亚洲激情图片小说视频| 26uuuu精品一区二区| 色哟哟国产精品免费观看| 极品少妇一区二区三区精品视频| 亚洲美女免费在线| 精品国产91久久久久久久妲己| 91在线视频播放| 久久69国产一区二区蜜臀| 一区二区在线观看视频在线观看| 欧美v亚洲v综合ⅴ国产v| 91免费国产在线观看| 毛片不卡一区二区| 亚洲已满18点击进入久久| 久久久无码精品亚洲日韩按摩| 精品视频一区二区不卡| 菠萝蜜视频在线观看一区| 精品影视av免费| 亚洲va天堂va国产va久| 亚洲欧洲另类国产综合| 精品福利视频一区二区三区| 欧美日韩久久一区二区| 91丝袜国产在线播放| 国产一区二区三区四| 五月天精品一区二区三区| 中文字幕中文字幕一区| 久久久噜噜噜久噜久久综合| 91精品国产麻豆国产自产在线 | 亚洲综合在线免费观看| 国产欧美一区二区精品性色| 欧美一级欧美三级| 国产精品系列在线| wwwwxxxxx欧美| 欧美一级理论片| 欧美日韩1区2区| 精品视频一区二区不卡| 色综合中文字幕| 99久久伊人精品| 本田岬高潮一区二区三区| 国模冰冰炮一区二区| 久久精品免费观看| 日韩不卡在线观看日韩不卡视频| 亚洲夂夂婷婷色拍ww47| 亚洲美女少妇撒尿| 亚洲欧洲性图库| 国产精品免费丝袜| 国产偷国产偷亚洲高清人白洁| 欧美mv日韩mv| 欧美va天堂va视频va在线| 日韩欧美一区二区免费| 91精品国产一区二区三区蜜臀| 欧美另类videos死尸| 欧美久久久一区| 欧美一区二区三区成人| 欧美一区二区在线播放| 欧美一区二区三区四区久久| 欧美精品xxxxbbbb| 欧美精品自拍偷拍动漫精品| 欧美人伦禁忌dvd放荡欲情| 欧美日韩电影在线| 在线综合视频播放| 日韩亚洲欧美高清| 精品区一区二区| 久久婷婷久久一区二区三区| 久久精品亚洲一区二区三区浴池 | 99天天综合性| 91影院在线观看| 欧美中文字幕久久| 欧美人伦禁忌dvd放荡欲情| 欧美高清视频www夜色资源网| 欧美图片一区二区三区| 51精品秘密在线观看| 欧美成人一区二区三区在线观看| 精品成人佐山爱一区二区| 国产欧美日韩在线观看| 亚洲人精品午夜| 午夜精品在线视频一区| 免费高清视频精品| 国产精品一二三| 99视频精品在线|