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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rectangle.c

?? STM32+Grlib
?? C
字號:
//*****************************************************************************
//
// rectangle.c - Routines for drawing and filling rectangles.
//
// Copyright (c) 2007-2010 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
// 
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
// 
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 5821 of the Stellaris Graphics Library.
//
//*****************************************************************************

#include "driverlib/debug.h"
#include "grlib/grlib.h"

//*****************************************************************************
//
//! \addtogroup primitives_api
//! @{
//
//*****************************************************************************

//*****************************************************************************
//
// Make sure min and max are defined.
//
//*****************************************************************************
#ifndef min
#define min(a, b)               (((a) < (b)) ? (a) : (b))
#endif

#ifndef max
#define max(a, b)               (((a) < (b)) ? (b) : (a))
#endif

//*****************************************************************************
//
//! Draws a rectangle.
//!
//! \param pContext is a pointer to the drawing context to use.
//! \param pRect is a pointer to the structure containing the extents of the
//! rectangle.
//!
//! This function draws a rectangle.  The rectangle will extend from \e lXMin
//! to \e lXMax and \e lYMin to \e lYMax, inclusive.
//!
//! \return None.
//
//*****************************************************************************
void
GrRectDraw(const tContext *pContext, const tRectangle *pRect)
{
    //
    // Check the arguments.
    //
    ASSERT(pContext);
    ASSERT(pRect);

    //
    // Draw a line across the top of the rectangle.
    //
    GrLineDrawH(pContext, pRect->sXMin, pRect->sXMax, pRect->sYMin);

    //
    // Return if the rectangle is one pixel tall.
    //
    if(pRect->sYMin == pRect->sYMax)
    {
        return;
    }

    //
    // Draw a line down the right side of the rectangle.
    //
    GrLineDrawV(pContext, pRect->sXMax, pRect->sYMin + 1, pRect->sYMax);

    //
    // Return if the rectangle is one pixel wide.
    //
    if(pRect->sXMin == pRect->sXMax)
    {
        return;
    }

    //
    // Draw a line across the bottom of the rectangle.
    //
    GrLineDrawH(pContext, pRect->sXMax - 1, pRect->sXMin, pRect->sYMax);

    //
    // Return if the rectangle is two pixels tall.
    //
    if((pRect->sYMin + 1) == pRect->sYMax)
    {
        return;
    }

    //
    // Draw a line up the left side of the rectangle.
    //
    GrLineDrawV(pContext, pRect->sXMin, pRect->sYMax - 1, pRect->sYMin + 1);
}

//*****************************************************************************
//
//! Draws a filled rectangle.
//!
//! \param pContext is a pointer to the drawing context to use.
//! \param pRect is a pointer to the structure containing the extents of the
//! rectangle.
//!
//! This function draws a filled rectangle.  The rectangle will extend from
//! \e lXMin to \e lXMax and \e lYMin to \e lYMax, inclusive.  The clipping of
//! the rectangle to the clipping rectangle is performed within this routine;
//! the display driver's rectangle fill routine is used to perform the actual
//! rectangle fill.
//!
//! \return None.
//
//*****************************************************************************
void
GrRectFill(const tContext *pContext, const tRectangle *pRect)
{
    tRectangle sTemp;

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

    //
    // Swap the X coordinates if sXMin is greater than sXMax.
    //
    if(pRect->sXMin > pRect->sXMax)
    {
        sTemp.sXMin = pRect->sXMax;
        sTemp.sXMax = pRect->sXMin;
    }
    else
    {
        sTemp.sXMin = pRect->sXMin;
        sTemp.sXMax = pRect->sXMax;
    }

    //
    // Swap the Y coordinates if sYMin is greater than sYMax.
    //
    if(pRect->sYMin > pRect->sYMax)
    {
        sTemp.sYMin = pRect->sYMax;
        sTemp.sYMax = pRect->sYMin;
    }
    else
    {
        sTemp.sYMin = pRect->sYMin;
        sTemp.sYMax = pRect->sYMax;
    }

    //
    // Now that the coordinates are ordered, return without drawing anything if
    // the entire rectangle is out of the clipping region.
    //
    if((sTemp.sXMin > pContext->sClipRegion.sXMax) ||
       (sTemp.sXMax < pContext->sClipRegion.sXMin) ||
       (sTemp.sYMin > pContext->sClipRegion.sYMax) ||
       (sTemp.sYMax < pContext->sClipRegion.sYMin))
    {
        return;
    }

    //
    // Clip the X coordinates to the edges of the clipping region if necessary.
    //
    if(sTemp.sXMin < pContext->sClipRegion.sXMin)
    {
        sTemp.sXMin = pContext->sClipRegion.sXMin;
    }
    if(sTemp.sXMax > pContext->sClipRegion.sXMax)
    {
        sTemp.sXMax = pContext->sClipRegion.sXMax;
    }

    //
    // Clip the Y coordinates to the edges of the clipping region if necessary.
    //
    if(sTemp.sYMin < pContext->sClipRegion.sYMin)
    {
        sTemp.sYMin = pContext->sClipRegion.sYMin;
    }
    if(sTemp.sYMax > pContext->sClipRegion.sYMax)
    {
        sTemp.sYMax = pContext->sClipRegion.sYMax;
    }

    //
    // Call the low level rectangle fill routine.
    //
    DpyRectFill(pContext->pDisplay, &sTemp, pContext->ulForeground);
}

