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

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

?? region.c

?? miniucgui1.30版本的源碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*********************************************************************** *           REGION_Coalesce * *      Attempt to merge the rects in the current band with those in the *      previous one. Used only by REGION_RegionOp. * * Results: *      The new index for the previous band. * * Side Effects: *      If coalescing takes place: *          - rectangles in the previous band will have their bottom fields *            altered. *          - some clipping rect will be deleted. * */static CLIPRECT* REGION_Coalesce (             CLIPRGN *region,      /* Region to coalesce */             CLIPRECT *prevStart,  /* start of previous band */             CLIPRECT *curStart    /* start of current band */) {    CLIPRECT *newStart;         /* Start of new band */    CLIPRECT *pPrevRect;        /* Current rect in previous band */    CLIPRECT *pCurRect;         /* Current rect in current band */    CLIPRECT *temp;             /* Temporary clipping rect */    int curNumRects;            /* Number of rectangles in current band */    int prevNumRects;           /* Number of rectangles in previous band */    int bandtop;                /* top coordinate for current band */    if (prevStart == NULL) prevStart = region->head;    if (curStart == NULL) curStart = region->head;    if (prevStart == curStart)        return prevStart;    newStart = pCurRect = curStart;    pPrevRect = prevStart;    temp = prevStart;    prevNumRects = 0;    while (temp != curStart) {        prevNumRects ++;        temp = temp->next;    }    /*     * Figure out how many rectangles are in the current band. Have to do     * this because multiple bands could have been added in REGION_RegionOp     * at the end when one region has been exhausted.     */    pCurRect = curStart;    bandtop = pCurRect->rc.top;    curNumRects = 0;    while (pCurRect && (pCurRect->rc.top == bandtop)) {        curNumRects ++;        pCurRect = pCurRect->next;    }        if (pCurRect) {        /*         * If more than one band was added, we have to find the start         * of the last band added so the next coalescing job can start         * at the right place... (given when multiple bands are added,         * this may be pointless -- see above).         */        temp = region->tail;        while (temp->prev->rc.top == temp->rc.top) {            temp = temp->prev;        }        newStart = temp;    }    if ((curNumRects == prevNumRects) && (curNumRects != 0)) {        pCurRect = curStart;        /*         * The bands may only be coalesced if the bottom of the previous         * matches the top scanline of the current.         */        if (pPrevRect->rc.bottom == pCurRect->rc.top) {            /*             * Make sure the bands have rects in the same places. This             * assumes that rects have been added in such a way that they             * cover the most area possible. I.e. two rects in a band must             * have some horizontal space between them.             */            do {                if ((pPrevRect->rc.left != pCurRect->rc.left) ||                    (pPrevRect->rc.right != pCurRect->rc.right))                {                    /*                     * The bands don't line up so they can't be coalesced.                     */                    return newStart;                }                pPrevRect = pPrevRect->next;                pCurRect = pCurRect->next;            } while (--prevNumRects);            /*             * If only one band was added to the region, we have to backup             * newStart to the start of the previous band.             */            if (pCurRect == NULL) {                newStart = prevStart;            }            /*             * The bands may be merged, so set the bottom of each rect             * in the previous band to that of the corresponding rect in             * the current band.             */            /*             * for implementation of MiniGUI, we should free              * the clipping rects merged.             */            pCurRect = curStart;            pPrevRect = prevStart;            do {                pPrevRect->rc.bottom = pCurRect->rc.bottom;                pPrevRect = pPrevRect->next;                if (pCurRect->next)                    pCurRect->next->prev = pCurRect->prev;                else                    region->tail = pCurRect->prev;                if (pCurRect->prev)                    pCurRect->prev->next = pCurRect->next;                else                    region->head = pCurRect->next;                temp = pCurRect->next;                FreeClipRect (region->heap, pCurRect);                pCurRect = temp;            } while (--curNumRects);            /*             *             * If more than one band was added to the region, copy the             * other bands down. The assumption here is that the other bands             * came from the same region as the current one and no further             * coalescing can be done on them since it's all been done             * already... newStart is already in the right place.             */            /* no need to copy for implementation of MiniGUI -- they are freed.            if (temp == regionEnd) {                newStart = prevStart;            }            else {                do {                    *pPrevRect++ = *pCurRect++;                } while (pCurRect != regionEnd);            }            */                    }    }    return (newStart);}/*********************************************************************** *           REGION_RegionOp * *      Apply an operation to two regions. Called by Union, *      Xor, Subtract, Intersect... * * Results: *      None. * * Side Effects: *      The new region is overwritten. * * Notes: *      The idea behind this function is to view the two regions as sets. *      Together they cover a rectangle of area that this function divides *      into horizontal bands where points are covered only by one region *      or by both. For the first case, the nonOverlapFunc is called with *      each the band and the band's upper and lower rcBound. For the *      second, the overlapFunc is called to process the entire band. It *      is responsible for clipping the rectangles in the band, though *      this function provides the boundaries. *      At the end of each band, the new region is coalesced, if possible, *      to reduce the number of rectangles in the region. * */static voidREGION_RegionOp(            CLIPRGN *newReg, /* Place to store result */            const CLIPRGN *reg1,   /* First region in operation */            const CLIPRGN *reg2,   /* 2nd region in operation */            voidProcp1 overlapFunc,     /* Function to call for over-lapping bands */            voidProcp2 nonOverlap1Func, /* Function to call for non-overlapping bands in region 1 */            voidProcp2 nonOverlap2Func  /* Function to call for non-overlapping bands in region 2 */) {    CLIPRGN my_dst;    CLIPRGN* pdst;    const CLIPRECT *r1;                 /* Pointer into first region */    const CLIPRECT *r2;                 /* Pointer into 2d region */    const CLIPRECT *r1BandEnd;          /* End of current band in r1 */    const CLIPRECT *r2BandEnd;          /* End of current band in r2 */    int ybot;                           /* Bottom of intersection */    int ytop;                           /* Top of intersection */    CLIPRECT* prevBand;                 /* start of previous band in newReg */    CLIPRECT* curBand;                  /* start of current band in newReg */    int top;                            /* Top of non-overlapping band */    int bot;                            /* Bottom of non-overlapping band */        /*     * Initialization:     *  set r1, r2, r1End and r2End appropriately, preserve the important     * parts of the destination region until the end in case it's one of     * the two source regions, then mark the "new" region empty, allocating     * another array of rectangles for it to use.     */    r1 = reg1->head;    r2 = reg2->head;    /*     * newReg may be one of the src regions so we can't empty it. We keep a      * note of its rects pointer (so that we can free them later), preserve its     * rcBound and simply set numRects to zero.      */    /*    oldRects = newReg->rects;    newReg->numRects = 0;     */    /*      * for implementation of MiniGUI, we create an empty region.     */    if (newReg == reg1 || newReg == reg2) {        InitClipRgn (&my_dst, newReg->heap);        pdst = &my_dst;    }    else {        EmptyClipRgn (newReg);        pdst = newReg;    }    /*     * Allocate a reasonable number of rectangles for the new region. The idea     * is to allocate enough so the individual functions don't need to     * reallocate and copy the array, which is time consuming, yet we don't     * have to worry about using too much memory. I hope to be able to     * nuke the Xrealloc() at the end of this function eventually.     */    /* for implementation of MiniGUI, dst always is an empty region.    newReg->size = MAX(reg1->numRects,reg2->numRects) * 2;    if (! (newReg->rects = malloc( sizeof(CLIPRECT) * newReg->size )))    {        newReg->size = 0;        return;    }     */        /*     * Initialize ybot and ytop.     * In the upcoming loop, ybot and ytop serve different functions depending     * on whether the band being handled is an overlapping or non-overlapping     * band.     *  In the case of a non-overlapping band (only one of the regions     * has points in the band), ybot is the bottom of the most recent     * intersection and thus clips the top of the rectangles in that band.     * ytop is the top of the next intersection between the two regions and     * serves to clip the bottom of the rectangles in the current band.     *  For an overlapping band (where the two regions intersect), ytop clips     * the top of the rectangles of both regions and ybot clips the bottoms.     */    if (reg1->rcBound.top < reg2->rcBound.top)        ybot = reg1->rcBound.top;    else        ybot = reg2->rcBound.top;        /*     * prevBand serves to mark the start of the previous band so rectangles     * can be coalesced into larger rectangles. qv. miCoalesce, above.     * In the beginning, there is no previous band, so prevBand == curBand     * (curBand is set later on, of course, but the first band will always     * start at index 0). prevBand and curBand must be indices because of     * the possible expansion, and resultant moving, of the new region's     * array of rectangles.     */    prevBand = pdst->head;        do {        curBand = pdst->tail;        /*         * This algorithm proceeds one source-band (as opposed to a         * destination band, which is determined by where the two regions         * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the         * rectangle after the last one in the current band for their         * respective regions.         */        r1BandEnd = r1;        while (r1BandEnd && (r1BandEnd->rc.top == r1->rc.top))            r1BandEnd = r1BandEnd->next;                r2BandEnd = r2;        while (r2BandEnd && (r2BandEnd->rc.top == r2->rc.top))            r2BandEnd = r2BandEnd->next;                /*         * First handle the band that doesn't intersect, if any.         *         * Note that attention is restricted to one band in the         * non-intersecting region at once, so if a region has n         * bands between the current position and the next place it overlaps         * the other, this entire loop will be passed through n times.         */        if (r1->rc.top < r2->rc.top) {            top = MAX (r1->rc.top, ybot);            bot = MIN (r1->rc.bottom, r2->rc.top);            if ((top != bot) && (nonOverlap1Func != NULL))                (* nonOverlap1Func) (pdst, r1, r1BandEnd, top, bot);            ytop = r2->rc.top;        }        else if (r2->rc.top < r1->rc.top) {            top = MAX (r2->rc.top, ybot);            bot = MIN (r2->rc.bottom, r1->rc.top);            if ((top != bot) && (nonOverlap2Func != NULL))                (* nonOverlap2Func) (pdst, r2, r2BandEnd, top, bot);            ytop = r1->rc.top;        }        else {            ytop = r1->rc.top;        }        /*         * If any rectangles got added to the region, try and coalesce them         * with rectangles from the previous band. Note we could just do         * this test in miCoalesce, but some machines incur a not         * inconsiderable cost for function calls, so...         */        if (pdst->tail != curBand) {            prevBand = REGION_Coalesce (pdst, prevBand, curBand);        }        /*         * Now see if we've hit an intersecting band. The two bands only         * intersect if ybot > ytop         */        ybot = MIN (r1->rc.bottom, r2->rc.bottom);        curBand = pdst->tail;        if (ybot > ytop)            (* overlapFunc) (pdst, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot);                if (pdst->tail != curBand)            prevBand = REGION_Coalesce (pdst, prevBand, curBand);        /*         * If we've finished with a band (bottom == ybot) we skip forward         * in the region to the next band.         */        if (r1->rc.bottom == ybot)            r1 = r1BandEnd;        if (r2->rc.bottom == ybot)            r2 = r2BandEnd;    } while (r1 && r2);    /*     * Deal with whichever region still has rectangles left.     */    curBand = pdst->tail;    if (r1) {        if (nonOverlap1Func != NULL) {            do {                r1BandEnd = r1;                while ((r1BandEnd) && (r1BandEnd->rc.top == r1->rc.top)) {                    r1BandEnd = r1BandEnd->next;                }                (* nonOverlap1Func) (pdst, r1, r1BandEnd,                                     MAX (r1->rc.top, ybot), r1->rc.bottom);                r1 = r1BandEnd;            } while (r1);        }    }    else if ((r2) && (nonOverlap2Func != NULL))    {        do {            r2BandEnd = r2;            while ((r2BandEnd) && (r2BandEnd->rc.top == r2->rc.top)) {                 r2BandEnd = r2BandEnd->next;            }            (* nonOverlap2Func) (pdst, r2, r2BandEnd,                                MAX (r2->rc.top, ybot), r2->rc.bottom);            r2 = r2BandEnd;        } while (r2);    }    if (pdst->tail != curBand)        (void) REGION_Coalesce (pdst, prevBand, curBand);    /*     * A bit of cleanup. To keep regions from growing without bound,     * we shrink the array of rectangles to match the new number of     * rectangles in the region. This never goes to 0, however...     *     * Only do this stuff if the number of rectangles allocated is more than     * twice the number of rectangles in the region (a simple optimization...).     */#if 0 // MiniGUI implementation does not need to do this    if (newReg->numRects < (newReg->size >> 1))

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲嫩草精品久久| 福利一区福利二区| 国产一区二区精品久久| 色综合天天性综合| 久久综合九色综合97婷婷| 亚洲一区在线观看视频| 国产精品一区二区你懂的| 欧美日韩你懂得| 亚洲色图视频网| 国产激情一区二区三区四区 | 蜜臀国产一区二区三区在线播放 | 韩国欧美一区二区| 一本大道久久精品懂色aⅴ| 欧美精品tushy高清| 亚洲精品国产a久久久久久 | 99视频精品在线| 久久先锋影音av鲁色资源网| 日韩avvvv在线播放| 欧美午夜精品免费| 亚洲专区一二三| 色欧美片视频在线观看| 亚洲国产成人在线| 久久99久久久欧美国产| 欧美日韩午夜在线视频| 亚洲成人免费观看| 91国产福利在线| 亚洲小少妇裸体bbw| 欧美性色aⅴ视频一区日韩精品| 91久久精品国产91性色tv| 精品少妇一区二区三区| 精一区二区三区| 精品91自产拍在线观看一区| 蜜臀a∨国产成人精品| 欧美一区二视频| 日本视频在线一区| 日韩欧美色电影| 精品一区二区三区影院在线午夜| 国产不卡高清在线观看视频| 久久久久久一级片| 成人午夜私人影院| 国产欧美中文在线| 成人短视频下载| 自拍偷拍亚洲综合| 91精品1区2区| 无码av免费一区二区三区试看 | 91蝌蚪porny成人天涯| 国产精品视频一区二区三区不卡| 亚洲一区二区综合| 日本韩国精品一区二区在线观看| 精品国产一区二区亚洲人成毛片| 国产精品丝袜在线| 99久久伊人久久99| 一区二区免费看| 欧美一区二区在线观看| 国产在线日韩欧美| 亚洲天堂成人在线观看| 欧美性色欧美a在线播放| 看片网站欧美日韩| 欧美国产精品一区二区三区| 在线精品视频小说1| 美女视频网站黄色亚洲| 中文字幕在线观看一区| 欧美一区在线视频| 精一区二区三区| 亚洲乱码国产乱码精品精可以看 | 日本亚洲一区二区| 久久噜噜亚洲综合| 91麻豆免费看| 久久99国内精品| 亚洲精品乱码久久久久久黑人| 激情综合色综合久久| 国产精品日韩精品欧美在线| 欧美猛男男办公室激情| 国产精品99久久久久久久女警| 欧美一级生活片| 国产电影一区二区三区| 亚洲一区在线观看免费| 国产色产综合产在线视频| 欧美日韩日日夜夜| 99久精品国产| 国产在线观看免费一区| 午夜视频一区二区| 一区在线中文字幕| 精品国产一二三区| 欧美日韩精品一区二区三区| 99久久婷婷国产综合精品电影| 国产精品毛片大码女人| 欧美不卡视频一区| 精品视频123区在线观看| 不卡的电影网站| 国产在线精品一区二区不卡了 | 欧美性视频一区二区三区| 国产在线一区观看| 日韩精品亚洲专区| 亚洲黄色性网站| 国产精品久久久久久久久搜平片 | 欧美韩日一区二区三区四区| 欧美日韩成人一区二区| 色哟哟在线观看一区二区三区| 亚洲精品日日夜夜| 欧美激情一区三区| 久久久综合网站| 久久嫩草精品久久久精品| 欧美大片一区二区| 欧美一区二区三区视频免费播放 | 亚洲成人激情综合网| 亚洲少妇最新在线视频| 中国色在线观看另类| 久久久久久久久久久电影| 精品久久久久久最新网址| 欧美亚洲国产一区二区三区| 色综合久久综合网欧美综合网| 亚洲不卡在线观看| 一区二区三区精品视频在线| 自拍av一区二区三区| 国产日本欧洲亚洲| 国产午夜亚洲精品午夜鲁丝片| 高清免费成人av| 国产剧情一区二区| 国产真实乱子伦精品视频| 老司机精品视频在线| 日韩成人一区二区| 久久国产精品免费| 国产精品一线二线三线精华| 国产成人免费视频网站高清观看视频| 亚洲免费在线观看视频| 亚洲精品菠萝久久久久久久| 亚洲一区二区三区四区不卡| 一区二区三区.www| 婷婷综合另类小说色区| 日韩成人午夜精品| 久久国产精品99久久人人澡| 国产成人精品一区二| www.欧美色图| 欧美三级日韩三级| 欧美sm极限捆绑bd| 国产蜜臀av在线一区二区三区| 欧美喷潮久久久xxxxx| 欧美成人一区二区三区片免费| 一本到三区不卡视频| 在线观看视频一区| 欧美一区二区三区免费视频 | 国产成人一区在线| www.av精品| 欧美嫩在线观看| 久久久蜜桃精品| 亚洲欧美日韩一区| 久久国产人妖系列| 91在线观看视频| 欧美成人vps| 一区二区三区四区精品在线视频| 久久综合色8888| 伊人婷婷欧美激情| 日韩国产欧美在线观看| 国产91清纯白嫩初高中在线观看| 久久国产婷婷国产香蕉| 99久久99久久精品国产片果冻| 国产成人免费在线| 欧美精品第一页| 成人免费一区二区三区视频| 日本sm残虐另类| 91免费在线看| 久久一区二区三区四区| 亚洲综合色区另类av| 国产传媒欧美日韩成人| 在线播放一区二区三区| 136国产福利精品导航| 韩日欧美一区二区三区| 555夜色666亚洲国产免| 亚洲视频1区2区| 国产suv精品一区二区三区| 日韩午夜在线播放| 亚洲一区二区精品久久av| 成人精品一区二区三区中文字幕| 成人免费毛片aaaaa**| 日韩精品专区在线影院重磅| 亚洲免费在线电影| a美女胸又www黄视频久久| 精品国精品自拍自在线| 日日夜夜精品视频天天综合网| 精品一区二区免费在线观看| 欧美亚洲国产一区在线观看网站| 欧美理论电影在线| 一区二区三区四区激情| www.欧美.com| 国产精品高潮呻吟| 国产一区在线看| 日韩欧美区一区二| 奇米一区二区三区av| 欧美一区二区二区| 日韩中文字幕一区二区三区| 欧美日韩视频在线观看一区二区三区| 日韩视频在线观看一区二区| 亚洲一区二区三区影院| 色婷婷久久久亚洲一区二区三区| 51久久夜色精品国产麻豆| 一区二区高清免费观看影视大全| 免费在线观看精品| 555www色欧美视频| 天天色天天爱天天射综合|