LibVNCServer/LibVNCClient
rfbregion.h
Go to the documentation of this file.
1 #ifndef SRAREGION_H
2 #define SRAREGION_H
3 
4 /* -=- SRA - Simple Region Algorithm
5  * A simple rectangular region implementation.
6  * Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin
7  */
8 
9 /* -=- sraRect */
10 
11 typedef struct _rect {
12  int x1;
13  int y1;
14  int x2;
15  int y2;
16 } sraRect;
17 
18 typedef struct sraRegion sraRegion;
19 
20 /* -=- Region manipulation functions */
21 
22 extern sraRegion *sraRgnCreate();
23 extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2);
24 extern sraRegion *sraRgnCreateRgn(const sraRegion *src);
25 
26 extern void sraRgnDestroy(sraRegion *rgn);
27 extern void sraRgnMakeEmpty(sraRegion *rgn);
28 extern rfbBool sraRgnAnd(sraRegion *dst, const sraRegion *src);
29 extern void sraRgnOr(sraRegion *dst, const sraRegion *src);
30 extern rfbBool sraRgnSubtract(sraRegion *dst, const sraRegion *src);
31 
32 extern void sraRgnOffset(sraRegion *dst, int dx, int dy);
33 
34 extern rfbBool sraRgnPopRect(sraRegion *region, sraRect *rect,
35  unsigned long flags);
36 
37 extern unsigned long sraRgnCountRects(const sraRegion *rgn);
38 extern rfbBool sraRgnEmpty(const sraRegion *rgn);
39 
40 extern sraRegion *sraRgnBBox(const sraRegion *src);
41 
42 /* -=- rectangle iterator */
43 
44 typedef struct sraRectangleIterator {
45  rfbBool reverseX,reverseY;
46  int ptrSize,ptrPos;
47  struct sraSpan** sPtrs;
49 
54 
55 void sraRgnPrint(const sraRegion *s);
56 
57 /* -=- Rectangle clipper (for speed) */
58 
59 extern rfbBool sraClipRect(int *x, int *y, int *w, int *h,
60  int cx, int cy, int cw, int ch);
61 
62 extern rfbBool sraClipRect2(int *x, int *y, int *x2, int *y2,
63  int cx, int cy, int cx2, int cy2);
64 
65 #endif
sraRegion * sraRgnCreate()
Definition: rfbregion.c:515
int x1
Definition: rfbregion.h:12
int x
Definition: SDLvncviewer.c:34
sraRegion * sraRgnCreateRect(int x1, int y1, int x2, int y2)
Definition: rfbregion.c:520
sraRegion * sraRgnCreateRgn(const sraRegion *src)
Definition: rfbregion.c:540
int8_t rfbBool
Definition: rfbproto.h:108
unsigned long sraRgnCountRects(const sraRegion *rgn)
Definition: rfbregion.c:676
sraRectangleIterator * sraRgnGetReverseIterator(sraRegion *s, rfbBool reverseX, rfbBool reverseY)
Definition: rfbregion.c:715
int x2
Definition: rfbregion.h:14
rfbBool sraRgnIteratorNext(sraRectangleIterator *i, sraRect *r)
Definition: rfbregion.c:741
void sraRgnPrint(const sraRegion *s)
Definition: rfbregion.c:788
void sraRgnMakeEmpty(sraRegion *rgn)
Definition: rfbregion.c:550
int y2
Definition: rfbregion.h:15
int y1
Definition: rfbregion.h:13
int y
Definition: SDLvncviewer.c:34
rfbBool sraRgnPopRect(sraRegion *region, sraRect *rect, unsigned long flags)
Definition: rfbregion.c:624
rfbBool sraClipRect(int *x, int *y, int *w, int *h, int cx, int cy, int cw, int ch)
Definition: rfbregion.c:793
void sraRgnReleaseIterator(sraRectangleIterator *i)
Definition: rfbregion.c:781
rfbBool sraRgnSubtract(sraRegion *dst, const sraRegion *src)
Definition: rfbregion.c:567
void sraRgnDestroy(sraRegion *rgn)
Definition: rfbregion.c:545
struct sraRegion sraRegion
Definition: rfbregion.h:18
rfbBool sraRgnAnd(sraRegion *dst, const sraRegion *src)
Definition: rfbregion.c:557
void sraRgnOffset(sraRegion *dst, int dx, int dy)
Definition: rfbregion.c:572
sraRegion * sraRgnBBox(const sraRegion *src)
Definition: rfbregion.c:591
void sraRgnOr(sraRegion *dst, const sraRegion *src)
Definition: rfbregion.c:562
rfbBool sraClipRect2(int *x, int *y, int *x2, int *y2, int cx, int cy, int cx2, int cy2)
Definition: rfbregion.c:813
rfbBool sraRgnEmpty(const sraRegion *rgn)
Definition: rfbregion.c:682
struct sraSpan ** sPtrs
Definition: rfbregion.h:47
sraRectangleIterator * sraRgnGetIterator(sraRegion *s)
Definition: rfbregion.c:687