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

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

?? region.c

?? symbian 下的helix player源代碼
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* ***** BEGIN LICENSE BLOCK *****
 * Source last modified: $Id: region.c,v 1.3.12.1 2004/07/09 01:59:28 hubbe Exp $
 * 
 * Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.
 * 
 * The contents of this file, and the files included with this file,
 * are subject to the current version of the RealNetworks Public
 * Source License (the "RPSL") available at
 * http://www.helixcommunity.org/content/rpsl unless you have licensed
 * the file under the current version of the RealNetworks Community
 * Source License (the "RCSL") available at
 * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
 * will apply. You may also obtain the license terms directly from
 * RealNetworks.  You may not use this file except in compliance with
 * the RPSL or, if you have a valid RCSL with RealNetworks applicable
 * to this file, the RCSL.  Please see the applicable RPSL or RCSL for
 * the rights, obligations and limitations governing use of the
 * contents of the file.
 * 
 * Alternatively, the contents of this file may be used under the
 * terms of the GNU General Public License Version 2 or later (the
 * "GPL") in which case the provisions of the GPL are applicable
 * instead of those above. If you wish to allow use of your version of
 * this file only under the terms of the GPL, and not to allow others
 * to use your version of this file under the terms of either the RPSL
 * or RCSL, indicate your decision by deleting the provisions above
 * and replace them with the notice and other provisions required by
 * the GPL. If you do not delete the provisions above, a recipient may
 * use your version of this file under the terms of any one of the
 * RPSL, the RCSL or the GPL.
 * 
 * This file is part of the Helix DNA Technology. RealNetworks is the
 * developer and/or licensor of the Original Code and owns the
 * copyrights in the portions it created.
 * 
 * This file, and the files included with this file, is distributed
 * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
 * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
 * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
 * ENJOYMENT OR NON-INFRINGEMENT.
 * 
 * Technology Compatibility Kit Test Suite(s) Location:
 *    http://www.helixcommunity.org/content/tck
 * 
 * Contributor(s):
 * 
 * ***** END LICENSE BLOCK ***** */

/************************************************************************

Copyright (c) 1987, 1988  X Consortium

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
 
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Except as contained in this notice, the name of the X Consortium shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from the X Consortium.


Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.  

DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.

************************************************************************/
/*
 * The functions in this file implement the _Region abstraction, similar to one
 * used in the X11 sample server. A _Region is simply an area, as the name
 * implies, and is implemented as a "y-x-banded" array of rectangles. To
 * explain: Each _Region is made up of a certain number of rectangles sorted
 * by y coordinate first, and then by x coordinate.
 *
 * Furthermore, the rectangles are banded such that every rectangle with a
 * given upper-left y coordinate (y1) will have the same lower-right y
 * coordinate (y2) and vice versa. If a rectangle has scanlines in a band, it
 * will span the entire vertical distance of the band. This means that some
 * areas that could be merged into a taller rectangle will be represented as
 * several shorter rectangles to account for shorter rectangles to its left
 * or right but within its "vertical scope".
 *
 * An added constraint on the rectangles is that they must cover as much
 * horizontal area as possible. E.g. no two rectangles in a band are allowed
 * to touch.
 *
 * Whenever possible, bands will be merged together to cover a greater vertical
 * distance (and thus reduce the number of rectangles). Two bands can be merged
 * only if the bottom of one touches the top of the other and they have
 * rectangles in the same places (of the same width, of course). This maintains
 * the y-x-banding that's so nice to have...
 */
/* $XFree86: xc/lib/X11/_Region.c,v 1.1.1.2.2.2 1998/10/04 15:22:50 hohndel Exp $ */

#include "region.h"
#include "hlxclib/stdlib.h"
#include "hlxclib/memory.h"

#ifdef _DEBUG
#include <hlxclib/stdio.h> /* for _DumpRegion() */
#ifdef _WINDOWS
#include "windows.h"
#endif
#endif

#include <hlxclib/string.h>

