亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩欧美你懂的| 麻豆成人av在线| 亚洲乱码国产乱码精品精可以看| 精品国产一区二区三区久久影院 | 另类小说视频一区二区| 日本女人一区二区三区| 麻豆成人91精品二区三区| 美国毛片一区二区三区| 经典三级在线一区| 国产成人自拍高清视频在线免费播放| 国产在线播放一区| 成人av中文字幕| 91福利视频网站| 欧美日韩国产高清一区二区| 欧美一区二区网站| 亚洲精品在线网站| 亚洲国产精品av| 亚洲三级电影全部在线观看高清| 亚洲精品成人在线| 免费观看一级特黄欧美大片| 国内精品免费在线观看| 成人在线视频首页| 在线看国产一区| 欧美一区二区在线播放| 久久蜜臀精品av| 亚洲人妖av一区二区| 亚洲一区在线观看网站| 麻豆精品新av中文字幕| 成人午夜激情影院| 欧美日韩高清在线播放| 日韩精品一区二区三区老鸭窝| 国产网站一区二区| 一区av在线播放| 久久精品国产亚洲a| av一本久道久久综合久久鬼色| 欧美在线观看视频一区二区三区| 91精品国产综合久久久久久 | 国产精品久久二区二区| 亚洲精品中文字幕在线观看| 石原莉奈在线亚洲三区| 国产成人免费高清| 欧美视频精品在线观看| 337p粉嫩大胆色噜噜噜噜亚洲| 国产精品乱人伦中文| 亚洲 欧美综合在线网络| 国产成人午夜视频| 欧美日本一道本| 国产亚洲成av人在线观看导航| 亚洲综合色区另类av| 韩国成人在线视频| 欧洲在线/亚洲| 日本一区二区免费在线观看视频| 亚洲网友自拍偷拍| 成人av电影观看| 精品欧美乱码久久久久久1区2区| 国产精品久久久久影院色老大 | 成人激情视频网站| 日韩无一区二区| 伊人夜夜躁av伊人久久| 国内精品久久久久影院一蜜桃| 欧美怡红院视频| 国产精品视频看| 久久国产麻豆精品| 欧美精品一级二级三级| 国产精品高潮久久久久无| 看电视剧不卡顿的网站| 欧美视频在线观看一区二区| 久久综合九色综合欧美就去吻| 亚洲国产精品久久久久婷婷884 | 99久久婷婷国产综合精品电影| 日韩视频一区二区在线观看| 亚洲一区二区在线视频| av电影一区二区| 国产欧美精品国产国产专区| 蜜臀av一区二区| 欧美日韩aaa| 亚洲午夜免费福利视频| jlzzjlzz亚洲女人18| 国产亚洲一区二区三区在线观看| 日韩激情一区二区| 欧美日韩国产成人在线免费| 亚洲视频一区二区在线观看| 床上的激情91.| 国产喷白浆一区二区三区| 韩国精品主播一区二区在线观看 | 欧美一级欧美三级| 久久精品欧美日韩| 日本色综合中文字幕| 欧美午夜精品久久久久久孕妇| 国产精品视频一二三区| 国产白丝精品91爽爽久久| 91精品国产综合久久福利软件| 亚洲一区二区中文在线| 韩国视频一区二区| 国产欧美一区视频| 一本色道亚洲精品aⅴ| 午夜国产不卡在线观看视频| 欧美成人在线直播| 国产成人亚洲精品青草天美| 1000精品久久久久久久久| 欧美又粗又大又爽| 精品一区二区三区在线播放| 中文字幕高清不卡| 欧洲精品中文字幕| 激情小说欧美图片| 亚洲欧美另类小说视频| 在线成人小视频| 国产成人av网站| 亚洲无人区一区| 久久九九久久九九| 在线免费观看不卡av| 久久99热狠狠色一区二区| 国产精品久久久久久久第一福利 | 亚洲一区二区三区不卡国产欧美| 91精品国产品国语在线不卡| 风间由美一区二区三区在线观看 | 欧美电影在线免费观看| 国产精品正在播放| 亚洲成人一区二区| 国产日韩欧美亚洲| 欧美人与禽zozo性伦| 国产风韵犹存在线视精品| 亚洲午夜免费视频| 中文字幕 久热精品 视频在线 | 免费一级欧美片在线观看| 国产精品网站在线观看| 欧美日韩不卡一区| 成人av在线一区二区| 日产欧产美韩系列久久99| 成人免费小视频| 欧美一区二区三区爱爱| 色综合久久88色综合天天免费| 久久国产日韩欧美精品| 亚洲国产一区二区视频| 国产欧美日韩精品a在线观看| 欧美精品一二三| 91蜜桃在线观看| 国产一区二区0| 日韩电影免费在线| 一个色综合av| 一区精品在线播放| 久久久久久久综合日本| 欧美日本韩国一区二区三区视频 | 亚洲免费看黄网站| 国产欧美日韩一区二区三区在线观看| 欧美精品久久天天躁| 色综合久久88色综合天天免费| 国产乱码精品一区二区三区五月婷| 香蕉影视欧美成人| 一区二区在线观看不卡| 中文字幕不卡一区| 精品国产污污免费网站入口| 欧美日韩在线三级| 在线免费观看日本欧美| 99r精品视频| 成人午夜私人影院| 国产精品一级在线| 韩国三级中文字幕hd久久精品| 日韩电影一区二区三区| 亚洲bt欧美bt精品| 亚洲国产裸拍裸体视频在线观看乱了 | 亚洲三级电影全部在线观看高清| 久久视频一区二区| 欧美一区二区三区婷婷月色| 欧美日韩国产综合一区二区| 91视频.com| av色综合久久天堂av综合| 成人黄色小视频在线观看| 国产精品一区二区在线观看不卡 | 国产视频亚洲色图| 精品乱人伦小说| 精品国产乱码久久久久久久 | 精品无人区卡一卡二卡三乱码免费卡 | 成人精品鲁一区一区二区| 国产福利一区二区三区| 国产精品一区久久久久| 国产精品资源网| 国产成人午夜片在线观看高清观看| 九九国产精品视频| 精品一二三四区| 国产乱人伦偷精品视频不卡| 国产精品亚洲一区二区三区妖精| 国内久久婷婷综合| 国产成人av电影| 波多野结衣欧美| 91丨porny丨最新| 一本久久综合亚洲鲁鲁五月天| 色乱码一区二区三区88| 欧美在线观看一二区| 欧美猛男超大videosgay| 制服丝袜日韩国产| 欧美大片日本大片免费观看| 日韩一区二区电影| 久久久久久一二三区| 中文字幕不卡三区| 亚洲精品中文在线观看| 午夜欧美电影在线观看| 日韩不卡一区二区三区| 久久99精品久久久久久动态图| 国产久卡久卡久卡久卡视频精品|