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

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

?? line.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 2 頁
字號:
        if((lCode1 == 0) && (lCode2 == 0))
        {
            return(1);
        }

        //
        // If the intersection of the codes is non-zero, then the line lies
        // entirely off one edge of the clipping region.  In this case,
        // trivally reject the line.
        //
        if((lCode1 & lCode2) != 0)
        {
            return(0);
        }

        //
        // Determine the end of the line to move.  The first end of the line is
        // moved until it is within the clipping region, and then the second
        // end of the line is moved until it is also within the clipping
        // region.
        //
        if(lCode1)
        {
            lCode = lCode1;
        }
        else
        {
            lCode = lCode2;
        }

        //
        // See if this end of the line lies above the clipping region.
        //
        if(lCode & 1)
        {
            //
            // Move this end of the line to the intersection of the line and
            // the top of the clipping region.
            //
            lX = (*plX1 + (((*plX2 - *plX1) *
                            (pContext->sClipRegion.sYMin - *plY1)) /
                           (*plY2 - *plY1)));
            lY = pContext->sClipRegion.sYMin;
        }

        //
        // Otherwise, see if this end of the line lies below the clipping
        // region.
        //
        else if(lCode & 2)
        {
            //
            // Move this end of the line to the intersection of the line and
            // the bottom of the clipping region.
            //
            lX = (*plX1 + (((*plX2 - *plX1) *
                            (pContext->sClipRegion.sYMax - *plY1)) /
                           (*plY2 - *plY1)));
            lY = pContext->sClipRegion.sYMax;
        }

        //
        // Otherwise, see if this end of the line lies to the left of the
        // clipping region.
        //
        else if(lCode & 4)
        {
            //
            // Move this end of the line to the intersection of the line and
            // the left side of the clipping region.
            //
            lX = pContext->sClipRegion.sXMin;
            lY = (*plY1 + (((*plY2 - *plY1) *
                            (pContext->sClipRegion.sXMin - *plX1)) /
                           (*plX2 - *plX1)));
        }

        //
        // Otherwise, this end of the line lies to the right of the clipping
        // region.
        //
        else
        {
            //
            // Move this end of the line to the intersection of the line and
            // the right side of the clipping region.
            //
            lX = pContext->sClipRegion.sXMax;
            lY = (*plY1 + (((*plY2 - *plY1) *
                            (pContext->sClipRegion.sXMax - *plX1)) /
                           (*plX2 - *plX1)));
        }

        //
        // See which end of the line just moved.
        //
        if(lCode1)
        {
            //
            // Save the new coordinates for the start of the line.
            //
            *plX1 = lX;
            *plY1 = lY;

            //
            // Recompute the clipping code for the start of the line.
            //
            lCode1 = GrClipCodeGet(pContext, lX, lY);
        }
        else
        {
            //
            // Save the new coordinates for the end of the line.
            //
            *plX2 = lX;
            *plY2 = lY;

            //
            // Recompute the clipping code for the end of the line.
            //
            lCode2 = GrClipCodeGet(pContext, lX, lY);
        }
    }
}