typedef void (*voidProcp)();

                        
typedef int (*overlapFunc)( register _HXRegion  pReg,
                            register HXBoxPtr   r1,
                            HXBoxPtr            r1End,
                            register HXBoxPtr   r2,
                            HXBoxPtr            r2End,
                            register short      y1,
                            register short      y2
                            );

typedef int (*nonOverlapFunc)( register _HXRegion  pReg,
                               register HXBoxPtr   r,
                               HXBoxPtr            rEnd,
                               register short      y1,
                               register short      y2
                               );

static void miRegionOp( _HXRegion      newReg,                 
                        _HXRegion      reg1,                   
                        _HXRegion      reg2,                   
                        overlapFunc    overlap,
                        nonOverlapFunc nonoverlap,
                        nonOverlapFunc nonoverlap2  
                        );


/* Create a new empty region    */ 
_HXRegion HXCreateRegion()
{
    _HXRegion temp;

    if (! (temp = ( _HXRegion )malloc( (unsigned) sizeof( HXREGION ))))
        return (_HXRegion) NULL;
    if (! (temp->rects = ( HXBOX * )malloc( (unsigned) sizeof( HXBOX )))) {
        free((char *) temp);
        return (_HXRegion) NULL;
    }
    temp->numRects = 0;
    temp->extents.x1 = 0;
    temp->extents.y1 = 0;
    temp->extents.x2 = 0;
    temp->extents.y2 = 0;
    temp->size = 1;
    return( temp );
}

int HXClipRBox( _HXRegion r, HXRECTANGLE* rect)
{
    rect->x = r->extents.x1;
    rect->y = r->extents.y1;
    rect->width = r->extents.x2 - r->extents.x1;
    rect->height = r->extents.y2 - r->extents.y1;
    return 1;
}

_HXRegion HXCreateRectRegion(int left, int top, int width, int height)
{
    _HXRegion pRegion = HXCreateRegion();
    
    /*  
        too scared to put this code in. Will have to check to see if everything 
        works with it later.
    
    pRegion->numRects++;
    temp->rects.x1 = pRegion->extents.x1 = left;
    temp->rects.y1 = pRegion->extents.y1 = top;
    temp->rects.x2 = pRegion->extents.x2 = right;
    temp->rects.y2 = pRegion->extents.y2 = bottom;
    */
    
    HXRECTANGLE tempRECT;
    tempRECT.x      =   left;
    tempRECT.y      =   top;
    tempRECT.width  =   width;
    tempRECT.height =   height;

    HXUnionRectWithRegion(&tempRECT, pRegion, pRegion);
    return pRegion;
}


//=======================================================================
//=======================================================================
//               New methods to act on regions
//=======================================================================
//=======================================================================



int HXCombineRgn( _HXRegion destRgn,
                   _HXRegion srcRgn1,
                   _HXRegion srcRgn2,
                   HXRegionArithmetic rgnOperation)
{
//   HX_ASSERT( destRgn && srcRgn1 && srcRgn2);
   switch (rgnOperation)
   {
      case HX_RGN_DIFF:
         HXSubtractRegion( srcRgn1, srcRgn2, destRgn );
         break;
        
      case HX_RGN_AND:
         HXIntersectRegion( srcRgn1, srcRgn2, destRgn );
         break;
        
      case HX_RGN_OR:
         HXUnionRegion(srcRgn1, srcRgn2, destRgn );
         break;
        
      case HX_RGN_XOR:
         HXXorRegion( srcRgn1, srcRgn2, destRgn );
         break;
        
      default:
//         HX_ASSERT(!"Egads! Unknown HXCombineRgn Operation!");
         break;
   }
   return 0;
}

//=======================================================================
//=======================================================================
//               END: New methods to act on regions
//=======================================================================
//=======================================================================


int HXUnionRectWithRegion(HXRECTANGLE* rect, _HXRegion source, _HXRegion dest)
{
    HXREGION region;

    if (!rect->width || !rect->height)
        return 0;
    region.rects = &region.extents;
    region.numRects = 1;
    region.extents.x1 = rect->x;
    region.extents.y1 = rect->y;
    region.extents.x2 = rect->x + rect->width;
    region.extents.y2 = rect->y + rect->height;
    region.size = 1;

    return HXUnionRegion(&region, source, dest);
}

