rfbregion.h (1879B)
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 11typedef struct _rect { 12 int x1; 13 int y1; 14 int x2; 15 int y2; 16} sraRect; 17 18typedef struct sraRegion sraRegion; 19 20/* -=- Region manipulation functions */ 21 22extern sraRegion *sraRgnCreate(void); 23extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2); 24extern sraRegion *sraRgnCreateRgn(const sraRegion *src); 25 26extern void sraRgnDestroy(sraRegion *rgn); 27extern void sraRgnMakeEmpty(sraRegion *rgn); 28extern rfbBool sraRgnAnd(sraRegion *dst, const sraRegion *src); 29extern void sraRgnOr(sraRegion *dst, const sraRegion *src); 30extern rfbBool sraRgnSubtract(sraRegion *dst, const sraRegion *src); 31 32extern void sraRgnOffset(sraRegion *dst, int dx, int dy); 33 34extern rfbBool sraRgnPopRect(sraRegion *region, sraRect *rect, 35 unsigned long flags); 36 37extern unsigned long sraRgnCountRects(const sraRegion *rgn); 38extern rfbBool sraRgnEmpty(const sraRegion *rgn); 39 40extern sraRegion *sraRgnBBox(const sraRegion *src); 41 42/* -=- rectangle iterator */ 43 44typedef struct sraRectangleIterator { 45 rfbBool reverseX,reverseY; 46 int ptrSize,ptrPos; 47 struct sraSpan** sPtrs; 48} sraRectangleIterator; 49 50extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s); 51extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,rfbBool reverseX,rfbBool reverseY); 52extern rfbBool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r); 53extern void sraRgnReleaseIterator(sraRectangleIterator *i); 54 55void sraRgnPrint(const sraRegion *s); 56 57/* -=- Rectangle clipper (for speed) */ 58 59extern rfbBool sraClipRect(int *x, int *y, int *w, int *h, 60 int cx, int cy, int cw, int ch); 61 62extern rfbBool sraClipRect2(int *x, int *y, int *x2, int *y2, 63 int cx, int cy, int cx2, int cy2); 64 65#endif