draw.h 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. #ifndef _PLAN9_SOURCE
  10. This header file is an extension to ANSI/POSIX
  11. #endif
  12. #ifndef __DRAW_H_
  13. #define __DRAW_H_
  14. #pragma src "/sys/src/ape/lib/draw"
  15. #pragma lib "/$M/lib/ape/libdraw.a"
  16. #include <u.h>
  17. #include <fmt.h>
  18. #include <qlock.h>
  19. typedef struct Cachefont Cachefont;
  20. typedef struct Cacheinfo Cacheinfo;
  21. typedef struct Cachesubf Cachesubf;
  22. typedef struct Display Display;
  23. typedef struct Font Font;
  24. typedef struct Fontchar Fontchar;
  25. typedef struct Image Image;
  26. typedef struct Mouse Mouse;
  27. typedef struct Point Point;
  28. typedef struct Rectangle Rectangle;
  29. typedef struct RGB RGB;
  30. typedef struct Screen Screen;
  31. typedef struct Subfont Subfont;
  32. #pragma varargck type "R" Rectangle
  33. #pragma varargck type "P" Point
  34. extern int Rfmt(Fmt*);
  35. extern int Pfmt(Fmt*);
  36. enum
  37. {
  38. DOpaque = 0xFFFFFFFF,
  39. DTransparent = 0x00000000, /* only useful for allocimage, memfillcolor */
  40. DBlack = 0x000000FF,
  41. DWhite = 0xFFFFFFFF,
  42. DRed = 0xFF0000FF,
  43. DGreen = 0x00FF00FF,
  44. DBlue = 0x0000FFFF,
  45. DCyan = 0x00FFFFFF,
  46. DMagenta = 0xFF00FFFF,
  47. DYellow = 0xFFFF00FF,
  48. DPaleyellow = 0xFFFFAAFF,
  49. DDarkyellow = 0xEEEE9EFF,
  50. DDarkgreen = 0x448844FF,
  51. DPalegreen = 0xAAFFAAFF,
  52. DMedgreen = 0x88CC88FF,
  53. DDarkblue = 0x000055FF,
  54. DPalebluegreen= 0xAAFFFFFF,
  55. DPaleblue = 0x0000BBFF,
  56. DBluegreen = 0x008888FF,
  57. DGreygreen = 0x55AAAAFF,
  58. DPalegreygreen = 0x9EEEEEFF,
  59. DYellowgreen = 0x99994CFF,
  60. DMedblue = 0x000099FF,
  61. DGreyblue = 0x005DBBFF,
  62. DPalegreyblue = 0x4993DDFF,
  63. DPurpleblue = 0x8888CCFF,
  64. DNotacolor = 0xFFFFFF00,
  65. DNofill = DNotacolor,
  66. };
  67. enum
  68. {
  69. Displaybufsize = 8000,
  70. ICOSSCALE = 1024,
  71. Borderwidth = 4,
  72. };
  73. enum
  74. {
  75. /* refresh methods */
  76. Refbackup = 0,
  77. Refnone = 1,
  78. Refmesg = 2
  79. };
  80. #define NOREFRESH ((void*)-1)
  81. enum
  82. {
  83. /* line ends */
  84. Endsquare = 0,
  85. Enddisc = 1,
  86. Endarrow = 2,
  87. Endmask = 0x1F
  88. };
  89. #define ARROW(a, b, c) (Endarrow|((a)<<5)|((b)<<14)|((c)<<23))
  90. typedef enum
  91. {
  92. /* Porter-Duff compositing operators */
  93. Clear = 0,
  94. SinD = 8,
  95. DinS = 4,
  96. SoutD = 2,
  97. DoutS = 1,
  98. S = SinD|SoutD,
  99. SoverD = SinD|SoutD|DoutS,
  100. SatopD = SinD|DoutS,
  101. SxorD = SoutD|DoutS,
  102. D = DinS|DoutS,
  103. DoverS = DinS|DoutS|SoutD,
  104. DatopS = DinS|SoutD,
  105. DxorS = DoutS|SoutD, /* == SxorD */
  106. Ncomp = 12,
  107. } Drawop;
  108. /*
  109. * image channel descriptors
  110. */
  111. enum {
  112. CRed = 0,
  113. CGreen,
  114. CBlue,
  115. CGrey,
  116. CAlpha,
  117. CMap,
  118. CIgnore,
  119. NChan,
  120. };
  121. #define __DC(type, nbits) ((((type)&15)<<4)|((nbits)&15))
  122. #define CHAN1(a,b) __DC(a,b)
  123. #define CHAN2(a,b,c,d) (CHAN1((a),(b))<<8|__DC((c),(d)))
  124. #define CHAN3(a,b,c,d,e,f) (CHAN2((a),(b),(c),(d))<<8|__DC((e),(f)))
  125. #define CHAN4(a,b,c,d,e,f,g,h) (CHAN3((a),(b),(c),(d),(e),(f))<<8|__DC((g),(h)))
  126. #define NBITS(c) ((c)&15)
  127. #define TYPE(c) (((c)>>4)&15)
  128. enum {
  129. GREY1 = CHAN1(CGrey, 1),
  130. GREY2 = CHAN1(CGrey, 2),
  131. GREY4 = CHAN1(CGrey, 4),
  132. GREY8 = CHAN1(CGrey, 8),
  133. CMAP8 = CHAN1(CMap, 8),
  134. RGB15 = CHAN4(CIgnore, 1, CRed, 5, CGreen, 5, CBlue, 5),
  135. RGB16 = CHAN3(CRed, 5, CGreen, 6, CBlue, 5),
  136. RGB24 = CHAN3(CRed, 8, CGreen, 8, CBlue, 8),
  137. RGBA32 = CHAN4(CRed, 8, CGreen, 8, CBlue, 8, CAlpha, 8),
  138. ARGB32 = CHAN4(CAlpha, 8, CRed, 8, CGreen, 8, CBlue, 8), /* stupid VGAs */
  139. XRGB32 = CHAN4(CIgnore, 8, CRed, 8, CGreen, 8, CBlue, 8),
  140. BGR24 = CHAN3(CBlue, 8, CGreen, 8, CRed, 8),
  141. ABGR32 = CHAN4(CAlpha, 8, CBlue, 8, CGreen, 8, CRed, 8),
  142. XBGR32 = CHAN4(CIgnore, 8, CBlue, 8, CGreen, 8, CRed, 8),
  143. };
  144. extern char* chantostr(char*, uint32_t);
  145. extern uint32_t strtochan(char*);
  146. extern int chantodepth(uint32_t);
  147. struct Point
  148. {
  149. int x;
  150. int y;
  151. };
  152. struct Rectangle
  153. {
  154. Point min;
  155. Point max;
  156. };
  157. typedef void (*Reffn)(Image*, Rectangle, void*);
  158. struct Screen
  159. {
  160. Display *display; /* display holding data */
  161. int id; /* id of system-held Screen */
  162. Image *image; /* unused; for reference only */
  163. Image *fill; /* color to paint behind windows */
  164. };
  165. struct Display
  166. {
  167. QLock qlock;
  168. int locking; /*program is using lockdisplay */
  169. int dirno;
  170. int fd;
  171. int reffd;
  172. int ctlfd;
  173. int imageid;
  174. int local;
  175. void (*error)(Display*, char*);
  176. char *devdir;
  177. char *windir;
  178. char oldlabel[64];
  179. uint32_t dataqid;
  180. Image *white;
  181. Image *black;
  182. Image *opaque;
  183. Image *transparent;
  184. Image *image;
  185. uint8_t *buf;
  186. int bufsize;
  187. uint8_t *bufp;
  188. Font *defaultfont;
  189. Subfont *defaultsubfont;
  190. Image *windows;
  191. Image *screenimage;
  192. int _isnewdisplay;
  193. };
  194. struct Image
  195. {
  196. Display *display; /* display holding data */
  197. int id; /* id of system-held Image */
  198. Rectangle r; /* rectangle in data area, local coords */
  199. Rectangle clipr; /* clipping region */
  200. int depth; /* number of bits per pixel */
  201. uint32_t chan;
  202. int repl; /* flag: data replicates to tile clipr */
  203. Screen *screen; /* 0 if not a window */
  204. Image *next; /* next in list of windows */
  205. };
  206. struct RGB
  207. {
  208. uint32_t red;
  209. uint32_t green;
  210. uint32_t blue;
  211. };
  212. /*
  213. * Subfonts
  214. *
  215. * given char c, Subfont *f, Fontchar *i, and Point p, one says
  216. * i = f->info+c;
  217. * draw(b, Rect(p.x+i->left, p.y+i->top,
  218. * p.x+i->left+((i+1)->x-i->x), p.y+i->bottom),
  219. * color, f->bits, Pt(i->x, i->top));
  220. * p.x += i->width;
  221. * to draw characters in the specified color (itself an Image) in Image b.
  222. */
  223. struct Fontchar
  224. {
  225. int x; /* left edge of bits */
  226. uint8_t top; /* first non-zero scan-line */
  227. uint8_t bottom; /* last non-zero scan-line + 1 */
  228. char left; /* offset of baseline */
  229. uint8_t width; /* width of baseline */
  230. };
  231. struct Subfont
  232. {
  233. char *name;
  234. int16_t n; /* number of chars in font */
  235. uint8_t height; /* height of image */
  236. char ascent; /* top of image to baseline */
  237. Fontchar *info; /* n+1 character descriptors */
  238. Image *bits; /* of font */
  239. int ref;
  240. };
  241. enum
  242. {
  243. /* starting values */
  244. LOG2NFCACHE = 6,
  245. NFCACHE = (1<<LOG2NFCACHE), /* #chars cached */
  246. NFLOOK = 5, /* #chars to scan in cache */
  247. NFSUBF = 2, /* #subfonts to cache */
  248. /* max value */
  249. MAXFCACHE = 1024+NFLOOK, /* upper limit */
  250. MAXSUBF = 50, /* generous upper limit */
  251. /* deltas */
  252. DSUBF = 4,
  253. /* expiry ages */
  254. SUBFAGE = 10000,
  255. CACHEAGE = 10000
  256. };
  257. struct Cachefont
  258. {
  259. Rune min; /* lowest rune value to be taken from subfont */
  260. Rune max; /* highest rune value+1 to be taken from subfont */
  261. int offset; /* position in subfont of character at min */
  262. char *name; /* stored in font */
  263. char *subfontname; /* to access subfont */
  264. };
  265. struct Cacheinfo
  266. {
  267. uint16_t x; /* left edge of bits */
  268. uint8_t width; /* width of baseline */
  269. schar left; /* offset of baseline */
  270. Rune value; /* value of character at this slot in cache */
  271. uint16_t age;
  272. };
  273. struct Cachesubf
  274. {
  275. uint32_t age; /* for replacement */
  276. Cachefont *cf; /* font info that owns us */
  277. Subfont *f; /* attached subfont */
  278. };
  279. struct Font
  280. {
  281. char *name;
  282. Display *display;
  283. int16_t height; /* max height of image, interline spacing */
  284. int16_t ascent; /* top of image to baseline */
  285. int16_t width; /* widest so far; used in caching only */
  286. int16_t nsub; /* number of subfonts */
  287. uint32_t age; /* increasing counter; used for LRU */
  288. int maxdepth; /* maximum depth of all loaded subfonts */
  289. int ncache; /* size of cache */
  290. int nsubf; /* size of subfont list */
  291. Cacheinfo *cache;
  292. Cachesubf *subf;
  293. Cachefont **sub; /* as read from file */
  294. Image *cacheimage;
  295. };
  296. #define Dx(r) ((r).max.x-(r).min.x)
  297. #define Dy(r) ((r).max.y-(r).min.y)
  298. #ifdef __cplusplus
  299. extern "C" {
  300. #endif
  301. /*
  302. * Image management
  303. */
  304. extern Image* _allocimage(Image*, Display*, Rectangle, uint32_t, int,
  305. uint32_t, int, int);
  306. extern Image* allocimage(Display*, Rectangle, uint32_t, int,
  307. uint32_t);
  308. extern uint8_t* bufimage(Display*, int);
  309. extern int bytesperline(Rectangle, int);
  310. extern void closedisplay(Display*);
  311. extern void drawerror(Display*, char*);
  312. extern int flushimage(Display*, int);
  313. extern int freeimage(Image*);
  314. extern int _freeimage1(Image*);
  315. extern int geninitdraw(char*, void(*)(Display*, char*), char*,
  316. char*, char*, int);
  317. extern int initdraw(void(*)(Display*, char*), char*, char*);
  318. extern int newwindow(char*);
  319. extern Display* initdisplay(char*, char*,
  320. void(*)(Display*, char*));
  321. extern int loadimage(Image*, Rectangle, uint8_t*, int);
  322. extern int cloadimage(Image*, Rectangle, uint8_t*, int);
  323. extern int getwindow(Display*, int);
  324. extern int gengetwindow(Display*, char*, Image**, Screen**, int);
  325. extern Image* readimage(Display*, int, int);
  326. extern Image* creadimage(Display*, int, int);
  327. extern int unloadimage(Image*, Rectangle, uint8_t*, int);
  328. extern int wordsperline(Rectangle, int);
  329. extern int writeimage(int, Image*, int);
  330. extern Image* namedimage(Display*, char*);
  331. extern int nameimage(Image*, char*, int);
  332. extern Image* allocimagemix(Display*, uint32_t, uint32_t);
  333. /*
  334. * Colors
  335. */
  336. extern void readcolmap(Display*, RGB*);
  337. extern void writecolmap(Display*, RGB*);
  338. extern uint32_t setalpha(uint32_t, uint8_t);
  339. /*
  340. * Windows
  341. */
  342. extern Screen* allocscreen(Image*, Image*, int);
  343. extern Image* _allocwindow(Image*, Screen*, Rectangle, int, uint32_t);
  344. extern Image* allocwindow(Screen*, Rectangle, int, uint32_t);
  345. extern void bottomnwindows(Image**, int);
  346. extern void bottomwindow(Image*);
  347. extern int freescreen(Screen*);
  348. extern Screen* publicscreen(Display*, int, uint32_t);
  349. extern void topnwindows(Image**, int);
  350. extern void topwindow(Image*);
  351. extern int originwindow(Image*, Point, Point);
  352. /*
  353. * Geometry
  354. */
  355. extern Point Pt(int, int);
  356. extern Rectangle Rect(int, int, int, int);
  357. extern Rectangle Rpt(Point, Point);
  358. extern Point addpt(Point, Point);
  359. extern Point subpt(Point, Point);
  360. extern Point divpt(Point, int);
  361. extern Point mulpt(Point, int);
  362. extern int eqpt(Point, Point);
  363. extern int eqrect(Rectangle, Rectangle);
  364. extern Rectangle insetrect(Rectangle, int);
  365. extern Rectangle rectaddpt(Rectangle, Point);
  366. extern Rectangle rectsubpt(Rectangle, Point);
  367. extern Rectangle canonrect(Rectangle);
  368. extern int rectXrect(Rectangle, Rectangle);
  369. extern int rectinrect(Rectangle, Rectangle);
  370. extern void combinerect(Rectangle*, Rectangle);
  371. extern int rectclip(Rectangle*, Rectangle);
  372. extern int ptinrect(Point, Rectangle);
  373. extern void replclipr(Image*, int, Rectangle);
  374. extern int drawreplxy(int, int, int); /* used to be drawsetxy */
  375. extern Point drawrepl(Rectangle, Point);
  376. extern int rgb2cmap(int, int, int);
  377. extern int cmap2rgb(int);
  378. extern int cmap2rgba(int);
  379. extern void icossin(int, int*, int*);
  380. extern void icossin2(int, int, int*, int*);
  381. /*
  382. * Graphics
  383. */
  384. extern void draw(Image*, Rectangle, Image*, Image*, Point);
  385. extern void drawop(Image*, Rectangle, Image*, Image*, Point, Drawop);
  386. extern void gendraw(Image*, Rectangle, Image*, Point, Image*, Point);
  387. extern void gendrawop(Image*, Rectangle, Image*, Point, Image*, Point, Drawop);
  388. extern void line(Image*, Point, Point, int, int, int, Image*, Point);
  389. extern void lineop(Image*, Point, Point, int, int, int, Image*, Point, Drawop);
  390. extern void poly(Image*, Point*, int, int, int, int, Image*, Point);
  391. extern void polyop(Image*, Point*, int, int, int, int, Image*, Point, Drawop);
  392. extern void fillpoly(Image*, Point*, int, int, Image*, Point);
  393. extern void fillpolyop(Image*, Point*, int, int, Image*, Point, Drawop);
  394. extern Point string(Image*, Point, Image*, Point, Font*, char*);
  395. extern Point stringop(Image*, Point, Image*, Point, Font*, char*,
  396. Drawop);
  397. extern Point stringn(Image*, Point, Image*, Point, Font*, char*,
  398. int);
  399. extern Point stringnop(Image*, Point, Image*, Point, Font*, char*,
  400. int, Drawop);
  401. extern Point runestring(Image*, Point, Image*, Point, Font*, Rune*);
  402. extern Point runestringop(Image*, Point, Image*, Point, Font*, Rune*, Drawop);
  403. extern Point runestringn(Image*, Point, Image*, Point, Font*, Rune*, int);
  404. extern Point runestringnop(Image*, Point, Image*, Point, Font*, Rune*, int, Drawop);
  405. extern Point stringbg(Image*, Point, Image*, Point, Font*, char*,
  406. Image*, Point);
  407. extern Point stringbgop(Image*, Point, Image*, Point, Font*, char*,
  408. Image*, Point, Drawop);
  409. extern Point stringnbg(Image*, Point, Image*, Point, Font*, char*,
  410. int, Image*, Point);
  411. extern Point stringnbgop(Image*, Point, Image*, Point, Font*, char*,
  412. int, Image*, Point, Drawop);
  413. extern Point runestringbg(Image*, Point, Image*, Point, Font*, Rune*, Image*, Point);
  414. extern Point runestringbgop(Image*, Point, Image*, Point, Font*, Rune*, Image*, Point, Drawop);
  415. extern Point runestringnbg(Image*, Point, Image*, Point, Font*, Rune*, int, Image*, Point);
  416. extern Point runestringnbgop(Image*, Point, Image*, Point, Font*, Rune*, int, Image*, Point, Drawop);
  417. extern Point _string(Image*, Point, Image*, Point, Font*, char*,
  418. Rune*, int, Rectangle, Image*, Point, Drawop);
  419. extern Point stringsubfont(Image*, Point, Image*, Subfont*, char*);
  420. extern int bezier(Image*, Point, Point, Point, Point, int, int, int, Image*, Point);
  421. extern int bezierop(Image*, Point, Point, Point, Point, int, int, int, Image*, Point, Drawop);
  422. extern int bezspline(Image*, Point*, int, int, int, int, Image*, Point);
  423. extern int bezsplineop(Image*, Point*, int, int, int, int, Image*, Point, Drawop);
  424. extern int bezsplinepts(Point*, int, Point**);
  425. extern int fillbezier(Image*, Point, Point, Point, Point, int, Image*, Point);
  426. extern int fillbezierop(Image*, Point, Point, Point, Point, int, Image*, Point, Drawop);
  427. extern int fillbezspline(Image*, Point*, int, int, Image*, Point);
  428. extern int fillbezsplineop(Image*, Point*, int, int, Image*, Point, Drawop);
  429. extern void ellipse(Image*, Point, int, int, int, Image*, Point);
  430. extern void ellipseop(Image*, Point, int, int, int, Image*, Point, Drawop);
  431. extern void fillellipse(Image*, Point, int, int, Image*, Point);
  432. extern void fillellipseop(Image*, Point, int, int, Image*, Point, Drawop);
  433. extern void arc(Image*, Point, int, int, int, Image*, Point, int, int);
  434. extern void arcop(Image*, Point, int, int, int, Image*, Point, int, int, Drawop);
  435. extern void fillarc(Image*, Point, int, int, Image*, Point, int, int);
  436. extern void fillarcop(Image*, Point, int, int, Image*, Point, int, int, Drawop);
  437. extern void border(Image*, Rectangle, int, Image*, Point);
  438. extern void borderop(Image*, Rectangle, int, Image*, Point, Drawop);
  439. /*
  440. * Font management
  441. */
  442. extern Font* openfont(Display*, char*);
  443. extern Font* buildfont(Display*, char*, char*);
  444. extern void freefont(Font*);
  445. extern Font* mkfont(Subfont*, Rune);
  446. extern int cachechars(Font*, char**, Rune**, uint16_t*, int,
  447. int*,
  448. char**);
  449. extern void agefont(Font*);
  450. extern Subfont* allocsubfont(char*, int, int, int, Fontchar*,
  451. Image*);
  452. extern Subfont* lookupsubfont(Display*, char*);
  453. extern void installsubfont(char*, Subfont*);
  454. extern void uninstallsubfont(Subfont*);
  455. extern void freesubfont(Subfont*);
  456. extern Subfont* readsubfont(Display*, char*, int, int);
  457. extern Subfont* readsubfonti(Display*, char*, int, Image*, int);
  458. extern int writesubfont(int, Subfont*);
  459. extern void _unpackinfo(Fontchar*, uint8_t*, int);
  460. extern Point stringsize(Font*, char*);
  461. extern int stringwidth(Font*, char*);
  462. extern int stringnwidth(Font*, char*, int);
  463. extern Point runestringsize(Font*, Rune*);
  464. extern int runestringwidth(Font*, Rune*);
  465. extern int runestringnwidth(Font*, Rune*, int);
  466. extern Point strsubfontwidth(Subfont*, char*);
  467. extern int loadchar(Font*, Rune, Cacheinfo*, int, int, char**);
  468. extern char* subfontname(char*, char*, int);
  469. extern Subfont* _getsubfont(Display*, char*);
  470. extern Subfont* getdefont(Display*);
  471. extern void lockdisplay(Display*);
  472. extern void unlockdisplay(Display*);
  473. extern int drawlsetrefresh(uint32_t, int, void*, void*);
  474. /*
  475. * Predefined
  476. */
  477. extern uint8_t defontdata[];
  478. extern int sizeofdefont;
  479. extern Point ZP;
  480. extern Rectangle ZR;
  481. /*
  482. * Set up by initdraw()
  483. */
  484. extern Display *display;
  485. extern Font *font;
  486. extern Image *screen;
  487. extern Screen *_screen;
  488. extern int _cursorfd;
  489. extern int _drawdebug; /* set to 1 to see errors from flushimage */
  490. extern void _setdrawop(Display*, Drawop);
  491. #define BGSHORT(p) (((p)[0]<<0) | ((p)[1]<<8))
  492. #define BGLONG(p) ((BGSHORT(p)<<0) | (BGSHORT(p+2)<<16))
  493. #define BPSHORT(p, v) ((p)[0]=(v), (p)[1]=((v)>>8))
  494. #define BPLONG(p, v) (BPSHORT(p, (v)), BPSHORT(p+2, (v)>>16))
  495. /*
  496. * Compressed image file parameters and helper routines
  497. */
  498. #define NMATCH 3 /* shortest match possible */
  499. #define NRUN (NMATCH+31) /* longest match possible */
  500. #define NMEM 1024 /* window size */
  501. #define NDUMP 128 /* maximum length of dump */
  502. #define NCBLOCK 6000 /* size of compressed blocks */
  503. extern void _twiddlecompressed(uint8_t*, int);
  504. extern int _compblocksize(Rectangle, int);
  505. /* XXX backwards helps; should go */
  506. extern uint32_t drawld2chan[];
  507. extern void drawsetdebug(int);
  508. #ifdef __cplusplus
  509. }
  510. #endif
  511. #endif