//*****************************************************************************
//
//! Draws a line.
//!
//! \param pContext is a pointer to the drawing context to use.
//! \param lX1 is the X coordinate of the start of the line.
//! \param lY1 is the Y coordinate of the start of the line.
//! \param lX2 is the X coordinate of the end of the line.
//! \param lY2 is the Y coordinate of the end of the line.
//!
//! This function draws a line, utilizing GrLineDrawH() and GrLineDrawV() to
//! draw the line as efficiently as possible.  The line is clipped to the
//! clippping rectangle using the Cohen-Sutherland clipping algorithm, and then
//! scan converted using Bresenham's line drawing algorithm.
//!
//! \return None.
//
//*****************************************************************************
void
GrLineDraw(const tContext *pContext, long lX1, long lY1, long lX2, long lY2)
{
    long lError, lDeltaX, lDeltaY, lYStep, bSteep;

    //
    // Check the arguments.
    //
    ASSERT(pContext);

    //
    // See if this is a vertical line.
    //
    if(lX1 == lX2)
    {
        //
        // It is more efficient to avoid Bresenham's algorithm when drawing a
        // vertical line, so use the vertical line routine to draw this line.
        //
        GrLineDrawV(pContext, lX1, lY1, lY2);

        //
        // The line has ben drawn, so return.
        //
        return;
    }

    //
    // See if this is a horizontal line.
    //
    if(lY1 == lY2)
    {
        //
        // It is more efficient to avoid Bresenham's algorithm when drawing a
        // horizontal line, so use the horizontal line routien to draw this
        // line.
        //
        GrLineDrawH(pContext, lX1, lX2, lY1);

        //
        // The line has ben drawn, so return.
        //
        return;
    }

    //
    // Clip this line if necessary, and return without drawing anything if the
    // line does not cross the clipping region.
    //
    if(GrLineClip(pContext, &lX1, &lY1, &lX2, &lY2) == 0)
    {
        return;
    }

    //
    // Determine if the line is steep.  A steep line has more motion in the Y
    // direction than the X direction.
    //
    if(((lY2 > lY1) ? (lY2 - lY1) : (lY1 - lY2)) >
       ((lX2 > lX1) ? (lX2 - lX1) : (lX1 - lX2)))
    {
        bSteep = 1;
    }
    else
    {
        bSteep = 0;
    }

    //
    // If the line is steep, then swap the X and Y coordinates.
    //
    if(bSteep)
    {
        lError = lX1;
        lX1 = lY1;
        lY1 = lError;
        lError = lX2;
        lX2 = lY2;
        lY2 = lError;
    }

    //
    // If the starting X coordinate is larger than the ending X coordinate,
    // then swap the start and end coordinates.
    //
    if(lX1 > lX2)
    {
        lError = lX1;
        lX1 = lX2;
        lX2 = lError;
        lError = lY1;
        lY1 = lY2;
        lY2 = lError;
    }

    //
    // Compute the difference between the start and end coordinates in each
    // axis.
    //
    lDeltaX = lX2 - lX1;
    lDeltaY = (lY2 > lY1) ? (lY2 - lY1) : (lY1 - lY2);

    //
    // Initialize the error term to negative half the X delta.
    //
    lError = -lDeltaX / 2;

    //
    // Determine the direction to step in the Y axis when required.
    //
    if(lY1 < lY2)
    {
        lYStep = 1;
    }
    else
    {
        lYStep = -1;
    }

    //
    // Loop through all the points along the X axis of the line.
    //
    for(; lX1 <= lX2; lX1++)
    {
        //
        // See if this is a steep line.
        //
        if(bSteep)
        {
            //
            // Plot this point of the line, swapping the X and Y coordinates.
            //
            DpyPixelDraw(pContext->pDisplay, lY1, lX1, pContext->ulForeground);
        }
        else
        {
            //
            // Plot this point of the line, using the coordinates as is.
            //
            DpyPixelDraw(pContext->pDisplay, lX1, lY1, pContext->ulForeground);
        }

        //
        // Increment the error term by the Y delta.
        //
        lError += lDeltaY;

        //
        // See if the error term is now greater than zero.
        //
        if(lError > 0)
        {
            //
            // Take a step in the Y axis.
            //
            lY1 += lYStep;

            //
            // Decrement the error term by the X delta.
            //
            lError -= lDeltaX;
        }
    }
}

