parent
fde8958dc5
commit
598c460ceb
File diff suppressed because it is too large
Load Diff
@ -1,60 +1,60 @@
|
|||||||
#ifndef SRAREGION_H
|
#ifndef SRAREGION_H
|
||||||
#define SRAREGION_H
|
#define SRAREGION_H
|
||||||
|
|
||||||
/* -=- SRA - Simple Region Algorithm
|
/* -=- SRA - Simple Region Algorithm
|
||||||
* A simple rectangular region implementation.
|
* A simple rectangular region implementation.
|
||||||
* Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin
|
* Copyright (c) 2001 James "Wez" Weatherall, Johannes E. Schindelin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* -=- sraRect */
|
/* -=- sraRect */
|
||||||
|
|
||||||
typedef struct _rect {
|
typedef struct _rect {
|
||||||
int x1;
|
int x1;
|
||||||
int y1;
|
int y1;
|
||||||
int x2;
|
int x2;
|
||||||
int y2;
|
int y2;
|
||||||
} sraRect;
|
} sraRect;
|
||||||
|
|
||||||
typedef struct sraRegion sraRegion;
|
typedef struct sraRegion sraRegion;
|
||||||
|
|
||||||
/* -=- Region manipulation functions */
|
/* -=- Region manipulation functions */
|
||||||
|
|
||||||
extern sraRegion *sraRgnCreate();
|
extern sraRegion *sraRgnCreate();
|
||||||
extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2);
|
extern sraRegion *sraRgnCreateRect(int x1, int y1, int x2, int y2);
|
||||||
extern sraRegion *sraRgnCreateRgn(const sraRegion *src);
|
extern sraRegion *sraRgnCreateRgn(const sraRegion *src);
|
||||||
|
|
||||||
extern void sraRgnDestroy(sraRegion *rgn);
|
extern void sraRgnDestroy(sraRegion *rgn);
|
||||||
extern void sraRgnMakeEmpty(sraRegion *rgn);
|
extern void sraRgnMakeEmpty(sraRegion *rgn);
|
||||||
extern Bool sraRgnAnd(sraRegion *dst, const sraRegion *src);
|
extern Bool sraRgnAnd(sraRegion *dst, const sraRegion *src);
|
||||||
extern void sraRgnOr(sraRegion *dst, const sraRegion *src);
|
extern void sraRgnOr(sraRegion *dst, const sraRegion *src);
|
||||||
extern Bool sraRgnSubtract(sraRegion *dst, const sraRegion *src);
|
extern Bool sraRgnSubtract(sraRegion *dst, const sraRegion *src);
|
||||||
|
|
||||||
extern void sraRgnOffset(sraRegion *dst, int dx, int dy);
|
extern void sraRgnOffset(sraRegion *dst, int dx, int dy);
|
||||||
|
|
||||||
extern Bool sraRgnPopRect(sraRegion *region, sraRect *rect,
|
extern Bool sraRgnPopRect(sraRegion *region, sraRect *rect,
|
||||||
unsigned long flags);
|
unsigned long flags);
|
||||||
|
|
||||||
extern unsigned long sraRgnCountRects(const sraRegion *rgn);
|
extern unsigned long sraRgnCountRects(const sraRegion *rgn);
|
||||||
extern Bool sraRgnEmpty(const sraRegion *rgn);
|
extern Bool sraRgnEmpty(const sraRegion *rgn);
|
||||||
|
|
||||||
/* -=- rectangle iterator */
|
/* -=- rectangle iterator */
|
||||||
|
|
||||||
typedef struct sraRectangleIterator {
|
typedef struct sraRectangleIterator {
|
||||||
Bool reverseX,reverseY;
|
Bool reverseX,reverseY;
|
||||||
int ptrSize,ptrPos;
|
int ptrSize,ptrPos;
|
||||||
struct sraSpan** sPtrs;
|
struct sraSpan** sPtrs;
|
||||||
} sraRectangleIterator;
|
} sraRectangleIterator;
|
||||||
|
|
||||||
extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s);
|
extern sraRectangleIterator *sraRgnGetIterator(sraRegion *s);
|
||||||
extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,Bool reverseX,Bool reverseY);
|
extern sraRectangleIterator *sraRgnGetReverseIterator(sraRegion *s,Bool reverseX,Bool reverseY);
|
||||||
extern Bool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r);
|
extern Bool sraRgnIteratorNext(sraRectangleIterator *i,sraRect *r);
|
||||||
extern void sraRgnReleaseIterator(sraRectangleIterator *i);
|
extern void sraRgnReleaseIterator(sraRectangleIterator *i);
|
||||||
|
|
||||||
void sraRgnPrint(const sraRegion *s);
|
void sraRgnPrint(const sraRegion *s);
|
||||||
|
|
||||||
/* -=- Rectangle clipper (for speed) */
|
/* -=- Rectangle clipper (for speed) */
|
||||||
|
|
||||||
extern Bool sraClipRect(int *x, int *y, int *w, int *h,
|
extern Bool sraClipRect(int *x, int *y, int *w, int *h,
|
||||||
int cx, int cy, int cw, int ch);
|
int cx, int cy, int cw, int ch);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in new issue