//*****************************************************************************
//
//! Determines if two rectangles overlap.
//!
//! \param psRect1 is a pointer to the first rectangle.
//! \param psRect2 is a pointer to the second rectangle.
//!
//! This function determines whether two rectangles overlap.  It assumes that
//! rectangles \e psRect1 and \e psRect2 are valid with \e sXMin < \e sXMax and
//! \e sYMin < \e sYMax.
//!
//! \return Returns 1 if there is an overlap or 0 if not.
//
//*****************************************************************************
long
GrRectOverlapCheck(tRectangle *psRect1, tRectangle *psRect2)
{
    if((psRect1->sXMax < psRect2->sXMin) ||
       (psRect2->sXMax < psRect1->sXMin) ||
       (psRect1->sYMax < psRect2->sYMin) ||
       (psRect2->sYMax < psRect1->sYMin))
    {
        return(0);
    }
    else
    {
        return(1);
    }
}

//*****************************************************************************
//
//! Determines the intersection of two rectangles.
//!
//! \param psRect1 is a pointer to the first rectangle.
//! \param psRect2 is a pointer to the second rectangle.
//! \param psIntersect is a pointer to a rectangle which will be written with
//! the intersection of \e psRect1 and \e psRect2.
//!
//! This function determines if two rectangles overlap and, if they do,
//! calculates the rectangle representing their intersection.  If the rectangles
//! do not overlap, 0 is returned and \e psIntersect is not written.
//!
//! \return Returns 1 if there is an overlap or 0 if not.
//
//*****************************************************************************
long
GrRectIntersectGet(tRectangle *psRect1, tRectangle *psRect2,
                   tRectangle *psIntersect)
{
    //
    // Make sure we were passed valid rectangles.
    //
    if((psRect1->sXMax <= psRect1->sXMin) ||
       (psRect1->sYMax <= psRect1->sYMin) ||
       (psRect2->sXMax <= psRect2->sXMin) ||
       (psRect2->sYMax <= psRect2->sYMin))
    {
        return(0);
    }

    //
    // Make sure that there is an intersection between the two rectangles.
    //
    if(!GrRectOverlapCheck(psRect1, psRect2))
    {
        return(0);
    }

    //
    // The rectangles do intersect so determine the rectangle of the
    // intersection.
    //
    psIntersect->sXMin = max(psRect1->sXMin, psRect2->sXMin);
    psIntersect->sXMax = min(psRect1->sXMax, psRect2->sXMax);
    psIntersect->sYMin = max(psRect1->sYMin, psRect2->sYMin);
    psIntersect->sYMax = min(psRect1->sYMax, psRect2->sYMax);

    return(1);
}

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国内外成人在线| 色综合 综合色| 亚洲一区二区在线免费观看视频| 欧美喷水一区二区| av动漫一区二区| 激情欧美一区二区三区在线观看| 亚洲美女免费在线| 国产三级欧美三级日产三级99| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 国产一区激情在线| 亚洲最色的网站| 国产精品免费aⅴ片在线观看| 91精品国产入口| 在线中文字幕不卡| www.日韩在线| 国产老肥熟一区二区三区| 日韩精品国产精品| 一区二区三区四区国产精品| 中文字幕成人网| 久久久美女毛片| 精品日韩一区二区| 欧美一区二区三区在线观看视频 | 日韩三级高清在线| 欧美日韩精品电影| 色狠狠综合天天综合综合| 成人免费高清在线观看| 久久激情五月婷婷| 免费观看一级欧美片| 亚洲一区二区三区中文字幕在线| 国产精品久久毛片av大全日韩| 亚洲精品在线电影| 日韩精品一区二区三区蜜臀 | 色哟哟在线观看一区二区三区| 国产成人精品免费| 国产高清无密码一区二区三区| 久久国产婷婷国产香蕉| 奇米影视在线99精品| 肉肉av福利一精品导航| 五月综合激情网| 日本午夜一本久久久综合| 午夜国产精品一区| 国产不卡一区视频| 精品午夜久久福利影院| 经典三级视频一区| 国产高清视频一区| 不卡视频一二三四| 91免费版pro下载短视频| 91看片淫黄大片一级在线观看| proumb性欧美在线观看| 色综合天天做天天爱| 欧美日韩一区三区四区| 91精品久久久久久久久99蜜臂| 日韩三区在线观看| 久久婷婷国产综合国色天香| 久久免费午夜影院| 欧美—级在线免费片| 中文字幕一区二区三区不卡在线| 亚洲欧洲精品一区二区精品久久久| 亚洲欧美一区二区三区孕妇| 亚洲最大成人综合| 日本va欧美va精品发布| 国产一区不卡在线| 91在线观看美女| 56国语精品自产拍在线观看| 日韩欧美一区电影| 国产精品久久三| 亚洲成a人片在线不卡一二三区| 美女视频黄免费的久久| 国产剧情一区二区| 91麻豆国产在线观看| 欧美中文字幕一区二区三区亚洲| 欧美日韩卡一卡二| 久久久精品国产免费观看同学| 欧美国产1区2区| 亚洲国产精品麻豆| 国产一区美女在线| 日本韩国欧美一区| 欧美va在线播放| 综合久久久久久久| 麻豆91精品91久久久的内涵| 国产又粗又猛又爽又黄91精品| fc2成人免费人成在线观看播放| 欧美高清精品3d| 国产无一区二区| 天堂va蜜桃一区二区三区| 国产成人av一区二区三区在线观看| 欧美影院午夜播放| 久久精品亚洲精品国产欧美| 亚洲国产wwwccc36天堂| 国产69精品久久99不卡| 欧美精品丝袜久久久中文字幕| 国产日韩欧美综合在线| 日韩在线观看一区二区| www.亚洲色图| 精品裸体舞一区二区三区| 一区二区三区日本| 福利电影一区二区| 欧美成人艳星乳罩| 亚洲成人综合视频| 高清在线不卡av| 日韩久久久久久| 午夜成人在线视频| 91久久一区二区| 中文字幕欧美国产| 韩国女主播一区| 欧美精品久久一区| 亚洲免费视频成人| av不卡免费电影| 久久精品一区二区三区四区| 天天影视网天天综合色在线播放| 91视频免费看| 中文成人综合网| 国产另类ts人妖一区二区| 日韩欧美精品三级| 亚洲3atv精品一区二区三区| 99视频有精品| 中文字幕精品一区| 国产美女主播视频一区| 日韩片之四级片| 日韩av不卡一区二区| 欧美三级蜜桃2在线观看| 亚洲精品国产精华液| 97久久精品人人澡人人爽| 中文字幕精品一区二区精品绿巨人 | 亚洲视频一二三| 成人国产精品免费网站| 精品国产区一区| 国产在线日韩欧美| 久久久精品黄色| 国产九色精品成人porny| 精品91自产拍在线观看一区| 人人精品人人爱| 欧美丰满美乳xxx高潮www| 亚洲国产精品久久久男人的天堂| 日本久久一区二区| 亚洲午夜在线电影| 欧美色大人视频| 亚洲成av人片在线观看无码| 欧美系列一区二区| 五月天婷婷综合| 欧美美女直播网站| 免费精品视频最新在线| 日韩欧美区一区二| 国产麻豆精品视频| 国产精品色婷婷| 一本久久综合亚洲鲁鲁五月天 | 欧美大片日本大片免费观看| 热久久免费视频| 久久久久久免费| 成人av在线电影| 一区2区3区在线看| 在线观看91精品国产麻豆| 麻豆91精品视频| 国产精品久久久爽爽爽麻豆色哟哟 | 91精品国产欧美一区二区| 天堂蜜桃一区二区三区| 欧美不卡视频一区| 国产91丝袜在线18| 伊人色综合久久天天人手人婷| 91成人网在线| 精品一区二区久久| 国产精品久久久99| 欧美性大战久久久久久久| 日韩高清不卡一区二区三区| 欧美一区二区三区视频免费| 国内久久精品视频| 成人欧美一区二区三区黑人麻豆| 色婷婷一区二区| 另类中文字幕网| 综合久久久久久久| 日韩欧美一区二区在线视频| 国产91在线看| 午夜精品福利久久久| 久久久蜜桃精品| 欧美日韩一区国产| 国产成人精品免费| 午夜一区二区三区在线观看| 久久久久久**毛片大全| 色88888久久久久久影院野外| 欧美aa在线视频| 国产精品第13页| 欧美一区二区三区影视| 99这里只有精品| 久久er精品视频| 亚洲风情在线资源站| 国产午夜亚洲精品不卡 | 久久久国产综合精品女国产盗摄| 色8久久人人97超碰香蕉987| 国产制服丝袜一区| 亚洲夂夂婷婷色拍ww47| 久久婷婷国产综合国色天香| 欧美日韩久久一区| 99这里只有久久精品视频| 免费成人在线视频观看| 亚洲精品日产精品乱码不卡| 久久久久久一二三区| 91精品国产欧美一区二区成人| 91年精品国产| 成熟亚洲日本毛茸茸凸凹| 奇米精品一区二区三区四区|