//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久国产一区二区三区四区 | 一本色道久久加勒比精品| 一级做a爱片久久| 日韩一区二区三免费高清| 成人高清伦理免费影院在线观看| 一区二区三区 在线观看视频| 精品国产乱码久久久久久浪潮| 91国内精品野花午夜精品| 国产在线播放一区| 亚洲国产综合视频在线观看| 国产精品丝袜黑色高跟| 欧美一级欧美三级| 在线观看中文字幕不卡| 成人av在线资源网| 国产在线播精品第三| 三级亚洲高清视频| 一区二区不卡在线播放| 国产精品美女久久久久高潮| 精品福利一二区| 91精品国产日韩91久久久久久| 色婷婷av一区二区三区大白胸| 国产精品18久久久久久久久| 美女爽到高潮91| 丝袜亚洲精品中文字幕一区| 亚洲精品免费一二三区| 国产精品第13页| 久久久久97国产精华液好用吗| 日韩欧美一二三四区| 欧美日本韩国一区| 欧美性猛片xxxx免费看久爱| 在线免费观看日本一区| 色呦呦日韩精品| 97久久久精品综合88久久| 不卡一二三区首页| 成人亚洲一区二区一| 成人一区在线观看| 成人一二三区视频| 97久久精品人人澡人人爽| 成熟亚洲日本毛茸茸凸凹| 粉嫩aⅴ一区二区三区四区 | 亚洲主播在线观看| 一区二区三区蜜桃网| 一区二区欧美国产| 亚洲gay无套男同| 亚洲成人自拍网| 首页国产欧美日韩丝袜| 丝瓜av网站精品一区二区| 日本sm残虐另类| 国产一区二区三区不卡在线观看| 国产永久精品大片wwwapp| 国产成人在线电影| av成人动漫在线观看| 9i在线看片成人免费| 色美美综合视频| 欧美日韩在线不卡| 日韩免费性生活视频播放| 亚洲精品在线免费观看视频| 久久久精品黄色| 国产精品久久久久久妇女6080| 亚洲色图19p| 五月综合激情日本mⅴ| 久久99精品国产麻豆婷婷洗澡| 国产老肥熟一区二区三区| 成人国产电影网| 欧美日韩亚洲综合一区| 日韩欧美亚洲另类制服综合在线| 欧美精品一区二区三区四区| 中文字幕亚洲在| 香蕉成人伊视频在线观看| 六月丁香综合在线视频| 国产69精品久久久久毛片| 欧美优质美女网站| 日韩写真欧美这视频| 国产精品私人影院| 丝袜美腿亚洲色图| 丁香另类激情小说| 欧美日本一区二区在线观看| 精品国产乱码久久| 一区二区三区美女视频| 日本强好片久久久久久aaa| 国产成人午夜高潮毛片| 欧洲人成人精品| 久久久久久久久久电影| 亚洲一区二区不卡免费| 国产美女精品人人做人人爽| 色94色欧美sute亚洲线路一ni | 欧美性生交片4| 国产视频一区二区在线观看| 午夜影院在线观看欧美| 国产成人免费在线观看不卡| 欧美午夜精品一区二区三区| 久久久久久免费网| 天天色天天操综合| 99免费精品在线观看| 日韩视频123| 一个色在线综合| 国产99一区视频免费| 666欧美在线视频| 亚洲特黄一级片| 国产一区二区三区日韩 | 欧美电影免费观看高清完整版在| 国产精品久久久久永久免费观看 | 免费欧美在线视频| 91精品1区2区| 国产精品网站在线播放| 老司机精品视频导航| 91成人免费网站| 成人免费在线播放视频| 韩国三级在线一区| 欧美美女喷水视频| 亚洲人xxxx| 成人综合婷婷国产精品久久免费| 日韩欧美123| 丝袜美腿高跟呻吟高潮一区| 在线精品视频一区二区| 国产精品久久影院| 国产精品一区2区| 日韩欧美国产三级电影视频| 亚洲成av人**亚洲成av**| 99精品国产99久久久久久白柏| 久久久另类综合| 久久激情五月激情| 欧美一区二区在线视频| 亚洲国产中文字幕| 欧美系列日韩一区| 一区二区三区中文字幕精品精品 | 欧美精品一区二| 免费人成网站在线观看欧美高清| 欧美日韩国产首页在线观看| 一区二区三区四区视频精品免费 | 成人综合婷婷国产精品久久蜜臀| 日韩一区二区视频| 日韩中文字幕av电影| 欧美日韩午夜在线视频| 亚洲影院免费观看| 精品视频一区三区九区| 亚洲精品欧美专区| 欧美性生活久久| 亚洲成av人影院| 欧美一区二区三区精品| 日日夜夜精品视频天天综合网| 制服丝袜在线91| 蜜桃一区二区三区在线| 日韩精品专区在线影院观看| 久久99精品久久只有精品| 精品精品国产高清a毛片牛牛 | 欧美性受极品xxxx喷水| 亚洲成a人片在线不卡一二三区| 欧美日韩精品一区二区三区四区| 亚洲一区二区视频在线| 欧美三级中文字幕在线观看| 亚洲一区二区四区蜜桃| 欧美日韩国产首页| 国内精品久久久久影院薰衣草| 久久久精品国产免费观看同学| 国产91丝袜在线18| 中文字幕一区在线观看视频| 日本高清不卡视频| 日韩高清中文字幕一区| 欧美精品一区二区三区久久久| 国产成人av电影在线播放| 亚洲欧美综合在线精品| 欧美日韩小视频| 韩国三级在线一区| 亚洲色图在线看| 7777精品久久久大香线蕉| 国产综合色产在线精品| 亚洲男同1069视频| 8x8x8国产精品| 粉嫩aⅴ一区二区三区四区五区| 一区二区三区不卡视频| 日韩一区二区三区视频在线观看| 国产精品资源在线| 亚洲色图19p| 精品久久久三级丝袜| av亚洲精华国产精华精华| 日韩av高清在线观看| 国产精品视频yy9299一区| 欧美性xxxxxx少妇| 国产精品一二三四区| 亚洲一区二区三区四区中文字幕| 日韩欧美你懂的| 99精品欧美一区二区三区综合在线| 水蜜桃久久夜色精品一区的特点| 中文字幕第一区综合| 欧美日韩高清一区二区三区| 国产精品一级二级三级| 亚洲国产综合人成综合网站| 久久精品亚洲国产奇米99| 欧美在线高清视频| 成人午夜av电影| 免费在线欧美视频| 亚洲免费资源在线播放| 精品国产一区二区三区久久久蜜月| 一本色道**综合亚洲精品蜜桃冫 | 东方欧美亚洲色图在线| 偷窥少妇高潮呻吟av久久免费| 欧美国产日产图区| 欧美变态口味重另类| 欧美三区免费完整视频在线观看|