/*-
 *-----------------------------------------------------------------------
 * miSetExtents --
 *      Reset the extents of a region to what they should be. Called by
 *      miSubtract and miIntersect b/c they can't figure it out along the
 *      way or do so easily, as miUnion can.
 *
 * Results:
 *      None.
 *
 * Side Effects:
 *      The region's 'extents' structure is overwritten.
 *
 *-----------------------------------------------------------------------
 */
static void
miSetExtents (_HXRegion pReg)
{
    register HXBoxPtr   pHXBox,
                        pHXBoxEnd,
                        pExtents;

    if (pReg->numRects == 0)
    {
        pReg->extents.x1 = 0;
        pReg->extents.y1 = 0;
        pReg->extents.x2 = 0;
        pReg->extents.y2 = 0;
        return;
    }

    pExtents = &pReg->extents;
    pHXBox = pReg->rects;
    pHXBoxEnd = &pHXBox[pReg->numRects - 1];

    /*
     * Since pHXBox is the first rectangle in the region, it must have the
     * smallest y1 and since pHXBoxEnd is the last rectangle in the region,
     * it must have the largest y2, because of banding. Initialize x1 and
     * x2 from  pHXBox and pHXBoxEnd, resp., as good things to initialize them
     * to...
     */
    pExtents->x1 = pHXBox->x1;
    pExtents->y1 = pHXBox->y1;
    pExtents->x2 = pHXBoxEnd->x2;
    pExtents->y2 = pHXBoxEnd->y2;

    /* assert(pExtents->y1 < pExtents->y2); */
    while (pHXBox <= pHXBoxEnd)
    {
        if (pHXBox->x1 < pExtents->x1)
        {
            pExtents->x1 = pHXBox->x1;
        }
        if (pHXBox->x2 > pExtents->x2)
        {
            pExtents->x2 = pHXBox->x2;
        }
        pHXBox++;
    }
    /* assert(pExtents->x1 < pExtents->x2); */
}

int HXZeroOutRegion(_HXRegion r)
{
    if (!r)
    {
        return 0;
    }
    
    if( r->rects )
        free( (char *) r->rects );
    
    if( !(r->rects = ( HXBOX * )malloc( (unsigned) sizeof( HXBOX ))) )
    {
        return 0;
    }
    
    r->numRects = 0;
    r->extents.x1 = 0;
    r->extents.y1 = 0;
    r->extents.x2 = 0;
    r->extents.y2 = 0;
    r->size = 1;
    
    return 1;
}

int HXDestroyRegion(_HXRegion r)
{
    if (!r)
    {
        return 0;
    }
    free( (char *) r->rects );
    free( (char *) r );
    return 1;
}


/* TranslateRegion(pRegion, x, y)
   translates in place
   added by raymond
*/

int HXOffsetRegion(_HXRegion pRegion, int x, int y)
{
    register int nHXBox;
    register HXBOX *pHXBox;

    pHXBox = pRegion->rects;
    nHXBox = pRegion->numRects;

    while(nHXBox--)
    {
        pHXBox->x1 += x;
        pHXBox->x2 += x;
        pHXBox->y1 += y;
        pHXBox->y2 += y;
        pHXBox++;
    }
    pRegion->extents.x1 += x;
    pRegion->extents.x2 += x;
    pRegion->extents.y1 += y;
    pRegion->extents.y2 += y;
    return 1;
}

/* 
   Utility procedure Compress:
   Replace r by the region r', where 
     p in r' iff (Quantifer m <= dx) (p + m in r), and
     Quantifier is Exists if grow is TRUE, For all if grow is FALSE, and
     (x,y) + m = (x+m,y) if xdir is TRUE; (x,y+m) if xdir is FALSE.

   Thus, if xdir is TRUE and grow is FALSE, r is replaced by the region
   of all points p such that p and the next dx points on the same
   horizontal scan line are all in r.  We do this using by noting
   that p is the head of a run of length 2^i + k iff p is the head
   of a run of length 2^i and p+2^i is the head of a run of length
   k. Thus, the loop invariant: s contains the region corresponding
   to the runs of length shift.  r contains the region corresponding
   to the runs of length 1 + dxo & (shift-1), where dxo is the original
   value of dx.  dx = dxo & ~(shift-1).  As parameters, s and t are
   scratch regions, so that we don't have to allocate them on every
   call.
*/

#define ZOpRegion(a,b,c) if (grow) HXUnionRegion(a,b,c); \
                         else HXIntersectRegion(a,b,c)
#define ZShiftRegion(a,b) if (xdir) HXOffsetRegion(a,b,0); \
                          else HXOffsetRegion(a,0,b)
#define ZCopyRegion(a,b) HXUnionRegion(a,a,b)

static void
Compress(_HXRegion r, _HXRegion s, _HXRegion t, unsigned dx, int xdir, int grow)
{
    register unsigned shift = 1;

    ZCopyRegion(r, s);
    while (dx) {
        if (dx & shift) {
            ZShiftRegion(r, -(int)shift);
            ZOpRegion(r, s, r);
            dx -= shift;
            if (!dx) break;
        }
        ZCopyRegion(s, t);
        ZShiftRegion(s, -(int)shift);
        ZOpRegion(s, t, s);
        shift <<= 1;
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
96av麻豆蜜桃一区二区| 成人a区在线观看| 激情综合色综合久久综合| 黄色成人免费在线| 色综合久久久网| 精品免费一区二区三区| 中文字幕一区二区三区四区不卡 | 久久亚洲一级片| 一区二区三区日韩欧美| 国产在线精品一区二区夜色| 91久久国产综合久久| 欧美成人女星排行榜| 一区二区三区欧美| 国产一区二区免费视频| 欧美色精品天天在线观看视频| 久久综合色播五月| 日韩专区中文字幕一区二区| 国产经典欧美精品| 亚洲欧美激情小说另类| 国产综合久久久久久鬼色| 欧美日韩一本到| 成人免费在线视频观看| 国产成人免费视频网站高清观看视频 | 黄色精品一二区| 在线看不卡av| 亚洲欧美偷拍另类a∨色屁股| 久久99久久久久| 884aa四虎影成人精品一区| 亚洲色图丝袜美腿| 成人av午夜电影| 久久精品一区蜜桃臀影院| 另类综合日韩欧美亚洲| 678五月天丁香亚洲综合网| 亚洲一二三四久久| 一本色道a无线码一区v| 成人欧美一区二区三区在线播放| 国产激情一区二区三区四区 | 国产精品一级黄| 日韩一区二区三| 日本女优在线视频一区二区| 欧美精品久久久久久久多人混战| 亚洲免费av网站| 欧洲色大大久久| 亚洲综合色成人| 成人sese在线| 久久理论电影网| 亚洲国产综合人成综合网站| 日本韩国欧美在线| 亚洲男人的天堂一区二区| 91丨九色porny丨蝌蚪| 亚洲精品视频免费观看| 99国产精品久久久久久久久久 | 日韩主播视频在线| 6080国产精品一区二区| 美洲天堂一区二卡三卡四卡视频| 91精品国产高清一区二区三区| 午夜精品久久久久久久蜜桃app| 欧美高清视频在线高清观看mv色露露十八 | 午夜电影久久久| 国产精品久久免费看| 欧美视频中文字幕| 亚洲国产一区在线观看| 色哟哟精品一区| 国产精品久久久久影院老司| 波多野结衣在线aⅴ中文字幕不卡| 亚洲国产高清不卡| 图片区日韩欧美亚洲| 国产老肥熟一区二区三区| 欧美日本国产视频| 18欧美亚洲精品| 在线观看成人免费视频| 亚洲视频一区二区在线观看| 天堂蜜桃一区二区三区| 91精品国产欧美一区二区18| 久久机这里只有精品| 国产精品三级久久久久三级| 在线日韩av片| 久久精品国产一区二区三区免费看| 国产午夜精品理论片a级大结局| 99国产精品视频免费观看| 日韩中文字幕亚洲一区二区va在线| 久久先锋影音av鲁色资源| a4yy欧美一区二区三区| 免费人成黄页网站在线一区二区| 久久久久高清精品| 在线观看网站黄不卡| 韩国av一区二区三区四区| 亚洲精品美腿丝袜| wwwwww.欧美系列| 精品婷婷伊人一区三区三| 国产一区二区三区香蕉| 午夜精品福利一区二区三区av| 久久综合九色综合97婷婷| 99久久精品费精品国产一区二区| 日日夜夜免费精品视频| 国产精品第四页| 欧美电影免费观看高清完整版| 91亚洲资源网| 精品亚洲国产成人av制服丝袜| 亚洲午夜国产一区99re久久| 欧美国产1区2区| 日韩精品一区在线| 9191久久久久久久久久久| 91在线码无精品| 成人一区二区三区中文字幕| 久久99国产精品久久| 亚洲国产精品天堂| 国产精品天天看| 久久人人超碰精品| 精品国产一区二区三区忘忧草| 在线免费av一区| 一本色道久久综合亚洲精品按摩| 成人精品鲁一区一区二区| 极品少妇一区二区三区精品视频| 视频一区在线视频| 婷婷综合久久一区二区三区| 亚洲一区影音先锋| 一二三四社区欧美黄| 亚洲欧美福利一区二区| 综合久久国产九一剧情麻豆| 国产精品入口麻豆九色| 中文字幕高清一区| 国产精品视频一二| 中文字幕一区二区不卡 | 亚洲一区二区三区爽爽爽爽爽| 亚洲婷婷综合色高清在线| 国产精品毛片无遮挡高清| 中文av字幕一区| 亚洲国产精品99久久久久久久久| 久久精品在线免费观看| 中文字幕免费不卡| 国产精品成人在线观看| 日本一区二区三区视频视频| 国产日韩精品一区二区三区| 亚洲国产精品v| 亚洲私人影院在线观看| 樱花影视一区二区| 亚洲va国产va欧美va观看| 午夜免费久久看| 欧美a级一区二区| 国内欧美视频一区二区| 高清视频一区二区| 91黄色激情网站| 精品欧美乱码久久久久久1区2区| 欧美一级艳片视频免费观看| 精品久久免费看| 日本一区二区动态图| 亚洲色图欧美偷拍| 五月天国产精品| 久久99精品国产.久久久久| 国产成人鲁色资源国产91色综| 成人国产电影网| 欧美视频一区在线观看| 精品美女一区二区三区| 国产精品久久看| 午夜欧美2019年伦理| 国产一区二区h| 色综合色综合色综合| 91精品国模一区二区三区| 日韩精品一区二区三区四区视频 | 另类小说视频一区二区| 国产91在线看| 9191国产精品| 国产丝袜在线精品| 亚洲图片欧美色图| 成人影视亚洲图片在线| 欧美日韩亚洲综合一区| 国产午夜一区二区三区| 一区av在线播放| 国产综合色视频| 欧美无人高清视频在线观看| 精品999久久久| 亚洲二区在线视频| 国产91在线看| 91精品国产综合久久久蜜臀图片| 国产精品国产精品国产专区不片| 五月婷婷久久综合| 色婷婷精品久久二区二区蜜臀av| 6080国产精品一区二区| 中文字幕日韩一区| 国产美女一区二区三区| 欧美日韩一级二级三级| 日韩美女视频一区二区 | 在线观看一区二区精品视频| 久久网这里都是精品| 亚洲成av人片在www色猫咪| 国产乱国产乱300精品| 在线播放91灌醉迷j高跟美女| 亚洲视频综合在线| 粉嫩一区二区三区性色av| 日韩精品中午字幕| 五月激情六月综合| 日本高清成人免费播放| 亚洲欧美在线视频观看| 国产毛片精品一区| 国产精品久久久久久久岛一牛影视| 亚洲国产日产av| 欧美亚洲禁片免费| 亚洲欧美色一区| 91在线精品一区二区|