sdpygfx: cosmetix
[iv.d.git] / cmdcon / gl.d
blob58432d535bbde7355c8e1f7c7b33628f0b5f218b
1 /* coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
2 * Understanding is not required. Only obedience.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, version 3 of the License ONLY.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 module iv.cmdcon.gl /*is aliced*/;
17 private:
19 import iv.alice;
20 public import iv.cmdcon;
21 import iv.vfs;
22 import iv.strex;
23 import iv.pxclock;
25 static if (__traits(compiles, (){import arsd.simpledisplay;}())) {
26 enum OptCmdConGlHasSdpy = true;
27 import arsd.simpledisplay : UsingSimpledisplayX11;
28 } else {
29 enum OptCmdConGlHasSdpy = false;
30 private enum UsingSimpledisplayX11 = false;
34 // ////////////////////////////////////////////////////////////////////////// //
35 public __gshared bool glconAllowOpenGLRender = true;
36 __gshared uint conScale = 0;
37 __gshared uint scrwdt, scrhgt;
39 public __gshared void delegate () glconOnShow = null;
40 public __gshared void delegate () glconOnHide = null;
43 // ////////////////////////////////////////////////////////////////////////// //
44 // public void glconInit (); -- call in `visibleForTheFirstTime`
45 // public void glconDraw (); -- call in `redrawOpenGlScene` (it tries hard to not modify render modes)
46 // public bool glconKeyEvent (KeyEvent event); -- returns `true` if event was eaten
47 // public bool glconCharEvent (dchar ch); -- returns `true` if event was eaten
49 // public bool conProcessQueue (); (from iv.cmdcon)
50 // call this in your main loop to process all accumulated console commands.
52 // ////////////////////////////////////////////////////////////////////////// //
53 public bool isConsoleVisible () nothrow @trusted @nogc { pragma(inline, true); return rConsoleVisible; } ///
54 public bool isQuitRequested () nothrow @trusted @nogc { pragma(inline, true); import core.atomic; return atomicLoad(vquitRequested); } ///
55 public void setQuitRequested () nothrow @trusted @nogc { pragma(inline, true); import core.atomic; atomicStore(vquitRequested, true); } ///
57 public void glconHide () nothrow @trusted @nogc { if (rConsoleVisible) { rConsoleVisible = false; /*glconCallShowHideHandler();*/ } } ///
58 public void glconShow () nothrow @trusted @nogc { if (!rConsoleVisible) { rConsoleVisible = true; /*glconCallShowHideHandler();*/ } } ///
61 // ////////////////////////////////////////////////////////////////////////// //
62 /// you may call this in char event, but `glconCharEvent()` will do that for you
63 public void glconCharInput (char ch) {
64 if (!ch) return;
65 consoleLock();
66 scope(exit) consoleUnlock();
68 int rchgt = getEffectiveConHeight;
70 if (ch == ConInputChar.PageUp) {
71 int lnx = rchgt/conCharHeight-2;
72 if (lnx < 1) lnx = 1;
73 conskiplines += lnx;
74 conLastChange = 0;
75 return;
78 if (ch == ConInputChar.PageDown) {
79 if (conskiplines > 0) {
80 int lnx = rchgt/conCharHeight-2;
81 if (lnx < 1) lnx = 1;
82 if ((conskiplines -= lnx) < 0) conskiplines = 0;
83 conLastChange = 0;
85 return;
88 if (ch == ConInputChar.LineUp) {
89 ++conskiplines;
90 conLastChange = 0;
91 return;
94 if (ch == ConInputChar.LineDown) {
95 if (conskiplines > 0) {
96 --conskiplines;
97 conLastChange = 0;
99 return;
102 if (ch == ConInputChar.Enter) {
103 if (conskiplines) { conskiplines = 0; conLastChange = 0; }
104 auto s = conInputBuffer;
105 if (s.length > 0) {
106 concmdAdd(s);
107 conInputBufferClear(true); // add to history
108 conLastChange = 0;
110 return;
113 //if (ch == '`' && conInputBuffer.length == 0) { concmd("r_console ona"); return; }
115 auto pcc = conInputLastChange();
116 conAddInputChar(ch);
117 if (pcc != conInputLastChange()) conLastChange = 0;
121 // ////////////////////////////////////////////////////////////////////////// //
122 enum conCharWidth = 10;
123 enum conCharHeight = 10;
125 __gshared char rPromptChar = '>';
126 __gshared float rConAlpha = 0.8;
127 __gshared bool rConsoleVisible = false;
128 __gshared bool rConsoleVisiblePrev = false;
129 __gshared float rConsoleHeight = 0.7;
130 __gshared uint rConTextColor = 0x00ff00; // rgb
131 __gshared uint rConCursorColor = 0xff7f00; // rgb
132 __gshared uint rConInputColor = 0xffff00; // rgb
133 __gshared uint rConPromptColor = 0xffffff; // rgb
134 __gshared uint rConStarColor = 0x3f0000; // rgb
135 shared bool vquitRequested = false;
137 __gshared int conskiplines = 0;
140 // initialize glcmdcon variables and commands, sets screen size and scale
141 // NOT THREAD-SAFE! also, should be called only once.
142 // screen dimensions can be fixed later by calling `glconResize()`.
143 private void initConsole () {
144 enum ascrwdt = 800;
145 enum ascrhgt = 600;
146 enum ascale = 1;
147 if (conScale != 0) assert(0, "cmdcon already initialized");
148 if (ascrwdt < 64 || ascrhgt < 64 || ascrwdt > 4096 || ascrhgt > 4096) assert(0, "invalid cmdcon dimensions");
149 if (ascale < 1 || ascale > 64) assert(0, "invalid cmdcon scale");
150 scrwdt = ascrwdt;
151 scrhgt = ascrhgt;
152 conScale = ascale;
153 conRegVar!rConsoleVisible("r_console", "console visibility"/*, ConVarAttr.Archive*/);
154 conRegVar!rConsoleHeight(0, 1, "r_conheight", "console height", ConVarAttr.Archive);
155 conRegVar!rConTextColor("r_contextcolor", "console log text color, 0xrrggbb", ConVarAttr.Archive, ConVarAttr.Hex);
156 conRegVar!rConCursorColor("r_concursorcolor", "console cursor color, 0xrrggbb", ConVarAttr.Archive, ConVarAttr.Hex);
157 conRegVar!rConInputColor("r_coninputcolor", "console input color, 0xrrggbb", ConVarAttr.Archive, ConVarAttr.Hex);
158 conRegVar!rConPromptColor("r_conpromptcolor", "console prompt color, 0xrrggbb", ConVarAttr.Archive, ConVarAttr.Hex);
159 conRegVar!rConStarColor("r_constarcolor", "console star color, 0xrrggbb", ConVarAttr.Archive, ConVarAttr.Hex);
160 conRegVar!rPromptChar("r_conpromptchar", "console prompt character", ConVarAttr.Archive);
161 conRegVar!rConAlpha("r_conalpha", "console transparency (0 is fully transparent, 1 is opaque)", ConVarAttr.Archive);
162 scrhgt = 0;
163 conRegFunc!({
164 import core.atomic;
165 atomicStore(vquitRequested, true);
166 })("quit", "quit");
169 shared static this () { initConsole(); }
172 // ////////////////////////////////////////////////////////////////////////// //
173 /// initialize OpenGL part of glcmdcon. it is ok to call it with the same dimensions repeatedly.
174 /// NOT THREAD-SAFE!
175 public void glconInit (uint ascrwdt, uint ascrhgt, uint ascale=1) {
176 if (ascrwdt < 64 || ascrhgt < 64 || ascrwdt > 4096 || ascrhgt > 4096) return;
177 if (ascale < 1 || ascale > 64) return;
178 conScale = ascale;
179 if (scrwdt != ascrwdt || scrhgt != ascrhgt || convbuf is null) {
180 scrwdt = ascrwdt;
181 scrhgt = ascrhgt;
182 //conLastChange = 0;
187 // ////////////////////////////////////////////////////////////////////////// //
188 /// call this if window was resized. will return `true` if resize was successfull.
189 /// NOT THREAD-SAFE!
190 /// can be called instead of `glconInit()`. it is ok to call it with the same dimensions repeatedly.
191 public void glconResize (uint ascrwdt, uint ascrhgt, uint ascale=1) {
192 glconInit(ascrwdt, ascrhgt, ascale); // reallocate back buffer and texture
196 // ////////////////////////////////////////////////////////////////////////// //
197 __gshared uint* convbuf = null; // RGBA, malloced
198 __gshared uint convbufTexId = 0;
199 __gshared uint prevScrWdt = 0, prevScrHgt = 0;
200 __gshared bool glconRenderFailed = false;
203 // returns `true` if buffer need to be regenerated
204 private bool glconGenRenderBuffer () {
205 if (glconRenderFailed) return false;
206 if (convbuf is null || prevScrWdt != scrwdt || prevScrHgt != scrhgt) {
207 import core.stdc.stdlib : free, realloc;
208 if (scrhgt == 0) scrhgt = 600;
209 // need new buffer; kill old texture, so it will be recreated
210 if (glconDrawWindow is null && glconAllowOpenGLRender) {
211 if (convbufTexId) { glDeleteTextures(1, &convbufTexId); convbufTexId = 0; }
213 auto nbuf = cast(uint*)realloc(convbuf, scrwdt*scrhgt*4);
214 if (nbuf is null) {
215 if (convbuf !is null) { free(convbuf); convbuf = null; }
216 glconRenderFailed = true;
217 return false;
219 convbuf = nbuf;
220 prevScrWdt = scrwdt;
221 prevScrHgt = scrhgt;
222 convbuf[0..scrwdt*scrhgt] = 0xff000000;
223 return true; // buffer updated
225 return false; // buffer not updated
229 // returns `true` if texture was recreated
230 private bool glconGenTexture () {
231 if (glconRenderFailed || scrhgt == 0) return false;
233 static if (OptCmdConGlHasSdpy) {
234 if (glconDrawWindow !is null) return false;
237 if (convbufTexId != 0) return false;
239 if (!glconAllowOpenGLRender) return false;
241 enum wrapOpt = GL_REPEAT;
242 enum filterOpt = GL_NEAREST; //GL_LINEAR;
243 enum ttype = GL_UNSIGNED_BYTE;
245 glGenTextures(1, &convbufTexId);
246 if (convbufTexId == 0) {
247 import core.stdc.stdlib : free;
248 if (convbuf !is null) { free(convbuf); convbuf = null; }
249 glconRenderFailed = true;
250 return false;
253 GLint gltextbinding;
254 glGetIntegerv(GL_TEXTURE_BINDING_2D, &gltextbinding);
255 scope(exit) glBindTexture(GL_TEXTURE_2D, gltextbinding);
257 glBindTexture(GL_TEXTURE_2D, convbufTexId);
258 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrapOpt);
259 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapOpt);
260 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filterOpt);
261 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filterOpt);
262 //glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
263 //glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
266 GLfloat[4] bclr = 0.0;
267 glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, bclr.ptr);
270 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, nextPOTU32(scrwdt), nextPOTU32(scrhgt), 0, /*GL_RGBA*/GL_BGRA, GL_UNSIGNED_BYTE, null); // this creates texture
271 glTexSubImage2D(GL_TEXTURE_2D, 0, 0/*x*/, 0/*y*/, scrwdt, scrhgt, /*GL_RGBA*/GL_BGRA, GL_UNSIGNED_BYTE, convbuf); // this updates texture
273 //{ import core.stdc.stdio; printf("glconGenTexture: yep\n"); }
274 return true;
278 private void glconCallShowHideHandler () {
279 if (rConsoleVisible != rConsoleVisiblePrev) {
280 rConsoleVisiblePrev = rConsoleVisible;
281 try {
282 if (rConsoleVisible) { if (glconOnShow !is null) glconOnShow(); }
283 else if (!rConsoleVisible) { if (glconOnHide !is null) glconOnHide(); }
284 } catch (Exception) {}
289 // ////////////////////////////////////////////////////////////////////////// //
290 private int getEffectiveConHeight () {
291 if (scrhgt < 1 || rConsoleHeight <= 0) return conCharHeight*3;
292 int rchgt = cast(int)(scrhgt*rConsoleHeight);
293 if (rchgt > scrhgt-conCharHeight*4) rchgt = scrhgt-conCharHeight*4;
294 if (rchgt < conCharHeight*3) rchgt = conCharHeight*3;
295 return rchgt;
299 // ////////////////////////////////////////////////////////////////////////// //
300 /// render console (if it is visible). tries hard to not change OpenGL state.
301 public void glconDraw () {
302 glconCallShowHideHandler();
303 if (!rConsoleVisible || scrhgt == 0) return;
305 consoleLock();
306 scope(exit) consoleUnlock();
308 int rchgt = getEffectiveConHeight;
310 bool regen = glconGenRenderBuffer();
311 if (glconRenderFailed) return; // alas
313 assert(convbuf !is null);
315 auto updatetex = renderConsole(regen);
316 if (glconGenTexture()) updatetex = false;
317 if (glconRenderFailed) return; // alas
319 static if (OptCmdConGlHasSdpy) {
320 if (glconDrawWindow !is null) {
321 static if (UsingSimpledisplayX11) {
322 // ooops. render to backbuffer
323 //{ import core.stdc.stdio; printf("rendering to backbuffer\n"); }
324 if (!glconDrawWindow.closed && scrwdt > 0 && scrhgt > 0 && (!glconDrawDirect || !glconDrawWindow.hidden)) {
325 XImage ximg;
326 //glcon_ximageInitSimple(ximg, scrwdt, scrhgt, convbuf);
327 ximg.width = scrwdt;
328 ximg.height = scrhgt;
329 ximg.xoffset = 0;
330 ximg.format = ImageFormat.ZPixmap;
331 ximg.data = convbuf;
332 ximg.byte_order = 0;
333 ximg.bitmap_unit = 32;
334 ximg.bitmap_bit_order = 0;
335 ximg.bitmap_pad = 8;
336 ximg.depth = 24;
337 ximg.bytes_per_line = 0;
338 ximg.bits_per_pixel = 32; // THIS MATTERS!
339 ximg.red_mask = 0x00ff0000;
340 ximg.green_mask = 0x0000ff00;
341 ximg.blue_mask = 0x000000ff;
342 XInitImage(&ximg);
343 int desty = rchgt-scrhgt;
344 auto dpy = glconDrawWindow.impl.display;
345 Drawable drw = (glconDrawDirect ? cast(Drawable)glconDrawWindow.impl.window : cast(Drawable)glconDrawWindow.impl.buffer);
346 GC gc = XCreateGC(dpy, drw, 0, null);
347 scope(exit) XFreeGC(dpy, gc);
348 XCopyGC(dpy, DefaultGC(dpy, DefaultScreen(dpy)), 0xffffffff, gc);
349 XSetClipMask(dpy, gc, None);
350 XPutImage(dpy, drw, gc, &ximg, 0, 0, 0/*destx*/, desty, scrwdt, scrhgt);
353 return;
357 if (!glconAllowOpenGLRender) return;
358 assert(convbufTexId != 0);
360 GLint glmatmode;
361 GLint gltextbinding;
362 GLint oldprg;
363 GLint oldfbr, oldfbw;
364 GLint[4] glviewport;
365 glGetIntegerv(GL_MATRIX_MODE, &glmatmode);
366 glGetIntegerv(GL_TEXTURE_BINDING_2D, &gltextbinding);
367 glGetIntegerv(GL_VIEWPORT, glviewport.ptr);
368 glGetIntegerv(GL_CURRENT_PROGRAM, &oldprg);
369 glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, &oldfbr);
370 glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &oldfbw);
371 glMatrixMode(GL_PROJECTION); glPushMatrix();
372 glMatrixMode(GL_MODELVIEW); glPushMatrix();
373 glMatrixMode(GL_TEXTURE); glPushMatrix();
374 glMatrixMode(GL_COLOR); glPushMatrix();
375 glPushAttrib(/*GL_ENABLE_BIT|GL_COLOR_BUFFER_BIT|GL_CURRENT_BIT*/GL_ALL_ATTRIB_BITS); // let's play safe
376 // restore on exit
377 scope(exit) {
378 glPopAttrib(/*GL_ENABLE_BIT*/);
379 glMatrixMode(GL_COLOR); glPopMatrix();
380 glMatrixMode(GL_TEXTURE); glPopMatrix();
381 glMatrixMode(GL_MODELVIEW); glPopMatrix();
382 glMatrixMode(GL_PROJECTION); glPopMatrix();
383 glMatrixMode(glmatmode);
384 if (glHasFunc!"glBindFramebufferEXT") glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, oldfbr);
385 if (glHasFunc!"glBindFramebufferEXT") glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, oldfbw);
386 glBindTexture(GL_TEXTURE_2D, gltextbinding);
387 if (glHasFunc!"glUseProgram") glUseProgram(oldprg);
388 glViewport(glviewport.ptr[0], glviewport.ptr[1], glviewport.ptr[2], glviewport.ptr[3]);
391 enum x = 0;
392 int y = 0;
393 int w = scrwdt*conScale;
394 int h = scrhgt*conScale;
396 immutable float gtx1 = cast(float)scrwdt/nextPOTU32(scrwdt);
397 immutable float gty1 = cast(float)scrhgt/nextPOTU32(scrhgt);
399 glBindTexture(GL_TEXTURE_CUBE_MAP, 0);
400 if (glHasFunc!"glBindFramebufferEXT") glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
401 if (glHasFunc!"glUseProgram") glUseProgram(0);
403 glMatrixMode(GL_PROJECTION); // for ortho camera
404 glLoadIdentity();
405 // left, right, bottom, top, near, far
406 //glOrtho(0, wdt, 0, hgt, -1, 1); // bottom-to-top
407 glOrtho(0, w, h, 0, -1, 1); // top-to-bottom
408 glViewport(0, 0, w, h);
409 glMatrixMode(GL_MODELVIEW);
410 glLoadIdentity();
412 glEnable(GL_TEXTURE_2D);
413 glDisable(GL_LIGHTING);
414 glDisable(GL_DITHER);
415 //glDisable(GL_BLEND);
416 glDisable(GL_DEPTH_TEST);
417 glEnable(GL_BLEND);
418 //glBlendFunc(GL_SRC_ALPHA, GL_ONE);
419 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
420 //glDisable(GL_BLEND);
421 glDisable(GL_STENCIL_TEST);
422 glDisable(GL_SCISSOR_TEST);
423 glDisable(GL_CULL_FACE);
424 glDisable(GL_POLYGON_OFFSET_FILL);
425 glDisable(GL_ALPHA_TEST);
426 glDisable(GL_FOG);
427 glDisable(GL_COLOR_LOGIC_OP);
428 glDisable(GL_INDEX_LOGIC_OP);
429 glDisable(GL_POLYGON_SMOOTH);
431 glBindTexture(GL_TEXTURE_2D, convbufTexId);
432 if (updatetex) {
433 //glTextureSubImage2D(convbufTexId, 0, 0/*x*/, 0/*y*/, scrwdt, scrhgt, GL_RGBA, GL_UNSIGNED_BYTE, convbuf);
434 glTexSubImage2D(GL_TEXTURE_2D, 0, 0/*x*/, 0/*y*/, scrwdt, scrhgt, /*GL_RGBA*/GL_BGRA, GL_UNSIGNED_BYTE, convbuf);
435 //{ import core.stdc.stdio; printf("glconDraw: yep (%u)\n", convbufTexId); }
438 int ofs = (scrhgt-rchgt)*conScale;
439 y -= ofs;
440 h -= ofs;
441 float alpha = rConAlpha;
442 if (alpha < 0) alpha = 0; else if (alpha > 1) alpha = 1;
443 glColor4f(1, 1, 1, alpha);
444 //scope(exit) glBindTexture(GL_TEXTURE_2D, 0);
445 glBegin(GL_QUADS);
446 glTexCoord2f(0.0f, 0.0f); glVertex2i(x, y); // top-left
447 glTexCoord2f(gtx1, 0.0f); glVertex2i(w, y); // top-right
448 glTexCoord2f(gtx1, gty1); glVertex2i(w, h); // bottom-right
449 glTexCoord2f(0.0f, gty1); glVertex2i(x, h); // bottom-left
450 glEnd();
451 //glDisable(GL_BLEND);
455 // ////////////////////////////////////////////////////////////////////////// //
456 __gshared int conDrawX, conDrawY;
457 __gshared uint conColor;
460 void vsetPixel (int x, int y, uint c) nothrow @trusted @nogc {
461 pragma(inline, true);
462 if (x >= 0 && y >= 0 && x < scrwdt && y < scrhgt) convbuf[y*scrwdt+x] = c;
466 void drawStar (int x0, int y0, int radius) nothrow @trusted @nogc {
467 if (radius < 32) return;
469 version(none) {
470 static void drawLine(bool lastPoint=true) (int x0, int y0, int x1, int y1) nothrow @trusted @nogc {
471 enum swap(string a, string b) = "{int tmp_="~a~";"~a~"="~b~";"~b~"=tmp_;}";
473 if (x0 == x1 && y0 == y1) {
474 static if (lastPoint) vsetPixel(x0, y0, conColor);
475 return;
478 // clip rectange
479 int wx0 = 0, wy0 = 0, wx1 = scrwdt-1, wy1 = scrhgt-1;
480 // other vars
481 int stx, sty; // "steps" for x and y axes
482 int dsx, dsy; // "lengthes" for x and y axes
483 int dx2, dy2; // "double lengthes" for x and y axes
484 int xd, yd; // current coord
485 int e; // "error" (as in bresenham algo)
486 int rem;
487 int term;
488 int *d0, d1;
489 // horizontal setup
490 if (x0 < x1) {
491 // from left to right
492 if (x0 > wx1 || x1 < wx0) return; // out of screen
493 stx = 1; // going right
494 } else {
495 // from right to left
496 if (x1 > wx1 || x0 < wx0) return; // out of screen
497 stx = -1; // going left
498 x0 = -x0;
499 x1 = -x1;
500 wx0 = -wx0;
501 wx1 = -wx1;
502 mixin(swap!("wx0", "wx1"));
504 // vertical setup
505 if (y0 < y1) {
506 // from top to bottom
507 if (y0 > wy1 || y1 < wy0) return; // out of screen
508 sty = 1; // going down
509 } else {
510 // from bottom to top
511 if (y1 > wy1 || y0 < wy0) return; // out of screen
512 sty = -1; // going up
513 y0 = -y0;
514 y1 = -y1;
515 wy0 = -wy0;
516 wy1 = -wy1;
517 mixin(swap!("wy0", "wy1"));
519 dsx = x1-x0;
520 dsy = y1-y0;
521 if (dsx < dsy) {
522 d0 = &yd;
523 d1 = &xd;
524 mixin(swap!("x0", "y0"));
525 mixin(swap!("x1", "y1"));
526 mixin(swap!("dsx", "dsy"));
527 mixin(swap!("wx0", "wy0"));
528 mixin(swap!("wx1", "wy1"));
529 mixin(swap!("stx", "sty"));
530 } else {
531 d0 = &xd;
532 d1 = &yd;
534 dx2 = 2*dsx;
535 dy2 = 2*dsy;
536 xd = x0;
537 yd = y0;
538 e = 2*dsy-dsx;
539 term = x1;
540 bool xfixed = false;
541 if (y0 < wy0) {
542 // clip at top
543 int temp = dx2*(wy0-y0)-dsx;
544 xd += temp/dy2;
545 rem = temp%dy2;
546 if (xd > wx1) return; // x is moved out of clipping rect, nothing to do
547 if (xd+1 >= wx0) {
548 yd = wy0;
549 e -= rem+dsx;
550 if (rem > 0) { ++xd; e += dy2; }
551 xfixed = true;
554 if (!xfixed && x0 < wx0) {
555 // clip at left
556 int temp = dy2*(wx0-x0);
557 yd += temp/dx2;
558 rem = temp%dx2;
559 if (yd > wy1 || yd == wy1 && rem >= dsx) return;
560 xd = wx0;
561 e += rem;
562 if (rem >= dsx) { ++yd; e -= dx2; }
564 if (y1 > wy1) {
565 // clip at bottom
566 int temp = dx2*(wy1-y0)+dsx;
567 term = x0+temp/dy2;
568 rem = temp%dy2;
569 if (rem == 0) --term;
571 if (term > wx1) term = wx1; // clip at right
572 static if (lastPoint) {
573 // draw last point
574 ++term;
575 } else {
576 if (term == xd) return; // this is the only point, get out of here
578 if (sty == -1) yd = -yd;
579 if (stx == -1) { xd = -xd; term = -term; }
580 dx2 -= dy2;
581 // draw it; `vsetPixel()` can omit checks
582 while (xd != term) {
583 vsetPixel(*d0, *d1, conColor);
584 // done drawing, move coords
585 if (e >= 0) {
586 yd += sty;
587 e -= dx2;
588 } else {
589 e += dy2;
591 xd += stx;
595 static void drawCircle (int cx, int cy, int radius) nothrow @trusted @nogc {
596 static void plot4points() (int cx, int cy, int x, int y) nothrow @trusted @nogc {
597 vsetPixel(cx+x, cy+y, conColor);
598 if (x != 0) vsetPixel(cx-x, cy+y, conColor);
599 if (y != 0) vsetPixel(cx+x, cy-y, conColor);
600 vsetPixel(cx-x, cy-y, conColor);
603 if (radius > 0) {
604 int error = -radius, x = radius, y = 0;
605 if (radius == 1) { vsetPixel(cx, cy, conColor); return; }
606 while (x > y) {
607 plot4points(cx, cy, x, y);
608 plot4points(cx, cy, y, x);
609 error += y*2+1;
610 ++y;
611 if (error >= 0) { --x; error -= x*2; }
613 plot4points(cx, cy, x, y);
617 static auto deg2rad(T : double) (T v) pure nothrow @safe @nogc { pragma(inline, true); import std.math : PI; return v*PI/180.0; }
619 drawCircle(x0, y0, radius);
620 foreach (immutable n; 0..5) {
621 import std.math;
622 auto a0 = deg2rad(360.0/5*n+18);
623 auto a1 = deg2rad(360.0/5*(n+2)+18);
624 drawLine(
625 cast(uint)(x0+cos(a0)*radius), cast(uint)(y0+sin(a0)*radius),
626 cast(uint)(x0+cos(a1)*radius), cast(uint)(y0+sin(a1)*radius),
629 } else {
630 immutable float scale = (radius*2.0f)/ConBaphometDims;
631 //{ import core.stdc.stdio; printf("radius=%d; scale=%g; rr=%g\n", radius, cast(double)scale, cast(double)(512*scale)); }
632 conBaphometRender((int x, int y) @trusted => vsetPixel(x+x0-radius, y+y0-radius, conColor), 0, 0, scale);
637 void conSetColor (uint c) nothrow @trusted @nogc {
638 pragma(inline, true);
639 //conColor = (c&0x00ff00)|((c>>16)&0xff)|((c&0xff)<<16)|0xff000000;
640 conColor = c|0xff000000;
644 void conDrawChar (char ch) nothrow @trusted @nogc {
646 int r = conColor&0xff;
647 int g = (conColor>>8)&0xff;
648 int b = (conColor>>16)&0xff;
650 int r = (conColor>>16)&0xff;
651 int g = (conColor>>8)&0xff;
652 int b = conColor&0xff;
653 immutable int rr = r, gg = g, bb = b;
654 foreach_reverse (immutable y; 0..10) {
655 ushort v = glConFont10.ptr[cast(uint)ch*10+y];
656 //immutable uint cc = (b<<16)|(g<<8)|r|0xff000000;
657 immutable uint cc = (r<<16)|(g<<8)|b|0xff000000;
658 foreach (immutable x; 0..10) {
659 if (v&0x8000) vsetPixel(conDrawX+x, conDrawY+y, cc);
660 v <<= 1;
662 static if (false) {
663 if ((r += 8) > 255) r = 255;
664 if ((g += 8) > 255) g = 255;
665 if ((b += 8) > 255) b = 255;
666 } else {
667 if ((r -= 7) < 0) r = rr;
668 if ((g -= 7) < 0) g = gg;
669 if ((b -= 7) < 0) b = bb;
672 conDrawX += 10;
676 void conRect (int w, int h) nothrow @trusted @nogc {
678 int r = conColor&0xff;
679 int g = (conColor>>8)&0xff;
680 int b = (conColor>>16)&0xff;
682 int r = (conColor>>16)&0xff;
683 int g = (conColor>>8)&0xff;
684 int b = conColor&0xff;
685 foreach_reverse (immutable y; 0..h) {
686 //immutable uint cc = (b<<16)|(g<<8)|r|0xff000000;
687 immutable uint cc = (r<<16)|(g<<8)|b|0xff000000;
688 foreach (immutable x; conDrawX..conDrawX+w) vsetPixel(x, conDrawY+y, cc);
689 if ((r -= 8) < 0) r = 0;
690 if ((g -= 8) < 0) g = 0;
691 if ((b -= 8) < 0) b = 0;
696 // ////////////////////////////////////////////////////////////////////////// //
697 __gshared uint conLastChange = 0;
698 __gshared uint conLastIBChange = 0;
699 __gshared int prevCurX = -1;
700 __gshared int prevIXOfs = 0;
703 bool renderConsole (bool forced) nothrow @trusted @nogc {
704 if (!forced && (conLastChange == cbufLastChange && conLastIBChange == conInputLastChange) || scrhgt == 0) return false;
706 enum XOfs = 0;
707 immutable sw = scrwdt, sh = scrhgt;
708 int skipLines = conskiplines;
709 convbuf[0..sw*sh] = 0xff000000;
710 conLastChange = cbufLastChange;
711 conLastIBChange = conInputLastChange;
712 if (sw >= 128 && sh >= 128) {
713 import std.algorithm : min;
714 conSetColor(rConStarColor);
715 int radius = min(sw, sh)/3;
716 //{ import core.stdc.stdio; printf("sw=%d; sh=%d; radius=%d\n", sw, sh, radius); }
717 drawStar(sw/2, /*sh/2*/sh-radius-16, radius);
720 auto concli = conInputBuffer;
721 int conclilen = cast(int)concli.length;
722 int concurx = conInputBufferCurX();
724 int y = sh-conCharHeight;
725 // draw command line
727 conDrawX = XOfs;
728 conDrawY = y;
729 int charsInLine = (sw-XOfs*2)/conCharWidth-1; // reserve room for cursor
730 if (rPromptChar >= ' ') --charsInLine;
731 if (charsInLine < 2) charsInLine = 2; // just in case
732 int stpos = prevIXOfs;
733 if (concurx == conclilen) {
734 stpos = conclilen-charsInLine;
735 prevCurX = concurx;
736 } else if (prevCurX != concurx) {
737 // cursor position changed, fix x offset
738 if (concurx <= prevIXOfs) {
739 stpos = concurx-1;
740 } else if (concurx-prevIXOfs >= charsInLine-1) {
741 stpos = concurx-charsInLine+1;
744 if (stpos < 0) stpos = 0;
745 prevCurX = concurx;
746 prevIXOfs = stpos;
748 if (rPromptChar >= ' ') {
749 conSetColor(rConPromptColor);
750 conDrawChar(rPromptChar);
752 conSetColor(rConInputColor);
753 version(none) {
754 foreach (int pos; stpos..stpos+charsInLine+1) {
755 if (pos < concurx) {
756 if (pos < conclilen) conDrawChar(concli.ptr[pos]);
757 } else if (pos == concurx) {
758 conSetColor(rConCursorColor);
759 conRect(conCharWidth, conCharHeight);
760 conDrawX += conCharWidth;
761 conSetColor(rConInputColor);
762 } else if (pos-1 < conclilen) {
763 conDrawChar(concli.ptr[pos-1]);
766 } else {
767 foreach (int pos; stpos..stpos+charsInLine+1) {
768 if (pos == concurx) {
769 conSetColor(rConCursorColor);
770 conRect(conCharWidth, conCharHeight);
771 conSetColor(rConInputColor);
773 if (pos >= 0 && pos < conclilen) conDrawChar(concli.ptr[pos]);
776 y -= conCharHeight;
779 // draw console text
780 conSetColor(rConTextColor);
781 conDrawX = XOfs;
782 conDrawY = y;
784 void putLine(T) (auto ref T line, usize pos=0) {
785 if (y+conCharHeight <= 0 || pos >= line.length) return;
786 int w = XOfs, lastWordW = -1;
787 usize sp = pos, lastWordEnd = 0;
788 while (sp < line.length) {
789 char ch = line[sp++];
790 enum cw = conCharWidth;
791 // remember last word position
792 if (/*lastWordW < 0 &&*/ (ch == ' ' || ch == '\t')) {
793 lastWordEnd = sp-1; // space will be put on next line (rough indication of line wrapping)
794 lastWordW = w;
796 if ((w += cw) > sw-XOfs*2) {
797 w -= cw;
798 --sp;
799 // current char is non-space, and, previous char is non-space, and we have a complete word?
800 if (lastWordW > 0 && ch != ' ' && ch != '\t' && sp > pos && line[sp-1] != ' ' && line[sp-1] != '\t') {
801 // yes, split on last word boundary
802 sp = lastWordEnd;
804 break;
807 if (sp < line.length) putLine(line, sp); // recursive put tail
808 // draw line
809 if (skipLines-- <= 0) {
810 while (pos < sp) conDrawChar(line[pos++]);
811 y -= conCharHeight;
812 conDrawX = XOfs;
813 conDrawY = y;
818 consoleWriteLock();
819 scope(exit) consoleWriteUnlock();
820 foreach (/*auto*/ line; conbufLinesRev) {
821 putLine(line);
822 if (y+conCharHeight <= 0) break;
826 return true;
830 // ////////////////////////////////////////////////////////////////////////// //
831 static if (OptCmdConGlHasSdpy) {
832 import arsd.simpledisplay : KeyEvent, MouseEvent, Key, ModifierState, SimpleWindow;
833 version(Posix) {
834 import arsd.simpledisplay : Pixmap, XImage, XDisplay, Visual, XPutImage, ImageFormat, Drawable, Status, XInitImage;
835 import arsd.simpledisplay : GC, XCreateGC, XFreeGC, XCopyGC, XSetClipMask, DefaultGC, DefaultScreen, None;
838 //public __gshared string glconShowKey = "M-Grave"; /// this key will be eaten
839 public __gshared string glconShowKey = "F12"; /// this key will be eaten
841 shared static this () {
842 conRegVar!glconShowKey("c_togglekey", "console toggle key name");
846 /// process keyboard event. returns `true` if event was eaten.
847 public bool glconKeyEvent (KeyEvent event) {
848 import arsd.simpledisplay;
849 // ketmar's special
850 if (event.key == 269025053) {
851 if (event.pressed) concmd("r_console toggle");
852 return true;
854 // others
855 if (!rConsoleVisible) {
856 if (event == glconShowKey) {
857 if (event.pressed) concmd("r_console 1");
858 return true;
860 return false;
862 if (!event.pressed) return true;
863 if (event == glconShowKey) {
864 if (glconShowKey.length == 1 && glconShowKey[0] >= ' ' && glconShowKey[0] < 128) {
865 if (conInputBuffer.length == 0) concmd("r_console 0");
866 } else if (glconShowKey == "Grave") {
867 if (conInputBuffer.length == 0) concmd("r_console 0");
868 } else {
869 concmd("r_console 0");
871 return true;
873 if (event.key == Key.Escape) { concmd("r_console 0"); return true; }
874 switch (event.key) {
875 case Key.Up:
876 if (event.modifierState&ModifierState.alt) {
877 glconCharInput(ConInputChar.LineUp);
878 } else {
879 glconCharInput(ConInputChar.Up);
881 return true;
882 case Key.Down:
883 if (event.modifierState&ModifierState.alt) {
884 glconCharInput(ConInputChar.LineDown);
885 } else {
886 glconCharInput(ConInputChar.Down);
888 return true;
889 case Key.Left: glconCharInput(ConInputChar.Left); return true;
890 case Key.Right: glconCharInput(ConInputChar.Right); return true;
891 case Key.Home: glconCharInput(ConInputChar.Home); return true;
892 case Key.End: glconCharInput(ConInputChar.End); return true;
893 case Key.PageUp:
894 if (event.modifierState&ModifierState.alt) {
895 glconCharInput(ConInputChar.LineUp);
896 } else {
897 glconCharInput(ConInputChar.PageUp);
899 return true;
900 case Key.PageDown:
901 if (event.modifierState&ModifierState.alt) {
902 glconCharInput(ConInputChar.LineDown);
903 } else {
904 glconCharInput(ConInputChar.PageDown);
906 return true;
907 case Key.Backspace: glconCharInput(ConInputChar.Backspace); return true;
908 case Key.Tab: glconCharInput(ConInputChar.Tab); return true;
909 case Key.Enter: glconCharInput(ConInputChar.Enter); return true;
910 case Key.Delete: glconCharInput(ConInputChar.Delete); return true;
911 case Key.Insert: glconCharInput(ConInputChar.Insert); return true;
912 case Key.W: if (event.modifierState&ModifierState.ctrl) glconCharInput(ConInputChar.CtrlW); return true;
913 case Key.Y: if (event.modifierState&ModifierState.ctrl) glconCharInput(ConInputChar.CtrlY); return true;
914 default:
916 return true;
920 /// process character event. returns `true` if event was eaten.
921 public bool glconCharEvent (dchar ch) {
922 if (!rConsoleVisible) {
923 if (glconShowKey.length == 1 && glconShowKey[0] >= ' ' && glconShowKey[0] < 128) {
924 if (ch == glconShowKey[0]) return true;
925 if (ch == '`' && glconShowKey == "Grave" && conInputBuffer.length == 0) return true; // HACK!
926 if (glconShowKey[0] >= 'A' && glconShowKey[0] <= 'Z' && ch >= 'a' && ch <= 'z' && glconShowKey[0] == ch-32) return true;
928 return false;
930 if (glconShowKey.length == 1 && glconShowKey[0] >= ' ' && glconShowKey[0] < 128 && ch == glconShowKey[0] && conInputBuffer.length == 0) return true; // HACK!
931 if (ch == '`' && glconShowKey == "Grave" && conInputBuffer.length == 0) return true; // HACK!
932 if (ch >= ' ' && ch < 127) glconCharInput(cast(char)ch);
933 return true;
937 /// call this in GLConDoConsoleCommandsEvent handler
938 public void glconProcessEventMessage () {
939 bool sendAnother = false;
940 bool wasCommands = false;
941 bool prevVisible = isConsoleVisible;
943 consoleLock();
944 scope(exit) consoleUnlock();
945 wasCommands = conQueueEmpty();
947 conProcessQueue();
949 consoleLock();
950 scope(exit) consoleUnlock();
951 sendAnother = !conQueueEmpty();
953 if (glconCtlWindow is null || glconCtlWindow.closed) return;
954 if (sendAnother) glconPostDoConCommands();
955 glconCallShowHideHandler();
956 if (wasCommands || prevVisible || isConsoleVisible) glconPostScreenRepaint();
960 public class GLConScreenRepaintEvent {} ///
961 public class GLConDoConsoleCommandsEvent {} ///
963 __gshared GLConScreenRepaintEvent evScreenRepaint;
964 __gshared GLConDoConsoleCommandsEvent evDoConCommands;
965 public __gshared SimpleWindow glconCtlWindow; /// this window will be used to send messages
966 public __gshared SimpleWindow glconDrawWindow; /// if `null`, OpenGL will be used
967 public __gshared bool glconDrawDirect = false; /// if `true`, draw directly to glconDrawWindow, else to it's backbuffer
969 shared static this () {
970 evScreenRepaint = new GLConScreenRepaintEvent();
971 evDoConCommands = new GLConDoConsoleCommandsEvent();
972 //__gshared oldccb = conInputChangedCB;
973 conInputChangedCB = delegate () nothrow @trusted {
974 try {
975 glconPostScreenRepaint();
976 } catch (Exception e) {}
977 //if (oldccb !is null) oldccb();
982 public void glconPostScreenRepaint () {
983 if (glconCtlWindow !is null && !glconCtlWindow.eventQueued!GLConScreenRepaintEvent) glconCtlWindow.postEvent(evScreenRepaint);
987 public void glconPostScreenRepaintDelayed (int tout=35) {
988 if (glconCtlWindow !is null && !glconCtlWindow.eventQueued!GLConScreenRepaintEvent) glconCtlWindow.postTimeout(evScreenRepaint, (tout < 0 ? 0 : tout));
992 public void glconPostDoConCommands(bool checkempty=false) () {
993 static if (checkempty) {
995 consoleLock();
996 scope(exit) consoleUnlock();
997 if (conQueueEmpty()) return;
1000 if (glconCtlWindow !is null && !glconCtlWindow.eventQueued!GLConDoConsoleCommandsEvent) glconCtlWindow.postEvent(evDoConCommands);
1004 // ////////////////////////////////////////////////////////////////////////// //
1005 public __gshared bool glconTranslateKeypad = true; /// translate keypad keys to "normal" keys?
1006 public __gshared bool glconTranslateMods = true; /// translate right modifiers "normal" modifiers?
1007 public __gshared bool glconNoMouseEventsWhenConsoleIsVisible = true; ///
1009 public __gshared void delegate () oglSetupDG; /// called when window will become visible for the first time
1010 public __gshared bool delegate () closeQueryDG; /// called when window will going to be closed; return `false` to prevent closing
1011 public __gshared void delegate () redrawFrameDG; /// frame need to be redrawn (but not rebuilt)
1012 public __gshared void delegate () nextFrameDG; /// frame need to be rebuilt (but not redrawn); won't be used for FPS == 0
1013 public __gshared void delegate (KeyEvent event) keyEventDG; ///
1014 public __gshared void delegate (MouseEvent event) mouseEventDG; ///
1015 public __gshared void delegate (dchar ch) charEventDG; ///
1016 public __gshared void delegate (int wdt, int hgt) resizeEventDG; ///
1017 public __gshared void delegate (bool focused) focusEventDG; ///
1020 // ////////////////////////////////////////////////////////////////////////// //
1021 private void glconRunGLWindowInternal (int wdt, int hgt, string title, string klass, bool resizeable) {
1022 import arsd.simpledisplay : sdpyWindowClass, OpenGlOptions, Resizability, flushGui;
1023 if (klass !is null) sdpyWindowClass = klass;
1024 auto sdwin = new SimpleWindow(wdt, hgt, title, OpenGlOptions.yes, (resizeable ? Resizability.allowResizing : Resizability.fixedSize));
1025 glconSetupForGLWindow(sdwin);
1026 sdwin.eventLoop(0);
1027 flushGui();
1028 conProcessQueue(int.max/4);
1032 // ////////////////////////////////////////////////////////////////////////// //
1033 /// create window and run event loop. use this after you set all the required *DG delegates.
1034 public void glconRunGLWindow (int wdt, int hgt, string title, string klass=null) {
1035 glconRunGLWindowInternal(wdt, hgt, title, klass, false);
1038 /// ditto.
1039 public void glconRunGLWindowResizeable (int wdt, int hgt, string title, string klass=null) {
1040 glconRunGLWindowInternal(wdt, hgt, title, klass, true);
1044 // ////////////////////////////////////////////////////////////////////////// //
1045 private __gshared int glconFPS = 30; // 0 means "render on demand"
1046 private __gshared double nextFrameTime = 0; // in msecs
1049 /// <=0 means "render on demand" (i.e. never automatically invoke `glconPostNextFrame()`)
1050 /// this will automatically seal "r_fps" convar
1051 /// note that you cannot set FPS to 0 with "r_fps" console variable
1052 public void glconSetAndSealFPS (int fps) {
1053 if (fps < 0) fps = 0; else if (fps > 200) fps = 200;
1054 glconFPS = fps;
1055 conSealVar("r_fps");
1059 private final class NextFrameEvent {}
1060 private __gshared NextFrameEvent eventNextFrame;
1061 private shared static this () {
1062 eventNextFrame = new NextFrameEvent();
1063 conRegVar!glconFPS(1, 200, "r_fps", "frames per second (affects both rendering and processing)");
1064 // use `conSealVar("r_fps")` to seal it
1068 /// call this to reset frame timer, and immediately post "rebuild frame" event if FPS > 0
1069 /// will post repaint event if FPS == 0
1070 /// called automatically when window is shown, if `glconSetupForGLWindow()` is used
1071 public void glconResetNextFrame () {
1072 nextFrameTime = 0;
1073 if (glconFPS <= 0) {
1074 glconPostScreenRepaint();
1075 } else {
1076 glconPostNextFrame();
1080 /// called automatically if FPS is > 0
1081 /// noop if FPS == 0
1082 public void glconPostNextFrame () {
1083 import iv.pxclock;
1084 if (glconFPS > 0) {
1085 if (glconCtlWindow.eventQueued!NextFrameEvent) return;
1086 ulong nft = cast(ulong)nextFrameTime;
1087 auto ctime = clockMilli();
1088 if (nft > 0 && nft > ctime) {
1089 glconCtlWindow.postTimeout(eventNextFrame, cast(uint)(nft-ctime));
1090 } else {
1091 // next frame time is either now, or passed
1092 int fps = glconFPS;
1093 if (fps < 1) fps = 1;
1094 if (fps > 200) fps = 200;
1095 if (nft <= 0) nextFrameTime = ctime;
1096 nextFrameTime += 1000.0/fps;
1097 nft = cast(ulong)nextFrameTime;
1098 if (nft <= ctime) {
1099 nextFrameTime = ctime; // too much time passed, reset timer
1100 glconCtlWindow.postTimeout(eventNextFrame, 0);
1101 } else {
1102 glconCtlWindow.postTimeout(eventNextFrame, cast(uint)(nft-ctime));
1108 /** use this after you set all the necessary *DG handlers, like this:
1110 * ------
1111 * sdpyWindowClass = "SDPY WINDOW";
1112 * auto sdwin = new SimpleWindow(VBufWidth, VBufHeight, "My D App", OpenGlOptions.yes, Resizability.allowResizing);
1113 * //sdwin.hideCursor();
1114 * glconSetupForGLWindow(sdwin);
1115 * sdwin.eventLoop(0);
1116 * flushGui();
1117 * conProcessQueue(int.max/4);
1118 * ------
1120 public void glconSetupForGLWindow (SimpleWindow w) {
1121 if (glconCtlWindow !is null) {
1122 if (w !is glconCtlWindow) throw new Exception("glconSetupForGLWindow() was already called for another window");
1123 return;
1126 glconCtlWindow = w;
1127 if (w is null) return;
1129 static if (is(typeof(&glconCtlWindow.closeQuery))) {
1130 glconCtlWindow.closeQuery = delegate () {
1131 if (closeQueryDG !is null && !closeQueryDG()) return;
1132 concmd("quit");
1133 glconPostDoConCommands();
1137 glconCtlWindow.visibleForTheFirstTime = delegate () {
1138 import iv.glbinds;
1139 glconCtlWindow.setAsCurrentOpenGlContext(); // make this window active
1141 glconInit(glconCtlWindow.width, glconCtlWindow.height);
1142 if (oglSetupDG !is null) oglSetupDG();
1144 if (glconFPS > 0) glconResetNextFrame();
1147 glconCtlWindow.addEventListener((NextFrameEvent evt) {
1148 glconPostDoConCommands!true();
1149 if (glconCtlWindow.closed) return;
1150 if (isQuitRequested) { glconCtlWindow.close(); return; }
1151 if (glconFPS > 0 && nextFrameDG !is null) nextFrameDG();
1152 glconCtlWindow.redrawOpenGlSceneNow();
1153 if (glconFPS > 0) glconPostNextFrame();
1156 glconCtlWindow.addEventListener((GLConScreenRepaintEvent evt) {
1157 if (glconCtlWindow.closed) return;
1158 if (isQuitRequested) { glconCtlWindow.close(); return; }
1159 glconCtlWindow.redrawOpenGlSceneNow();
1162 glconCtlWindow.addEventListener((GLConDoConsoleCommandsEvent evt) {
1163 glconProcessEventMessage();
1166 glconCtlWindow.windowResized = delegate (int wdt, int hgt) {
1167 if (glconCtlWindow.closed) return;
1168 glconResize(wdt, hgt);
1169 glconPostScreenRepaint/*Delayed*/();
1170 if (resizeEventDG !is null) resizeEventDG(wdt, hgt);
1173 glconCtlWindow.onFocusChange = delegate (bool focused) {
1174 if (glconCtlWindow.closed) return;
1175 if (focusEventDG !is null) focusEventDG(focused);
1178 glconCtlWindow.redrawOpenGlScene = delegate () {
1179 glconPostDoConCommands!true();
1180 if (glconCtlWindow.closed) return;
1181 // draw main screen
1182 if (redrawFrameDG !is null) redrawFrameDG();
1183 glconDraw();
1186 glconCtlWindow.handleKeyEvent = delegate (KeyEvent event) {
1187 scope(exit) glconPostDoConCommands!true();
1188 if (glconCtlWindow.closed) return;
1189 if (isQuitRequested) { glconCtlWindow.close(); return; }
1190 if (glconKeyEvent(event)) { glconPostScreenRepaint(); return; }
1192 if (keyEventDG is null) return;
1194 if (glconTranslateMods) {
1195 switch (event.key) {
1196 case Key.Ctrl_r: event.key = Key.Ctrl; break;
1197 case Key.Shift_r: event.key = Key.Shift; break;
1198 case Key.Alt_r: event.key = Key.Alt; break;
1199 case Key.Windows_r: event.key = Key.Windows; break;
1200 default:
1203 if (glconTranslateKeypad) {
1204 if ((event.modifierState&ModifierState.numLock) == 0) {
1205 switch (event.key) {
1206 case Key.PadEnter: event.key = Key.Enter; break;
1207 case Key.Pad1: event.key = Key.End; break;
1208 case Key.Pad2: event.key = Key.Down; break;
1209 case Key.Pad3: event.key = Key.PageDown; break;
1210 case Key.Pad4: event.key = Key.Left; break;
1211 //case Key.Pad5: event.key = Key.; break;
1212 case Key.Pad6: event.key = Key.Right; break;
1213 case Key.Pad7: event.key = Key.Home; break;
1214 case Key.Pad8: event.key = Key.Up; break;
1215 case Key.Pad9: event.key = Key.PageUp; break;
1216 case Key.Pad0: event.key = Key.Insert; break;
1217 default:
1221 keyEventDG(event);
1224 glconCtlWindow.handleMouseEvent = delegate (MouseEvent event) {
1225 scope(exit) glconPostDoConCommands!true();
1226 if (glconCtlWindow.closed) return;
1227 if (rConsoleVisible && glconNoMouseEventsWhenConsoleIsVisible) return;
1228 if (mouseEventDG !is null) mouseEventDG(event);
1231 glconCtlWindow.handleCharEvent = delegate (dchar ch) {
1232 scope(exit) glconPostDoConCommands!true();
1233 if (glconCtlWindow.closed) return;
1234 if (glconCharEvent(ch)) { glconPostScreenRepaint(); return; }
1235 if (charEventDG !is null) charEventDG(ch);
1241 // ////////////////////////////////////////////////////////////////////////// //
1242 static public immutable ushort[256*10] glConFont10 = [
1243 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3f00,0x4080,0x5280,0x4080,0x5e80,0x4c80,0x2100,0x1e00,
1244 0x0000,0x0000,0x3f00,0x7f80,0x6d80,0x7f80,0x6180,0x7380,0x3f00,0x1e00,0x0000,0x0000,0x3b80,0x7fc0,0x7fc0,0x7fc0,0x3f80,0x1f00,0x0e00,
1245 0x0400,0x0000,0x0400,0x0e00,0x1f00,0x3f80,0x7fc0,0x3f80,0x1f00,0x0e00,0x0400,0x0000,0x0000,0x0e00,0x1f00,0x0e00,0x3f80,0x7fc0,0x3580,
1246 0x0400,0x0e00,0x0000,0x0400,0x0e00,0x1f00,0x3f80,0x7fc0,0x7fc0,0x3580,0x0400,0x0e00,0x0000,0x0000,0x0000,0x0000,0x0c00,0x1e00,0x1e00,
1247 0x0c00,0x0000,0x0000,0x0000,0xffc0,0xffc0,0xffc0,0xf3c0,0xe1c0,0xe1c0,0xf3c0,0xffc0,0xffc0,0xffc0,0x0000,0x0000,0x1e00,0x3300,0x2100,
1248 0x2100,0x3300,0x1e00,0x0000,0x0000,0xffc0,0xffc0,0xe1c0,0xccc0,0xdec0,0xdec0,0xccc0,0xe1c0,0xffc0,0xffc0,0x0000,0x0780,0x0380,0x0780,
1249 0x3e80,0x6600,0x6600,0x6600,0x3c00,0x0000,0x0000,0x1e00,0x3300,0x3300,0x3300,0x1e00,0x0c00,0x3f00,0x0c00,0x0000,0x0400,0x0600,0x0700,
1250 0x0500,0x0500,0x0400,0x1c00,0x3c00,0x1800,0x0000,0x0000,0x1f80,0x1f80,0x1080,0x1080,0x1180,0x3380,0x7100,0x2000,0x0000,0x0000,0x0c00,
1251 0x6d80,0x1e00,0x7380,0x7380,0x1e00,0x6d80,0x0c00,0x0000,0x1000,0x1800,0x1c00,0x1e00,0x1f00,0x1e00,0x1c00,0x1800,0x1000,0x0000,0x0100,
1252 0x0300,0x0700,0x0f00,0x1f00,0x0f00,0x0700,0x0300,0x0100,0x0000,0x0000,0x0c00,0x1e00,0x3f00,0x0c00,0x0c00,0x3f00,0x1e00,0x0c00,0x0000,
1253 0x0000,0x3300,0x3300,0x3300,0x3300,0x3300,0x0000,0x3300,0x0000,0x0000,0x0000,0x3f80,0x6d80,0x6d80,0x3d80,0x0d80,0x0d80,0x0d80,0x0000,
1254 0x0000,0x0000,0x1f00,0x3000,0x1f00,0x3180,0x1f00,0x0180,0x1f00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x7f80,0x7f80,0x7f80,
1255 0x0000,0x0000,0x0000,0x0c00,0x1e00,0x3f00,0x0c00,0x0c00,0x3f00,0x1e00,0x0c00,0xffc0,0x0000,0x0c00,0x1e00,0x3f00,0x0c00,0x0c00,0x0c00,
1256 0x0c00,0x0c00,0x0000,0x0000,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x3f00,0x1e00,0x0c00,0x0000,0x0000,0x0000,0x0600,0x0300,0x7f80,0x0300,
1257 0x0600,0x0000,0x0000,0x0000,0x0000,0x0000,0x1800,0x3000,0x7f80,0x3000,0x1800,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x6000,
1258 0x6000,0x6000,0x7f80,0x0000,0x0000,0x0000,0x0000,0x1100,0x3180,0x7fc0,0x3180,0x1100,0x0000,0x0000,0x0000,0x0000,0x0000,0x0400,0x0e00,
1259 0x1f00,0x3f80,0x7fc0,0x0000,0x0000,0x0000,0x0000,0x0000,0x7fc0,0x3f80,0x1f00,0x0e00,0x0400,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
1260 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0c00,0x1e00,0x1e00,0x0c00,0x0c00,0x0000,0x0c00,0x0000,0x0000,0x0000,0x1b00,
1261 0x1b00,0x1b00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x1b00,0x1b00,0x7fc0,0x1b00,0x7fc0,0x1b00,0x1b00,0x0000,0x0000,0x0400,
1262 0x1f00,0x3580,0x3400,0x1f00,0x0580,0x3580,0x1f00,0x0400,0x0000,0x0000,0x3180,0x3300,0x0600,0x0c00,0x1980,0x3180,0x0000,0x0000,0x0000,
1263 0x0000,0x1c00,0x3300,0x3300,0x1f80,0x3300,0x3300,0x1d80,0x0000,0x0000,0x0000,0x0e00,0x0c00,0x1800,0x0000,0x0000,0x0000,0x0000,0x0000,
1264 0x0000,0x0000,0x0600,0x0c00,0x1800,0x1800,0x1800,0x0c00,0x0600,0x0000,0x0000,0x0000,0x1800,0x0c00,0x0600,0x0600,0x0600,0x0c00,0x1800,
1265 0x0000,0x0000,0x0000,0x0000,0x3300,0x1e00,0x7f80,0x1e00,0x3300,0x0000,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0c00,0x3f00,0x0c00,0x0c00,
1266 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0c00,0x1800,0x0000,0x0000,0x0000,0x0000,0x0000,0x3f00,0x0000,
1267 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0c00,0x0000,0x0000,0x0000,0x0180,0x0300,0x0600,0x0c00,
1268 0x1800,0x3000,0x6000,0x0000,0x0000,0x0000,0x1f00,0x3380,0x3780,0x3f80,0x3d80,0x3980,0x1f00,0x0000,0x0000,0x0000,0x0c00,0x1c00,0x0c00,
1269 0x0c00,0x0c00,0x0c00,0x3f00,0x0000,0x0000,0x0000,0x1f00,0x3180,0x0180,0x0f00,0x1800,0x3180,0x3f80,0x0000,0x0000,0x0000,0x1f00,0x3180,
1270 0x0180,0x0700,0x0180,0x3180,0x1f00,0x0000,0x0000,0x0000,0x0700,0x0f00,0x1b00,0x3300,0x3f80,0x0300,0x0780,0x0000,0x0000,0x0000,0x3f80,
1271 0x3000,0x3000,0x3f00,0x0180,0x3180,0x1f00,0x0000,0x0000,0x0000,0x0f00,0x1800,0x3000,0x3f00,0x3180,0x3180,0x1f00,0x0000,0x0000,0x0000,
1272 0x3f80,0x3180,0x0180,0x0300,0x0600,0x0c00,0x0c00,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3180,0x1f00,0x3180,0x3180,0x1f00,0x0000,0x0000,
1273 0x0000,0x1f00,0x3180,0x3180,0x1f80,0x0180,0x0300,0x1e00,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0c00,0x0000,0x0000,0x0c00,0x0c00,0x0000,
1274 0x0000,0x0000,0x0000,0x0c00,0x0c00,0x0000,0x0000,0x0c00,0x0c00,0x1800,0x0000,0x0000,0x0300,0x0600,0x0c00,0x1800,0x0c00,0x0600,0x0300,
1275 0x0000,0x0000,0x0000,0x0000,0x0000,0x3f00,0x0000,0x3f00,0x0000,0x0000,0x0000,0x0000,0x0000,0x1800,0x0c00,0x0600,0x0300,0x0600,0x0c00,
1276 0x1800,0x0000,0x0000,0x0000,0x1e00,0x3300,0x0300,0x0300,0x0600,0x0c00,0x0000,0x0c00,0x0000,0x0000,0x3f00,0x6180,0x6780,0x6d80,0x6780,
1277 0x6000,0x3f00,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3180,0x3f80,0x3180,0x3180,0x3180,0x0000,0x0000,0x0000,0x3f00,0x3180,0x3180,0x3f00,
1278 0x3180,0x3180,0x3f00,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3000,0x3000,0x3000,0x3180,0x1f00,0x0000,0x0000,0x0000,0x3e00,0x3300,0x3180,
1279 0x3180,0x3180,0x3300,0x3e00,0x0000,0x0000,0x0000,0x3f80,0x3000,0x3000,0x3f00,0x3000,0x3000,0x3f80,0x0000,0x0000,0x0000,0x3f80,0x3000,
1280 0x3000,0x3f00,0x3000,0x3000,0x3000,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3000,0x3380,0x3180,0x3180,0x1f00,0x0000,0x0000,0x0000,0x3180,
1281 0x3180,0x3180,0x3f80,0x3180,0x3180,0x3180,0x0000,0x0000,0x0000,0x1e00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x1e00,0x0000,0x0000,0x0000,
1282 0x0700,0x0300,0x0300,0x0300,0x3300,0x3300,0x1e00,0x0000,0x0000,0x0000,0x3180,0x3180,0x3300,0x3e00,0x3300,0x3180,0x3180,0x0000,0x0000,
1283 0x0000,0x3000,0x3000,0x3000,0x3000,0x3000,0x3000,0x3f80,0x0000,0x0000,0x0000,0x6180,0x7380,0x7f80,0x6d80,0x6180,0x6180,0x6180,0x0000,
1284 0x0000,0x0000,0x3180,0x3980,0x3d80,0x3780,0x3380,0x3180,0x3180,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3180,0x3180,0x3180,0x3180,0x1f00,
1285 0x0000,0x0000,0x0000,0x3f00,0x3180,0x3180,0x3f00,0x3000,0x3000,0x3000,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3180,0x3180,0x3180,0x3380,
1286 0x1f00,0x0380,0x0000,0x0000,0x3f00,0x3180,0x3180,0x3f00,0x3300,0x3180,0x3180,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3000,0x1f00,0x0180,
1287 0x3180,0x1f00,0x0000,0x0000,0x0000,0x7f80,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0000,0x0000,0x0000,0x3180,0x3180,0x3180,0x3180,
1288 0x3180,0x3180,0x1f00,0x0000,0x0000,0x0000,0x3180,0x3180,0x3180,0x3180,0x1b00,0x0e00,0x0400,0x0000,0x0000,0x0000,0x6180,0x6180,0x6180,
1289 0x6d80,0x7f80,0x7380,0x6180,0x0000,0x0000,0x0000,0x6180,0x3300,0x1e00,0x0c00,0x1e00,0x3300,0x6180,0x0000,0x0000,0x0000,0x6180,0x6180,
1290 0x3300,0x1e00,0x0c00,0x0c00,0x0c00,0x0000,0x0000,0x0000,0x3f80,0x0300,0x0600,0x0c00,0x1800,0x3000,0x3f80,0x0000,0x0000,0x0000,0x1e00,
1291 0x1800,0x1800,0x1800,0x1800,0x1800,0x1e00,0x0000,0x0000,0x0000,0x6000,0x3000,0x1800,0x0c00,0x0600,0x0300,0x0000,0x0000,0x0000,0x0000,
1292 0x1e00,0x0600,0x0600,0x0600,0x0600,0x0600,0x1e00,0x0000,0x0000,0x0000,0x0400,0x0e00,0x1b00,0x3180,0x0000,0x0000,0x0000,0x0000,0x0000,
1293 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xffc0,0x0000,0x0000,0x1c00,0x0c00,0x0600,0x0000,0x0000,0x0000,0x0000,0x0000,
1294 0x0000,0x0000,0x0000,0x0000,0x1f00,0x0180,0x1f80,0x3180,0x1f80,0x0000,0x0000,0x0000,0x3000,0x3000,0x3f00,0x3180,0x3180,0x3180,0x3f00,
1295 0x0000,0x0000,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3000,0x3180,0x1f00,0x0000,0x0000,0x0000,0x0180,0x0180,0x1f80,0x3180,0x3180,0x3180,
1296 0x1f80,0x0000,0x0000,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3f80,0x3000,0x1f00,0x0000,0x0000,0x0000,0x0f00,0x1800,0x1800,0x3e00,0x1800,
1297 0x1800,0x1800,0x0000,0x0000,0x0000,0x0000,0x0000,0x1f80,0x3180,0x3180,0x3180,0x1f80,0x0180,0x1f00,0x0000,0x3000,0x3000,0x3f00,0x3180,
1298 0x3180,0x3180,0x3180,0x0000,0x0000,0x0000,0x0c00,0x0000,0x1c00,0x0c00,0x0c00,0x0c00,0x1e00,0x0000,0x0000,0x0000,0x0600,0x0000,0x0e00,
1299 0x0600,0x0600,0x0600,0x0600,0x0600,0x1c00,0x0000,0x3000,0x3000,0x3180,0x3300,0x3e00,0x3300,0x3180,0x0000,0x0000,0x0000,0x1c00,0x0c00,
1300 0x0c00,0x0c00,0x0c00,0x0c00,0x0700,0x0000,0x0000,0x0000,0x0000,0x0000,0x3300,0x7f80,0x6d80,0x6d80,0x6180,0x0000,0x0000,0x0000,0x0000,
1301 0x0000,0x3f00,0x3180,0x3180,0x3180,0x3180,0x0000,0x0000,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3180,0x3180,0x1f00,0x0000,0x0000,0x0000,
1302 0x0000,0x0000,0x3f00,0x3180,0x3180,0x3f00,0x3000,0x3000,0x0000,0x0000,0x0000,0x0000,0x1f80,0x3180,0x3180,0x1f80,0x0180,0x01c0,0x0000,
1303 0x0000,0x0000,0x0000,0x3f00,0x3180,0x3000,0x3000,0x3000,0x0000,0x0000,0x0000,0x0000,0x0000,0x1f80,0x3000,0x1f00,0x0180,0x3f00,0x0000,
1304 0x0000,0x0000,0x1800,0x1800,0x3e00,0x1800,0x1800,0x1800,0x0f00,0x0000,0x0000,0x0000,0x0000,0x0000,0x3180,0x3180,0x3180,0x3180,0x1f80,
1305 0x0000,0x0000,0x0000,0x0000,0x0000,0x3180,0x3180,0x1b00,0x0e00,0x0400,0x0000,0x0000,0x0000,0x0000,0x0000,0x6180,0x6d80,0x6d80,0x7f80,
1306 0x3300,0x0000,0x0000,0x0000,0x0000,0x0000,0x3180,0x1b00,0x0e00,0x1b00,0x3180,0x0000,0x0000,0x0000,0x0000,0x0000,0x3180,0x3180,0x3180,
1307 0x1f80,0x0180,0x1f00,0x0000,0x0000,0x0000,0x0000,0x3f00,0x0600,0x0c00,0x1800,0x3f00,0x0000,0x0000,0x0000,0x0e00,0x1800,0x1800,0x3000,
1308 0x1800,0x1800,0x0e00,0x0000,0x0000,0x0c00,0x0c00,0x0c00,0x0c00,0x0000,0x0c00,0x0c00,0x0c00,0x0c00,0x0000,0x0000,0x1c00,0x0600,0x0600,
1309 0x0300,0x0600,0x0600,0x1c00,0x0000,0x0000,0x0000,0x0000,0x0000,0x3800,0x6d80,0x0700,0x0000,0x0000,0x0000,0x0000,0x0000,0x0400,0x0e00,
1310 0x1b00,0x3180,0x3180,0x3180,0x3f80,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3000,0x3000,0x3000,0x3180,0x1f00,0x0c00,0x1800,0x0000,0x1b00,
1311 0x0000,0x3180,0x3180,0x3180,0x3180,0x1f80,0x0000,0x0000,0x0600,0x0c00,0x0000,0x1f00,0x3180,0x3f80,0x3000,0x1f00,0x0000,0x0000,0x0e00,
1312 0x1b00,0x0000,0x1f00,0x0180,0x1f80,0x3180,0x1f80,0x0000,0x0000,0x0000,0x1b00,0x0000,0x1f00,0x0180,0x1f80,0x3180,0x1f80,0x0000,0x0000,
1313 0x0c00,0x0600,0x0000,0x1f00,0x0180,0x1f80,0x3180,0x1f80,0x0000,0x0000,0x0e00,0x1b00,0x0e00,0x1f00,0x0180,0x1f80,0x3180,0x1f80,0x0000,
1314 0x0000,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3000,0x3180,0x1f00,0x0c00,0x1800,0x0e00,0x1b00,0x0000,0x1f00,0x3180,0x3f80,0x3000,0x1f00,
1315 0x0000,0x0000,0x0000,0x1b00,0x0000,0x1f00,0x3180,0x3f80,0x3000,0x1f00,0x0000,0x0000,0x0c00,0x0600,0x0000,0x1f00,0x3180,0x3f80,0x3000,
1316 0x1f00,0x0000,0x0000,0x0000,0x3600,0x0000,0x1c00,0x0c00,0x0c00,0x0c00,0x1e00,0x0000,0x0000,0x1c00,0x3600,0x0000,0x1c00,0x0c00,0x0c00,
1317 0x0c00,0x1e00,0x0000,0x0000,0x1800,0x0c00,0x0000,0x1c00,0x0c00,0x0c00,0x0c00,0x1e00,0x0000,0x0000,0x0000,0x1b00,0x0000,0x1f00,0x3180,
1318 0x3f80,0x3180,0x3180,0x0000,0x0000,0x0e00,0x1b00,0x0e00,0x1f00,0x3180,0x3f80,0x3180,0x3180,0x0000,0x0000,0x0600,0x0c00,0x0000,0x3f80,
1319 0x3000,0x3f00,0x3000,0x3f80,0x0000,0x0000,0x0000,0x0000,0x0000,0x3b80,0x0ec0,0x3fc0,0x6e00,0x3b80,0x0000,0x0000,0x0000,0x1f80,0x3600,
1320 0x6600,0x7f80,0x6600,0x6600,0x6780,0x0000,0x0000,0x0e00,0x1b00,0x0000,0x1f00,0x3180,0x3180,0x3180,0x1f00,0x0000,0x0000,0x0000,0x1b00,
1321 0x0000,0x1f00,0x3180,0x3180,0x3180,0x1f00,0x0000,0x0000,0x0c00,0x0600,0x0000,0x1f00,0x3180,0x3180,0x3180,0x1f00,0x0000,0x0000,0x0e00,
1322 0x1b00,0x0000,0x3180,0x3180,0x3180,0x3180,0x1f80,0x0000,0x0000,0x0c00,0x0600,0x0000,0x3180,0x3180,0x3180,0x3180,0x1f80,0x0000,0x0000,
1323 0x0000,0x1b00,0x0000,0x3180,0x3180,0x3180,0x1f80,0x0180,0x1f00,0x0000,0x0000,0x1b00,0x0000,0x1f00,0x3180,0x3180,0x3180,0x1f00,0x0000,
1324 0x0000,0x0000,0x1b00,0x0000,0x3180,0x3180,0x3180,0x3180,0x1f80,0x0000,0x0000,0x0000,0x0000,0x0400,0x1f00,0x3580,0x3400,0x3580,0x1f00,
1325 0x0400,0x0000,0x0000,0x0f00,0x1980,0x1800,0x3e00,0x1800,0x1800,0x3000,0x3f80,0x0000,0x0000,0x6180,0x6180,0x3300,0x1e00,0x3f00,0x0c00,
1326 0x3f00,0x0c00,0x0000,0x0000,0x7f00,0x6180,0x6d80,0x6d80,0x7f00,0x6c00,0x6c00,0x6700,0x0000,0x0000,0x0700,0x0c00,0x0c00,0x1e00,0x0c00,
1327 0x0c00,0x0c00,0x3800,0x0000,0x0600,0x0c00,0x0000,0x1f00,0x0180,0x1f80,0x3180,0x1f80,0x0000,0x0000,0x0c00,0x1800,0x0000,0x1c00,0x0c00,
1328 0x0c00,0x0c00,0x1e00,0x0000,0x0000,0x0600,0x0c00,0x0000,0x1f00,0x3180,0x3180,0x3180,0x1f00,0x0000,0x0000,0x0600,0x0c00,0x0000,0x3180,
1329 0x3180,0x3180,0x3180,0x1f80,0x0000,0x0000,0x1d80,0x3700,0x0000,0x3f00,0x3180,0x3180,0x3180,0x3180,0x0000,0x0000,0x1d80,0x3700,0x0000,
1330 0x3980,0x3d80,0x3780,0x3380,0x3180,0x0000,0x0000,0x0000,0x1e00,0x0300,0x1f00,0x3300,0x1f00,0x0000,0x0000,0x0000,0x0000,0x0000,0x1e00,
1331 0x3300,0x3300,0x3300,0x1e00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0000,0x0c00,0x1800,0x3000,0x3000,0x3300,0x1e00,0x0000,0x0000,
1332 0x0000,0x0000,0x0000,0x3f80,0x3000,0x3000,0x3000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x3f80,0x0180,0x0180,0x0180,0x0000,0x0000,
1333 0x0000,0x2080,0x2100,0x2200,0x2400,0x0b00,0x1180,0x2300,0x4380,0x0000,0x0000,0x2080,0x2100,0x2200,0x2400,0x0a80,0x1280,0x2380,0x4080,
1334 0x0000,0x0000,0x0c00,0x0000,0x0c00,0x0c00,0x1e00,0x1e00,0x0c00,0x0000,0x0000,0x0000,0x0000,0x1980,0x3300,0x6600,0x3300,0x1980,0x0000,
1335 0x0000,0x0000,0x0000,0x0000,0x6600,0x3300,0x1980,0x3300,0x6600,0x0000,0x0000,0x0000,0x2200,0x8880,0x2200,0x8880,0x2200,0x8880,0x2200,
1336 0x8880,0x2200,0x8880,0x5540,0xaa80,0x5540,0xaa80,0x5540,0xaa80,0x5540,0xaa80,0x5540,0xaa80,0xbb80,0xeec0,0xbb80,0xeec0,0xbb80,0xeec0,
1337 0xbb80,0xeec0,0xbb80,0xeec0,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0xfc00,
1338 0xfc00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0xfc00,0xfc00,0x0c00,0x0c00,0xfc00,0xfc00,0x0c00,0x0c00,0x3300,0x3300,0x3300,0x3300,
1339 0xf300,0xf300,0x3300,0x3300,0x3300,0x3300,0x0000,0x0000,0x0000,0x0000,0xff00,0xff00,0x3300,0x3300,0x3300,0x3300,0x0000,0x0000,0xfc00,
1340 0xfc00,0x0c00,0x0c00,0xfc00,0xfc00,0x0c00,0x0c00,0x3300,0x3300,0xf300,0xf300,0x0300,0x0300,0xf300,0xf300,0x3300,0x3300,0x3300,0x3300,
1341 0x3300,0x3300,0x3300,0x3300,0x3300,0x3300,0x3300,0x3300,0x0000,0x0000,0xff00,0xff00,0x0300,0x0300,0xf300,0xf300,0x3300,0x3300,0x3300,
1342 0x3300,0xf300,0xf300,0x0300,0x0300,0xff00,0xff00,0x0000,0x0000,0x3300,0x3300,0x3300,0x3300,0xff00,0xff00,0x0000,0x0000,0x0000,0x0000,
1343 0x1800,0x1800,0xf800,0xf800,0x1800,0x1800,0xf800,0xf800,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xfc00,0xfc00,0x0c00,0x0c00,0x0c00,
1344 0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0fc0,0x0fc0,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0c00,0x0c00,0x0c00,0xffc0,0xffc0,0x0000,0x0000,
1345 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xffc0,0xffc0,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0fc0,0x0fc0,0x0c00,
1346 0x0c00,0x0c00,0x0c00,0x0000,0x0000,0x0000,0x0000,0xffc0,0xffc0,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0c00,0x0c00,0x0c00,0xffc0,0xffc0,
1347 0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0fc0,0x0fc0,0x0c00,0x0c00,0x0fc0,0x0fc0,0x0c00,0x0c00,0x3300,0x3300,0x3300,0x3300,0x33c0,
1348 0x33c0,0x3300,0x3300,0x3300,0x3300,0x3300,0x3300,0x33c0,0x33c0,0x3000,0x3000,0x3fc0,0x3fc0,0x0000,0x0000,0x0000,0x0000,0x3fc0,0x3fc0,
1349 0x3000,0x3000,0x33c0,0x33c0,0x3300,0x3300,0x3300,0x3300,0xf3c0,0xf3c0,0x0000,0x0000,0xffc0,0xffc0,0x0000,0x0000,0x0000,0x0000,0xffc0,
1350 0xffc0,0x0000,0x0000,0xf3c0,0xf3c0,0x3300,0x3300,0x3300,0x3300,0x33c0,0x33c0,0x3000,0x3000,0x33c0,0x33c0,0x3300,0x3300,0x0000,0x0000,
1351 0xffc0,0xffc0,0x0000,0x0000,0xffc0,0xffc0,0x0000,0x0000,0x3300,0x3300,0xf3c0,0xf3c0,0x0000,0x0000,0xf3c0,0xf3c0,0x3300,0x3300,0x0c00,
1352 0x0c00,0xffc0,0xffc0,0x0000,0x0000,0xffc0,0xffc0,0x0000,0x0000,0x3300,0x3300,0x3300,0x3300,0xffc0,0xffc0,0x0000,0x0000,0x0000,0x0000,
1353 0x0000,0x0000,0xffc0,0xffc0,0x0000,0x0000,0xffc0,0xffc0,0x0c00,0x0c00,0x0000,0x0000,0x0000,0x0000,0xffc0,0xffc0,0x3300,0x3300,0x3300,
1354 0x3300,0x3300,0x3300,0x3300,0x3300,0x3fc0,0x3fc0,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0c00,0x0fc0,0x0fc0,0x0c00,0x0c00,0x0fc0,0x0fc0,
1355 0x0000,0x0000,0x0000,0x0000,0x0fc0,0x0fc0,0x0c00,0x0c00,0x0fc0,0x0fc0,0x0c00,0x0c00,0x0000,0x0000,0x0000,0x0000,0x3fc0,0x3fc0,0x3300,
1356 0x3300,0x3300,0x3300,0x3300,0x3300,0x3300,0x3300,0xf3c0,0xf3c0,0x3300,0x3300,0x3300,0x3300,0x0c00,0x0c00,0xffc0,0xffc0,0x0000,0x0000,
1357 0xffc0,0xffc0,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0xfc00,0xfc00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0fc0,
1358 0x0fc0,0x0c00,0x0c00,0x0c00,0x0c00,0xffc0,0xffc0,0xffc0,0xffc0,0xffc0,0xffc0,0xffc0,0xffc0,0xffc0,0xffc0,0x0000,0x0000,0x0000,0x0000,
1359 0x0000,0xffc0,0xffc0,0xffc0,0xffc0,0xffc0,0xf800,0xf800,0xf800,0xf800,0xf800,0xf800,0xf800,0xf800,0xf800,0xf800,0x07c0,0x07c0,0x07c0,
1360 0x07c0,0x07c0,0x07c0,0x07c0,0x07c0,0x07c0,0x07c0,0xffc0,0xffc0,0xffc0,0xffc0,0xffc0,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
1361 0x0000,0x1d80,0x3700,0x3200,0x3700,0x1d80,0x0000,0x0000,0x0000,0x1e00,0x3300,0x3300,0x3600,0x3300,0x3180,0x3700,0x3000,0x0000,0x0000,
1362 0x3f80,0x3180,0x3000,0x3000,0x3000,0x3000,0x3000,0x0000,0x0000,0x0000,0x0000,0x7f80,0x3300,0x3300,0x3300,0x3300,0x3300,0x0000,0x0000,
1363 0x0000,0x3f80,0x1800,0x0c00,0x0600,0x0c00,0x1800,0x3f80,0x0000,0x0000,0x0000,0x0000,0x0000,0x1f80,0x3600,0x3300,0x3300,0x1e00,0x0000,
1364 0x0000,0x0000,0x0000,0x0000,0x6300,0x6300,0x6700,0x7d80,0x6000,0x6000,0x0000,0x0000,0x0000,0x0000,0x3f00,0x0c00,0x0c00,0x0c00,0x0600,
1365 0x0000,0x0000,0x0000,0x1e00,0x0c00,0x3f00,0x6d80,0x6d80,0x3f00,0x0c00,0x1e00,0x0000,0x0000,0x1e00,0x3300,0x3300,0x3f00,0x3300,0x3300,
1366 0x1e00,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3180,0x3180,0x3180,0x1b00,0x3b80,0x0000,0x0000,0x0000,0x1f00,0x0c00,0x0600,0x1f00,0x3180,
1367 0x3180,0x1f00,0x0000,0x0000,0x0000,0x0000,0x0000,0x3b80,0x66c0,0x64c0,0x6cc0,0x3b80,0x0000,0x0000,0x0000,0x0000,0x0180,0x3f00,0x6780,
1368 0x6d80,0x7980,0x3f00,0x6000,0x0000,0x0000,0x0000,0x0000,0x1f00,0x3000,0x1e00,0x3000,0x1f00,0x0000,0x0000,0x0000,0x1f00,0x3180,0x3180,
1369 0x3180,0x3180,0x3180,0x3180,0x0000,0x0000,0x0000,0x0000,0x3f00,0x0000,0x3f00,0x0000,0x3f00,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0c00,
1370 0x3f00,0x0c00,0x0c00,0x0000,0x3f00,0x0000,0x0000,0x0000,0x0600,0x0c00,0x1800,0x0c00,0x0600,0x0000,0x3f00,0x0000,0x0000,0x0000,0x1800,
1371 0x0c00,0x0600,0x0c00,0x1800,0x0000,0x3f00,0x0000,0x0000,0x0000,0x0700,0x0d80,0x0d80,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,
1372 0x0c00,0x0c00,0x0c00,0x0c00,0x0c00,0x6c00,0x6c00,0x3800,0x0000,0x0000,0x0000,0x0c00,0x0000,0x3f00,0x0000,0x0c00,0x0000,0x0000,0x0000,
1373 0x0000,0x3800,0x6d80,0x0700,0x0000,0x3800,0x6d80,0x0700,0x0000,0x0000,0x0000,0x0e00,0x1b00,0x1b00,0x0e00,0x0000,0x0000,0x0000,0x0000,
1374 0x0000,0x0000,0x0000,0x0000,0x0c00,0x0c00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0c00,0x0000,0x0000,0x0000,
1375 0x0000,0x0000,0x0000,0x07c0,0x0600,0x0600,0x6600,0x3600,0x1e00,0x0e00,0x0600,0x0200,0x0000,0x3e00,0x3300,0x3300,0x3300,0x3300,0x0000,
1376 0x0000,0x0000,0x0000,0x0000,0x1e00,0x0300,0x0e00,0x1800,0x1f00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x1e00,0x1e00,0x1e00,
1377 0x1e00,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
1380 // 512x512: [0..511]
1381 static immutable ubyte[7641] baphometPath = [
1382 0x01,0x04,0x06,0x30,0x89,0x7f,0x43,0x00,0x80,0xff,0x43,0x08,0xa0,0x1d,0xc6,0x43,0x00,0x80,0xff,0x43,
1383 0x00,0x80,0xff,0x43,0xa2,0x1d,0xc6,0x43,0x00,0x80,0xff,0x43,0x30,0x89,0x7f,0x43,0x08,0x00,0x80,0xff,
1384 0x43,0x7a,0x89,0xe5,0x42,0xa0,0x1d,0xc6,0x43,0x00,0x00,0x00,0x00,0x30,0x89,0x7f,0x43,0x00,0x00,0x00,
1385 0x00,0x08,0x7a,0x89,0xe5,0x42,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7a,0x89,0xe5,0x42,0x00,0x00,
1386 0x00,0x00,0x30,0x89,0x7f,0x43,0x08,0x00,0x00,0x00,0x00,0xa2,0x1d,0xc6,0x43,0x7a,0x89,0xe5,0x42,0x00,
1387 0x80,0xff,0x43,0x30,0x89,0x7f,0x43,0x00,0x80,0xff,0x43,0x09,0x06,0x30,0x89,0x7f,0x43,0x72,0x87,0xdd,
1388 0x43,0x08,0x16,0x68,0xb3,0x43,0x72,0x87,0xdd,0x43,0x71,0x87,0xdd,0x43,0x17,0x68,0xb3,0x43,0x71,0x87,
1389 0xdd,0x43,0x30,0x89,0x7f,0x43,0x08,0x71,0x87,0xdd,0x43,0xd2,0x2f,0x18,0x43,0x16,0x68,0xb3,0x43,0x35,
1390 0xe2,0x87,0x42,0x30,0x89,0x7f,0x43,0x35,0xe2,0x87,0x42,0x08,0xd1,0x2f,0x18,0x43,0x35,0xe2,0x87,0x42,
1391 0x35,0xe2,0x87,0x42,0xd2,0x2f,0x18,0x43,0x35,0xe2,0x87,0x42,0x30,0x89,0x7f,0x43,0x08,0x35,0xe2,0x87,
1392 0x42,0x17,0x68,0xb3,0x43,0xd1,0x2f,0x18,0x43,0x72,0x87,0xdd,0x43,0x30,0x89,0x7f,0x43,0x72,0x87,0xdd,
1393 0x43,0x09,0x06,0x79,0xcb,0x11,0x43,0x62,0xbf,0xd7,0x42,0x07,0xa4,0x3f,0x7f,0x43,0x0b,0x86,0xdc,0x43,
1394 0x07,0x6c,0xb9,0xb2,0x43,0xe8,0xd1,0xca,0x42,0x07,0x6e,0x4d,0xa0,0x42,0xa9,0x10,0x9c,0x43,0x07,0xb7,
1395 0x40,0xd7,0x43,0xa9,0x10,0x9c,0x43,0x07,0x79,0xcb,0x11,0x43,0x62,0xbf,0xd7,0x42,0x09,0x06,0x98,0x42,
1396 0x74,0x43,0xb1,0x8d,0x68,0x43,0x08,0xd7,0x24,0x79,0x43,0xba,0x83,0x6e,0x43,0xa9,0x16,0x7c,0x43,0x56,
1397 0xa1,0x76,0x43,0x74,0x2a,0x7d,0x43,0x44,0x73,0x80,0x43,0x08,0x55,0xd1,0x7e,0x43,0xe3,0xea,0x76,0x43,
1398 0xbc,0x18,0x81,0x43,0x7f,0xa8,0x6e,0x43,0x8f,0x0a,0x84,0x43,0x02,0xfc,0x68,0x43,0x09,0x06,0x92,0x29,
1399 0x8d,0x43,0x73,0xc3,0x67,0x43,0x08,0xa4,0xd9,0x8e,0x43,0xf2,0xa6,0x7a,0x43,0x8f,0x22,0x88,0x43,0x75,
1400 0x2a,0x7d,0x43,0x42,0x7f,0x82,0x43,0x08,0xc8,0x88,0x43,0x09,0x06,0xc1,0x79,0x74,0x43,0x50,0x64,0x89,
1401 0x43,0x08,0x68,0x2d,0x72,0x43,0xee,0x21,0x81,0x43,0xcd,0x97,0x55,0x43,0xe6,0xf1,0x7b,0x43,0x91,0xec,
1402 0x5d,0x43,0xa8,0xc7,0x6a,0x43,0x09,0x06,0xfa,0xa5,0x52,0x43,0x60,0x97,0x7c,0x43,0x08,0x19,0xff,0x50,
1403 0x43,0xe9,0x6e,0x8a,0x43,0xb0,0xbd,0x70,0x43,0x4c,0x51,0x82,0x43,0x04,0xeb,0x69,0x43,0x66,0x0f,0x8e,
1404 0x43,0x09,0x06,0x17,0xbf,0x71,0x43,0x2c,0x58,0x94,0x43,0x08,0x1c,0x96,0x6e,0x43,0x61,0x68,0x99,0x43,
1405 0x2d,0x3a,0x6e,0x43,0xc8,0x81,0x9e,0x43,0xb7,0x9b,0x72,0x43,0x61,0xa4,0xa3,0x43,0x09,0x06,0x30,0xdb,
1406 0x82,0x43,0xdb,0xe9,0x93,0x43,0x08,0x11,0x82,0x84,0x43,0x61,0x68,0x99,0x43,0xe8,0x4a,0x84,0x43,0x8e,
1407 0xa6,0x9e,0x43,0x42,0x7f,0x82,0x43,0x61,0xa4,0xa3,0x43,0x09,0x06,0xc4,0x02,0x85,0x43,0xd1,0x0b,0x92,
1408 0x43,0x08,0xd6,0xb2,0x86,0x43,0x34,0x1e,0x92,0x43,0x4f,0x58,0x87,0x43,0xa4,0xf1,0x92,0x43,0x03,0xd9,
1409 0x87,0x43,0x7b,0xc6,0x94,0x43,0x09,0x06,0x87,0x3e,0x64,0x43,0x31,0x3b,0x93,0x43,0x08,0x3b,0xbf,0x64,
1410 0x43,0x6f,0xf9,0x91,0x43,0x96,0x0b,0x67,0x43,0xc5,0x4a,0x91,0x43,0xcf,0xfe,0x6a,0x43,0x31,0x2f,0x91,
1411 0x43,0x09,0x06,0x16,0x74,0xb5,0x43,0x08,0xec,0x8e,0x43,0x08,0x1b,0x4b,0xb2,0x43,0xee,0x5d,0x8b,0x43,
1412 0x48,0x4d,0xad,0x43,0x12,0xa6,0x8a,0x43,0xf3,0xd7,0xa7,0x43,0x74,0xb8,0x8a,0x43,0x08,0x8c,0xb2,0xa0,
1413 0x43,0xcd,0xf8,0x8a,0x43,0x68,0x46,0x9b,0x43,0x79,0x8f,0x87,0x43,0x49,0xc9,0x96,0x43,0xe9,0x3e,0x82,
1414 0x43,0x08,0x60,0x5c,0x97,0x43,0xa1,0xde,0x8b,0x43,0x4e,0xa0,0x93,0x43,0x31,0x3b,0x93,0x43,0x9f,0xea,
1415 0x8d,0x43,0x27,0x8d,0x99,0x43,0x08,0x07,0xe0,0x8c,0x43,0x06,0x34,0x9b,0x43,0x38,0xe9,0x8c,0x43,0x46,
1416 0x0a,0x9e,0x43,0x3d,0xcc,0x8b,0x43,0xb2,0x06,0xa2,0x43,0x08,0xf1,0x40,0x8a,0x43,0xb0,0x12,0xa4,0x43,
1417 0x39,0xd1,0x88,0x43,0x76,0x43,0xa6,0x43,0xfa,0x06,0x88,0x43,0xa4,0x75,0xa9,0x43,0x08,0x19,0x6c,0x88,
1418 0x43,0x9f,0x9e,0xac,0x43,0x66,0xeb,0x87,0x43,0x44,0x76,0xb0,0x43,0x6b,0xce,0x86,0x43,0x3b,0xbc,0xb4,
1419 0x43,0x08,0xa9,0x8c,0x85,0x43,0x06,0xd0,0xb5,0x43,0xfa,0xee,0x83,0x43,0x74,0xa3,0xb6,0x43,0x3d,0x90,
1420 0x81,0x43,0x31,0xf6,0xb6,0x43,0x08,0x9d,0x61,0x7d,0x43,0xee,0x48,0xb7,0x43,0x3b,0x1f,0x75,0x43,0xcf,
1421 0xe3,0xb6,0x43,0xee,0x6f,0x6d,0x43,0x68,0xe2,0xb5,0x43,0x08,0xd4,0xed,0x6b,0x43,0x87,0x2f,0xb2,0x43,
1422 0x0e,0xc9,0x6b,0x43,0xa7,0x7c,0xae,0x43,0x98,0xfa,0x67,0x43,0xab,0x53,0xab,0x43,0x08,0x25,0x2c,0x64,
1423 0x43,0x33,0xa2,0xa8,0x43,0x40,0x96,0x61,0x43,0xc3,0xc2,0xa5,0x43,0x64,0xde,0x60,0x43,0xfa,0xa2,0xa2,
1424 0x43,0x08,0xb0,0x5d,0x60,0x43,0x06,0x4c,0x9f,0x43,0x9a,0xca,0x5f,0x43,0x38,0x3d,0x9b,0x43,0x3b,0x8f,
1425 0x5c,0x43,0x85,0xb0,0x98,0x43,0x08,0x42,0x36,0x51,0x43,0x3d,0xf0,0x91,0x43,0xcd,0x4f,0x49,0x43,0xdb,
1426 0xb9,0x8b,0x43,0xe0,0xdb,0x44,0x43,0x42,0x8b,0x84,0x43,0x08,0x7e,0xc9,0x44,0x43,0x8a,0x57,0x8d,0x43,
1427 0xbc,0x6c,0x0f,0x43,0x23,0x62,0x8e,0x43,0xf5,0x17,0x07,0x43,0xc5,0x3e,0x8f,0x43,0x09,0x06,0xe0,0xea,
1428 0x76,0x43,0xab,0xef,0xc5,0x43,0x08,0x12,0x00,0x79,0x43,0xab,0xcb,0xbf,0x43,0x79,0xb9,0x6d,0x43,0x7e,
1429 0x8d,0xba,0x43,0xee,0x6f,0x6d,0x43,0x98,0xeb,0xb5,0x43,0x08,0xe0,0x02,0x7b,0x43,0x5f,0x1c,0xb8,0x43,
1430 0x85,0x2c,0x82,0x43,0xe9,0x65,0xb8,0x43,0xd6,0xb2,0x86,0x43,0xc6,0x05,0xb5,0x43,0x08,0x03,0xcd,0x85,
1431 0x43,0x5a,0x39,0xb9,0x43,0xe4,0x4f,0x81,0x43,0xdb,0xd4,0xbf,0x43,0xdf,0x6c,0x82,0x43,0xbc,0x93,0xc5,
1432 0x43,0x09,0x06,0xf0,0xd0,0x22,0x43,0x5d,0x19,0x08,0x43,0x08,0xbc,0xab,0x49,0x43,0x4a,0x35,0x29,0x43,
1433 0xcb,0xf7,0x65,0x43,0xce,0x37,0x45,0x43,0x0e,0x99,0x63,0x43,0x67,0xc6,0x5c,0x43,0x09,0x06,0x05,0x94,
1434 0xab,0x43,0xc2,0x13,0x04,0x43,0x08,0x9f,0x26,0x98,0x43,0x11,0x42,0x25,0x43,0x97,0x00,0x8a,0x43,0x32,
1435 0x32,0x41,0x43,0xf5,0x2f,0x8b,0x43,0xc7,0xc0,0x58,0x43,0x09,0x06,0x8f,0x85,0x48,0x43,0xe0,0xa8,0x8c,
1436 0x43,0x08,0x55,0xaa,0x48,0x43,0xe0,0xa8,0x8c,0x43,0x6b,0x3d,0x49,0x43,0xc1,0x43,0x8c,0x43,0x31,0x62,
1437 0x49,0x43,0xc1,0x43,0x8c,0x43,0x08,0x2f,0xe3,0x2f,0x43,0xad,0xe7,0x98,0x43,0xff,0x0d,0x0d,0x43,0xad,
1438 0xf3,0x9a,0x43,0xf0,0xaf,0xcc,0x42,0x74,0x00,0x97,0x43,0x08,0xbb,0xa2,0xf7,0x42,0x93,0x4d,0x93,0x43,
1439 0x5e,0x19,0x08,0x43,0x5a,0x2a,0x87,0x43,0x23,0x6e,0x10,0x43,0x42,0x97,0x86,0x43,0x08,0xca,0xe8,0x33,
1440 0x43,0x1b,0x3c,0x80,0x43,0x80,0xe8,0x4d,0x43,0xda,0xf4,0x70,0x43,0xae,0x0e,0x4f,0x43,0x2b,0x1b,0x65,
1441 0x43,0x08,0x66,0x96,0x54,0x43,0xa3,0xe1,0x3b,0x43,0x4e,0xc4,0x19,0x43,0xa0,0x1a,0x16,0x43,0x10,0xe2,
1442 0x14,0x43,0x26,0x14,0xe0,0x42,0x08,0x5c,0x91,0x1c,0x43,0xcb,0x27,0xee,0x42,0xa9,0x40,0x24,0x43,0x71,
1443 0x3b,0xfc,0x42,0xf3,0xef,0x2b,0x43,0x8b,0x27,0x05,0x43,0x08,0xe2,0x4b,0x2c,0x43,0x48,0x86,0x07,0x43,
1444 0x79,0x62,0x2f,0x43,0x05,0xe5,0x09,0x43,0x55,0x32,0x34,0x43,0xa0,0xd2,0x09,0x43,0x08,0x74,0xa3,0x36,
1445 0x43,0x3a,0xd1,0x08,0x43,0x7e,0x81,0x38,0x43,0x09,0xd4,0x0a,0x43,0x0d,0xba,0x39,0x43,0xa0,0xea,0x0d,
1446 0x43,0x08,0x6f,0xe4,0x3d,0x43,0x43,0xc7,0x0e,0x43,0xd6,0xe5,0x3e,0x43,0xc4,0x4a,0x11,0x43,0x55,0x7a,
1447 0x40,0x43,0x59,0x72,0x13,0x43,0x08,0x55,0x92,0x44,0x43,0xbf,0x73,0x14,0x43,0x23,0x95,0x46,0x43,0xa5,
1448 0x09,0x17,0x43,0xe0,0xf3,0x48,0x43,0xfe,0x55,0x19,0x43,0x08,0xcd,0x4f,0x49,0x43,0xaa,0x10,0x1c,0x43,
1449 0x61,0x77,0x4b,0x43,0xfe,0x6d,0x1d,0x43,0x80,0xe8,0x4d,0x43,0x2b,0x94,0x1e,0x43,0x08,0x58,0xc9,0x51,
1450 0x43,0x41,0x27,0x1f,0x43,0x9b,0x82,0x53,0x43,0x35,0x72,0x20,0x43,0x53,0xf2,0x54,0x43,0x88,0xcf,0x21,
1451 0x43,0x08,0x7b,0x29,0x55,0x43,0xe8,0x0a,0x25,0x43,0xb2,0x2d,0x58,0x43,0xef,0xe8,0x26,0x43,0x9b,0xb2,
1452 0x5b,0x43,0xd0,0x8f,0x28,0x43,0x08,0x5f,0xef,0x5f,0x43,0xeb,0x11,0x2a,0x43,0xfd,0xdc,0x5f,0x43,0x6e,
1453 0x95,0x2c,0x43,0x3b,0xa7,0x60,0x43,0x2b,0xf4,0x2e,0x43,0x08,0x06,0xbb,0x61,0x43,0xfd,0xe5,0x31,0x43,
1454 0xe7,0x61,0x63,0x43,0xef,0x30,0x33,0x43,0x53,0x52,0x65,0x43,0xa3,0xb1,0x33,0x43,0x08,0x12,0xa0,0x68,
1455 0x43,0x7f,0x69,0x34,0x43,0x40,0xc6,0x69,0x43,0x64,0xff,0x36,0x43,0x7e,0x90,0x6a,0x43,0x71,0xcc,0x39,
1456 0x43,0x08,0xbc,0x5a,0x6b,0x43,0x51,0x73,0x3b,0x43,0xc1,0x49,0x6c,0x43,0xa5,0xd0,0x3c,0x43,0xe0,0xba,
1457 0x6e,0x43,0xb8,0x74,0x3c,0x43,0x08,0x6b,0x1c,0x73,0x43,0x13,0xc1,0x3e,0x43,0x40,0xf6,0x71,0x43,0xce,
1458 0x1f,0x41,0x43,0x55,0x89,0x72,0x43,0x8d,0x7e,0x43,0x43,0x08,0x68,0x2d,0x72,0x43,0x89,0xae,0x4b,0x43,
1459 0xc1,0x79,0x74,0x43,0xcb,0x78,0x4c,0x43,0x55,0xa1,0x76,0x43,0x5b,0xb1,0x4d,0x43,0x08,0xa2,0x38,0x7a,
1460 0x43,0xd1,0x56,0x4e,0x43,0x85,0xb6,0x78,0x43,0xb1,0x15,0x54,0x43,0x83,0xc7,0x77,0x43,0x89,0x0e,0x5c,
1461 0x43,0x08,0xcf,0x46,0x77,0x43,0x0f,0x81,0x5f,0x43,0x1a,0xde,0x7a,0x43,0xce,0xc7,0x5d,0x43,0x42,0x73,
1462 0x80,0x43,0x99,0xc3,0x5a,0x43,0x08,0x85,0x2c,0x82,0x43,0xf6,0xe6,0x59,0x43,0x81,0x3d,0x81,0x43,0x16,
1463 0x10,0x50,0x43,0xd6,0x8e,0x80,0x43,0x5b,0x99,0x49,0x43,0x08,0xc4,0xea,0x80,0x43,0x22,0x95,0x46,0x43,
1464 0xfa,0xe2,0x81,0x43,0xda,0xec,0x43,0x43,0x78,0x77,0x83,0x43,0xe4,0xb2,0x41,0x43,0x08,0x8a,0x27,0x85,
1465 0x43,0x86,0x77,0x3e,0x43,0x0c,0x9f,0x85,0x43,0x07,0xf4,0x3b,0x43,0x8f,0x16,0x86,0x43,0xe6,0x82,0x39,
1466 0x43,0x08,0x85,0x44,0x86,0x43,0x37,0xd9,0x35,0x43,0x1e,0x4f,0x87,0x43,0xe1,0x7b,0x34,0x43,0xdf,0x90,
1467 0x88,0x43,0xb6,0x55,0x33,0x43,0x08,0xae,0x93,0x8a,0x43,0xfd,0xe5,0x31,0x43,0xfa,0x12,0x8a,0x43,0xbf,
1468 0x03,0x2d,0x43,0x19,0x78,0x8a,0x43,0x45,0x5e,0x2c,0x43,0x08,0x03,0xf1,0x8b,0x43,0xac,0x47,0x29,0x43,
1469 0x2f,0x17,0x8d,0x43,0x45,0x46,0x28,0x43,0xc8,0x21,0x8e,0x43,0x30,0xb3,0x27,0x43,0x08,0xa9,0xc8,0x8f,
1470 0x43,0xef,0xe8,0x26,0x43,0xbf,0x5b,0x90,0x43,0x5b,0xc1,0x24,0x43,0x10,0xca,0x90,0x43,0xa0,0x62,0x22,
1471 0x43,0x08,0x26,0x5d,0x91,0x43,0xbb,0xcc,0x1f,0x43,0xf0,0x70,0x92,0x43,0x78,0x13,0x1e,0x43,0x77,0xd7,
1472 0x93,0x43,0x73,0x24,0x1d,0x43,0x08,0x65,0x3f,0x96,0x43,0xce,0x58,0x1b,0x43,0xbe,0x7f,0x96,0x43,0xbf,
1473 0x8b,0x18,0x43,0x60,0x5c,0x97,0x43,0xb6,0xad,0x16,0x43,0x08,0xba,0xa8,0x99,0x43,0x78,0xcb,0x11,0x43,
1474 0x49,0xe1,0x9a,0x43,0x78,0xcb,0x11,0x43,0x01,0x51,0x9c,0x43,0x73,0xdc,0x10,0x43,0x08,0x72,0x24,0x9d,
1475 0x43,0xd2,0xff,0x0f,0x43,0x1c,0xd3,0x9d,0x43,0x07,0xec,0x0e,0x43,0xeb,0xc9,0x9d,0x43,0xe8,0x7a,0x0c,
1476 0x43,0x08,0x60,0x80,0x9d,0x43,0xd7,0xbe,0x08,0x43,0x4d,0xe8,0x9f,0x43,0x86,0x50,0x08,0x43,0x25,0xbd,
1477 0xa1,0x43,0x5b,0x2a,0x07,0x43,0x08,0x99,0x7f,0xa3,0x43,0xc9,0xf1,0x05,0x43,0x48,0x1d,0xa5,0x43,0x86,
1478 0x38,0x04,0x43,0x6c,0x71,0xa6,0x43,0x18,0x59,0x01,0x43,0x08,0x32,0x96,0xa6,0x43,0x6e,0x64,0xff,0x42,
1479 0x48,0x29,0xa7,0x43,0xed,0xcf,0xfd,0x42,0x5f,0xbc,0xa7,0x43,0x71,0x3b,0xfc,0x42,0x08,0xf3,0xe3,0xa9,
1480 0x43,0xf7,0x7d,0xf7,0x42,0xd8,0x6d,0xaa,0x43,0x45,0xe5,0xf2,0x42,0x48,0x41,0xab,0x43,0xcb,0x27,0xee,
1481 0x42,0x08,0x24,0xf9,0xab,0x43,0x52,0x6a,0xe9,0x42,0xee,0x0c,0xad,0x43,0x4c,0x8c,0xe7,0x42,0x1b,0x33,
1482 0xae,0x43,0xcc,0xf7,0xe5,0x42,0x08,0xaa,0x6b,0xaf,0x43,0xe8,0x61,0xe3,0x42,0x90,0xf5,0xaf,0x43,0xc9,
1483 0xf0,0xe0,0x42,0xe0,0x63,0xb0,0x43,0xe5,0x5a,0xde,0x42,0x08,0xaa,0x83,0xb3,0x43,0x29,0x2d,0x09,0x43,
1484 0x6a,0xfe,0x8e,0x43,0xb8,0x74,0x3c,0x43,0xd5,0x06,0x95,0x43,0xe6,0x79,0x67,0x43,0x08,0x2f,0x53,0x97,
1485 0x43,0xe9,0xb0,0x74,0x43,0xa8,0x28,0xa0,0x43,0x43,0xfd,0x76,0x43,0x83,0x28,0xad,0x43,0x17,0x59,0x81,
1486 0x43,0x08,0x3d,0xe7,0xbf,0x43,0x4b,0x8d,0x8c,0x43,0xae,0x96,0xba,0x43,0x66,0x27,0x92,0x43,0x15,0xe0,
1487 0xc7,0x43,0x6f,0x11,0x96,0x43,0x08,0x7e,0x5d,0xb2,0x43,0xdb,0x01,0x98,0x43,0x9e,0x56,0xa0,0x43,0x80,
1488 0xc1,0x97,0x43,0x69,0x2e,0x97,0x43,0x31,0x17,0x8d,0x43,0x09,0x06,0xab,0xa7,0x39,0x43,0x67,0x0f,0x0e,
1489 0x43,0x08,0xdb,0xbc,0x3b,0x43,0xe8,0x92,0x10,0x43,0xb5,0x85,0x3b,0x43,0x97,0x3c,0x14,0x43,0xab,0xa7,
1490 0x39,0x43,0x0c,0x0b,0x18,0x43,0x09,0x06,0xca,0x30,0x40,0x43,0x30,0x3b,0x13,0x43,0x08,0x17,0xc8,0x43,
1491 0x43,0xa5,0x09,0x17,0x43,0x7e,0xc9,0x44,0x43,0x1a,0xd8,0x1a,0x43,0x9d,0x22,0x43,0x43,0x8d,0xa6,0x1e,
1492 0x43,0x09,0x06,0xc8,0x78,0x4c,0x43,0xed,0xc9,0x1d,0x43,0x08,0x0b,0x32,0x4e,0x43,0x22,0xce,0x20,0x43,
1493 0x23,0xc5,0x4e,0x43,0x58,0xd2,0x23,0x43,0x0b,0x32,0x4e,0x43,0x2b,0xc4,0x26,0x43,0x09,0x06,0xec,0x08,
1494 0x58,0x43,0xc7,0xb1,0x26,0x43,0x08,0x02,0x9c,0x58,0x43,0xef,0x00,0x2b,0x43,0xd9,0x64,0x58,0x43,0x02,
1495 0xbd,0x2e,0x43,0x10,0x51,0x57,0x43,0x37,0xc1,0x31,0x43,0x09,0x06,0xcb,0xdf,0x61,0x43,0x4a,0x65,0x31,
1496 0x43,0x08,0xbe,0x2a,0x63,0x43,0xbd,0x33,0x35,0x43,0x32,0xe1,0x62,0x43,0x56,0x4a,0x38,0x43,0xde,0x83,
1497 0x61,0x43,0x3c,0xe0,0x3a,0x43,0x09,0x06,0x1c,0x7e,0x6a,0x43,0x5b,0x39,0x39,0x43,0x08,0x31,0x11,0x6b,
1498 0x43,0x0c,0xd2,0x3d,0x43,0x1c,0x7e,0x6a,0x43,0x13,0xd9,0x42,0x43,0xd9,0xc4,0x68,0x43,0xcb,0x60,0x48,
1499 0x43,0x09,0x06,0xe5,0xc1,0x73,0x43,0x16,0xf8,0x4b,0x43,0x08,0xa6,0xf7,0x72,0x43,0xb1,0xfd,0x4f,0x43,
1500 0x3b,0x07,0x71,0x43,0x4a,0x14,0x53,0x43,0xa2,0xf0,0x6d,0x43,0x7c,0x29,0x55,0x43,0x09,0x06,0x00,0x8d,
1501 0xa6,0x43,0xef,0x21,0x01,0x43,0x08,0x52,0xfb,0xa6,0x43,0xce,0xc8,0x02,0x43,0xe6,0x16,0xa7,0x43,0x51,
1502 0x4c,0x05,0x43,0x3b,0x68,0xa6,0x43,0x4c,0x75,0x08,0x43,0x09,0x06,0xde,0x20,0xa1,0x43,0x86,0x50,0x08,
1503 0x43,0x08,0xd4,0x4e,0xa1,0x43,0xd3,0xe7,0x0b,0x43,0xb5,0xe9,0xa0,0x43,0x59,0x5a,0x0f,0x43,0xba,0xcc,
1504 0x9f,0x43,0x54,0x83,0x12,0x43,0x09,0x06,0x77,0xfb,0x99,0x43,0x6c,0x16,0x13,0x43,0x08,0xde,0xfc,0x9a,
1505 0x43,0x4a,0xbd,0x14,0x43,0x06,0x34,0x9b,0x43,0xfe,0x55,0x19,0x43,0x13,0xe9,0x99,0x43,0x41,0x27,0x1f,
1506 0x43,0x09,0x06,0x46,0xce,0x93,0x43,0x26,0xa5,0x1d,0x43,0x08,0xe7,0xaa,0x94,0x43,0xbb,0xcc,0x1f,0x43,
1507 0x18,0xb4,0x94,0x43,0xa8,0x40,0x24,0x43,0xe2,0xbb,0x93,0x43,0x21,0xfe,0x28,0x43,0x09,0x06,0xb1,0x8e,
1508 0x8d,0x43,0xa8,0x58,0x28,0x43,0x08,0x19,0x90,0x8e,0x43,0x54,0x13,0x2b,0x43,0xa4,0xd9,0x8e,0x43,0x84,
1509 0x40,0x31,0x43,0x46,0xaa,0x8d,0x43,0x29,0x24,0x37,0x43,0x09,0x06,0xd6,0xbe,0x88,0x43,0xef,0x30,0x33,
1510 0x43,0x08,0x0c,0xb7,0x89,0x43,0x0e,0xa2,0x35,0x43,0xc0,0x37,0x8a,0x43,0x7a,0xaa,0x3b,0x43,0xbb,0x48,
1511 0x89,0x43,0xbb,0x7b,0x41,0x43,0x09,0x06,0x3a,0xad,0x82,0x43,0xc4,0x59,0x43,0x43,0x08,0xd2,0xb7,0x83,
1512 0x43,0x2b,0x5b,0x44,0x43,0x35,0xd6,0x85,0x43,0x48,0xf5,0x49,0x43,0x42,0x97,0x86,0x43,0xc4,0xa1,0x4f,
1513 0x43,0x09,0x06,0x9c,0xb3,0x80,0x43,0x48,0x55,0x5a,0x43,0x08,0xff,0xc5,0x80,0x43,0x09,0x73,0x55,0x43,
1514 0x93,0xe1,0x80,0x43,0x0f,0x39,0x53,0x43,0xf1,0xbe,0x7e,0x43,0x18,0xe7,0x4c,0x43,0x09,0x06,0xe0,0x02,
1515 0x7b,0x43,0x92,0xec,0x5d,0x43,0x08,0x09,0x3a,0x7b,0x43,0xf0,0xf7,0x58,0x43,0x09,0x3a,0x7b,0x43,0xe6,
1516 0x31,0x5b,0x43,0xe0,0x02,0x7b,0x43,0xa8,0x4f,0x56,0x43,0x09,0x06,0x39,0x4f,0x7d,0x43,0x3e,0x8f,0x5c,
1517 0x43,0x08,0xe9,0xe0,0x7c,0x43,0x03,0x9c,0x58,0x43,0x1e,0x2b,0x81,0x43,0x7f,0x30,0x5a,0x43,0xff,0x73,
1518 0x7d,0x43,0xf6,0xb6,0x51,0x43,0x09,0x06,0x5c,0xb8,0x52,0x43,0x28,0x21,0x87,0x43,0x08,0xae,0x3e,0x57,
1519 0x43,0x12,0x9a,0x88,0x43,0x23,0xf5,0x56,0x43,0x04,0xf1,0x8b,0x43,0x25,0xfc,0x5b,0x43,0x85,0x74,0x8e,
1520 0x43,0x08,0x2f,0xf2,0x61,0x43,0x8e,0x52,0x90,0x43,0xd9,0xdc,0x6c,0x43,0x85,0x74,0x8e,0x43,0xc6,0x20,
1521 0x69,0x43,0x3d,0xd8,0x8d,0x43,0x08,0x6d,0x8c,0x5a,0x43,0xf5,0x3b,0x8d,0x43,0x3d,0x77,0x58,0x43,0xa1,
1522 0xc6,0x87,0x43,0xf8,0xed,0x5e,0x43,0x5e,0x0d,0x86,0x43,0x09,0x06,0xde,0xcc,0x92,0x43,0xf7,0x17,0x87,
1523 0x43,0x08,0xb6,0x89,0x90,0x43,0xae,0x87,0x88,0x43,0x4a,0xa5,0x90,0x43,0xa1,0xde,0x8b,0x43,0xf9,0x2a,
1524 0x8e,0x43,0x23,0x62,0x8e,0x43,0x08,0xf5,0x2f,0x8b,0x43,0x5c,0x49,0x90,0x43,0x35,0xd6,0x85,0x43,0x8e,
1525 0x46,0x8e,0x43,0x3d,0xb4,0x87,0x43,0x47,0xaa,0x8d,0x43,0x08,0x6a,0xfe,0x8e,0x43,0xff,0x0d,0x8d,0x43,
1526 0xbb,0x6c,0x8f,0x43,0xf7,0x17,0x87,0x43,0x5c,0x31,0x8c,0x43,0xb2,0x5e,0x85,0x43,0x09,0x06,0x60,0x38,
1527 0x91,0x43,0x69,0x5d,0x7a,0x43,0x08,0x34,0x1e,0x92,0x43,0x1e,0x5b,0x89,0x43,0x04,0x63,0x7e,0x43,0x5e,
1528 0x01,0x84,0x43,0x59,0x2a,0x87,0x43,0x0d,0xcf,0x8d,0x43,0x09,0x03,0x04,0x06,0x5a,0x18,0x63,0x43,0x82,
1529 0x79,0x8b,0x43,0x08,0x25,0x2c,0x64,0x43,0x82,0x79,0x8b,0x43,0x2a,0x1b,0x65,0x43,0x9d,0xef,0x8a,0x43,
1530 0x2a,0x1b,0x65,0x43,0xc1,0x37,0x8a,0x43,0x08,0x2a,0x1b,0x65,0x43,0x17,0x89,0x89,0x43,0x25,0x2c,0x64,
1531 0x43,0x31,0xff,0x88,0x43,0x5a,0x18,0x63,0x43,0x31,0xff,0x88,0x43,0x08,0xf3,0x16,0x62,0x43,0x31,0xff,
1532 0x88,0x43,0xee,0x27,0x61,0x43,0x17,0x89,0x89,0x43,0xee,0x27,0x61,0x43,0xc1,0x37,0x8a,0x43,0x08,0xee,
1533 0x27,0x61,0x43,0x9d,0xef,0x8a,0x43,0xf3,0x16,0x62,0x43,0x82,0x79,0x8b,0x43,0x5a,0x18,0x63,0x43,0x82,
1534 0x79,0x8b,0x43,0x09,0x06,0x4f,0x64,0x89,0x43,0x82,0x79,0x8b,0x43,0x08,0x34,0xee,0x89,0x43,0x82,0x79,
1535 0x8b,0x43,0x85,0x5c,0x8a,0x43,0x9d,0xef,0x8a,0x43,0x85,0x5c,0x8a,0x43,0xc1,0x37,0x8a,0x43,0x08,0x85,
1536 0x5c,0x8a,0x43,0x17,0x89,0x89,0x43,0x34,0xee,0x89,0x43,0x31,0xff,0x88,0x43,0x4f,0x64,0x89,0x43,0x31,
1537 0xff,0x88,0x43,0x08,0x9c,0xe3,0x88,0x43,0x31,0xff,0x88,0x43,0x19,0x6c,0x88,0x43,0x17,0x89,0x89,0x43,
1538 0x19,0x6c,0x88,0x43,0xc1,0x37,0x8a,0x43,0x08,0x19,0x6c,0x88,0x43,0x9d,0xef,0x8a,0x43,0x9c,0xe3,0x88,
1539 0x43,0x82,0x79,0x8b,0x43,0x4f,0x64,0x89,0x43,0x82,0x79,0x8b,0x43,0x09,0x02,0x04,0x06,0x19,0x60,0x86,
1540 0x43,0xec,0xed,0xa3,0x43,0x08,0x35,0xd6,0x85,0x43,0x76,0x43,0xa6,0x43,0x93,0xe1,0x80,0x43,0x57,0x02,
1541 0xac,0x43,0x61,0xd8,0x80,0x43,0x87,0x17,0xae,0x43,0x08,0xa5,0x85,0x80,0x43,0xc3,0xfe,0xaf,0x43,0xce,
1542 0xbc,0x80,0x43,0x83,0x40,0xb1,0x43,0xa5,0x91,0x82,0x43,0x79,0x6e,0xb1,0x43,0x08,0x23,0x26,0x84,0x43,
1543 0x40,0x93,0xb1,0x43,0x30,0xe7,0x84,0x43,0xbe,0x1b,0xb1,0x43,0x11,0x82,0x84,0x43,0xab,0x6b,0xaf,0x43,
1544 0x08,0xb7,0x41,0x84,0x43,0x3b,0x98,0xae,0x43,0xb7,0x41,0x84,0x43,0xc3,0xf2,0xad,0x43,0xa1,0xae,0x83,
1545 0x43,0x83,0x28,0xad,0x43,0x08,0xb2,0x52,0x83,0x43,0x80,0x39,0xac,0x43,0x81,0x49,0x83,0x43,0xf0,0x00,
1546 0xab,0x43,0xe4,0x67,0x85,0x43,0x76,0x4f,0xa8,0x43,0x08,0x9c,0xd7,0x86,0x43,0xd1,0x83,0xa6,0x43,0xec,
1547 0x45,0x87,0x43,0x01,0x75,0xa2,0x43,0x19,0x60,0x86,0x43,0xec,0xed,0xa3,0x43,0x09,0x06,0xd9,0xdc,0x6c,
1548 0x43,0x14,0x25,0xa4,0x43,0x08,0xa2,0xf0,0x6d,0x43,0x9f,0x7a,0xa6,0x43,0x47,0xec,0x77,0x43,0x80,0x39,
1549 0xac,0x43,0xa9,0xfe,0x77,0x43,0xb0,0x4e,0xae,0x43,0x08,0x23,0xa4,0x78,0x43,0xea,0x35,0xb0,0x43,0xd2,
1550 0x35,0x78,0x43,0xab,0x77,0xb1,0x43,0xc1,0x79,0x74,0x43,0xa2,0xa5,0xb1,0x43,0x08,0xc6,0x50,0x71,0x43,
1551 0x68,0xca,0xb1,0x43,0xab,0xce,0x6f,0x43,0xe7,0x52,0xb1,0x43,0xea,0x98,0x70,0x43,0xd4,0xa2,0xaf,0x43,
1552 0x08,0x9d,0x19,0x71,0x43,0x96,0xd8,0xae,0x43,0x9d,0x19,0x71,0x43,0xec,0x29,0xae,0x43,0xca,0x3f,0x72,
1553 0x43,0xab,0x5f,0xad,0x43,0x08,0xa6,0xf7,0x72,0x43,0xa7,0x70,0xac,0x43,0x09,0x0a,0x73,0x43,0x17,0x38,
1554 0xab,0x43,0x44,0xcd,0x6e,0x43,0x9f,0x86,0xa8,0x43,0x08,0xd4,0xed,0x6b,0x43,0xf8,0xba,0xa6,0x43,0x31,
1555 0x11,0x6b,0x43,0x2a,0xac,0xa2,0x43,0xd9,0xdc,0x6c,0x43,0x14,0x25,0xa4,0x43,0x09,0x01,0x05,0x06,0x66,
1556 0x5d,0x7a,0x43,0x74,0xeb,0xc2,0x43,0x08,0x09,0x22,0x77,0x43,0x50,0xbb,0xc7,0x43,0xe9,0xe0,0x7c,0x43,
1557 0xf5,0x86,0xc9,0x43,0x8f,0x94,0x7a,0x43,0xc5,0x95,0xcd,0x43,0x09,0x06,0x08,0x98,0x80,0x43,0x6b,0x19,
1558 0xc3,0x43,0x08,0xb7,0x35,0x82,0x43,0x79,0xf2,0xc7,0x43,0xf1,0xbe,0x7e,0x43,0x1e,0xbe,0xc9,0x43,0x73,
1559 0x7c,0x80,0x43,0xec,0xcc,0xcd,0x43,0x09,0x06,0x28,0xab,0x7d,0x43,0xae,0xde,0xc6,0x43,0x08,0x1e,0xcd,
1560 0x7b,0x43,0x8a,0xa2,0xc9,0x43,0x30,0x89,0x7f,0x43,0x5c,0x94,0xcc,0x43,0x28,0xab,0x7d,0x43,0x42,0x2a,
1561 0xcf,0x43,0x09,0x01,0x05,0x06,0x24,0x14,0xe0,0x42,0xf5,0x77,0x97,0x43,0x08,0xf7,0x1d,0xe7,0x42,0x74,
1562 0x00,0x97,0x43,0x4d,0x93,0xec,0x42,0xdb,0xf5,0x95,0x43,0x29,0x4b,0xed,0x42,0xcd,0x34,0x95,0x43,0x09,
1563 0x06,0x29,0x7b,0xf5,0x42,0x6f,0x1d,0x98,0x43,0x08,0xe4,0xf1,0xfb,0x42,0x61,0x5c,0x97,0x43,0xdb,0x7d,
1564 0x01,0x43,0xb2,0xbe,0x95,0x43,0x55,0x23,0x02,0x43,0xe7,0xaa,0x94,0x43,0x09,0x06,0x98,0xdc,0x03,0x43,
1565 0xbe,0x8b,0x98,0x43,0x08,0x66,0xdf,0x05,0x43,0x47,0xe6,0x97,0x43,0xae,0x87,0x08,0x43,0x98,0x48,0x96,
1566 0x43,0x61,0x08,0x09,0x43,0xd6,0x06,0x95,0x43,0x09,0x06,0x31,0x0b,0x0b,0x43,0x8e,0x82,0x98,0x43,0x08,
1567 0xdb,0xc5,0x0d,0x43,0x80,0xc1,0x97,0x43,0xd6,0xee,0x10,0x43,0xa9,0xec,0x95,0x43,0x79,0xcb,0x11,0x43,
1568 0x55,0x8f,0x94,0x43,0x09,0x06,0xd1,0x2f,0x18,0x43,0xdb,0x01,0x98,0x43,0x08,0xad,0xe7,0x18,0x43,0x38,
1569 0x25,0x97,0x43,0x8a,0x9f,0x19,0x43,0x80,0xb5,0x95,0x43,0xd6,0x1e,0x19,0x43,0xe0,0xd8,0x94,0x43,0x09,
1570 0x06,0x9a,0x5b,0x1d,0x43,0x58,0x8a,0x97,0x43,0x08,0x01,0x5d,0x1e,0x43,0xf1,0x88,0x96,0x43,0x2f,0x83,
1571 0x1f,0x43,0x19,0xb4,0x94,0x43,0x19,0xf0,0x1e,0x43,0x6f,0x05,0x94,0x43,0x09,0x06,0x0b,0x53,0x24,0x43,
1572 0xae,0xdb,0x96,0x43,0x08,0x25,0xd5,0x25,0x43,0x50,0xac,0x95,0x43,0x53,0xfb,0x26,0x43,0x8a,0x7b,0x93,
1573 0x43,0x76,0x43,0x26,0x43,0xb7,0x95,0x92,0x43,0x09,0x06,0x76,0x5b,0x2a,0x43,0x47,0xda,0x95,0x43,0x08,
1574 0xf3,0xef,0x2b,0x43,0x10,0xe2,0x94,0x43,0x6d,0x95,0x2c,0x43,0xae,0xc3,0x92,0x43,0x68,0xa6,0x2b,0x43,
1575 0x47,0xc2,0x91,0x43,0x09,0x06,0x36,0xc1,0x31,0x43,0x2c,0x58,0x94,0x43,0x08,0x8c,0x1e,0x33,0x43,0x31,
1576 0x3b,0x93,0x43,0x79,0x7a,0x33,0x43,0xff,0x25,0x91,0x43,0xd9,0x9d,0x32,0x43,0xc1,0x5b,0x90,0x43,0x09,
1577 0x06,0x25,0x35,0x36,0x43,0x31,0x3b,0x93,0x43,0x08,0x3f,0xb7,0x37,0x43,0xc1,0x67,0x92,0x43,0xe0,0x93,
1578 0x38,0x43,0xae,0xb7,0x90,0x43,0x7e,0x81,0x38,0x43,0x0d,0xdb,0x8f,0x43,0x09,0x06,0xb5,0x85,0x3b,0x43,
1579 0xe4,0xaf,0x91,0x43,0x08,0xcf,0x07,0x3d,0x43,0x9d,0x13,0x91,0x43,0xbc,0x63,0x3d,0x43,0x47,0xb6,0x8f,
1580 0x43,0xe5,0x9a,0x3d,0x43,0x74,0xd0,0x8e,0x43,0x09,0x06,0xae,0xc6,0x42,0x43,0xa4,0xd9,0x8e,0x43,0x08,
1581 0xca,0x48,0x44,0x43,0xfa,0x2a,0x8e,0x43,0xa2,0x11,0x44,0x43,0x9d,0xfb,0x8c,0x43,0x55,0x92,0x44,0x43,
1582 0x0d,0xc3,0x8b,0x43,0x09,0x06,0x39,0x10,0xc3,0x43,0x34,0x36,0x96,0x43,0x08,0x92,0x44,0xc1,0x43,0xe4,
1583 0xc7,0x95,0x43,0x6f,0xf0,0xbf,0x43,0x4b,0xbd,0x94,0x43,0x47,0xb9,0xbf,0x43,0x0b,0xf3,0x93,0x43,0x09,
1584 0x06,0x8f,0x49,0xbe,0x43,0xb7,0xad,0x96,0x43,0x08,0x11,0xb5,0xbc,0x43,0x77,0xe3,0x95,0x43,0x9c,0xf2,
1585 0xba,0x43,0xfa,0x4e,0x94,0x43,0xae,0x96,0xba,0x43,0x31,0x3b,0x93,0x43,0x09,0x06,0xdb,0xb0,0xb9,0x43,
1586 0x10,0xee,0x96,0x43,0x08,0x42,0xa6,0xb8,0x43,0xc8,0x51,0x96,0x43,0x50,0x5b,0xb7,0x43,0x19,0xb4,0x94,
1587 0x43,0xf7,0x1a,0xb7,0x43,0x58,0x72,0x93,0x43,0x09,0x06,0xf2,0x2b,0xb6,0x43,0x10,0xee,0x96,0x43,0x08,
1588 0x9d,0xce,0xb4,0x43,0x04,0x2d,0x96,0x43,0xed,0x30,0xb3,0x43,0x2c,0x58,0x94,0x43,0xce,0xcb,0xb2,0x43,
1589 0xd6,0xfa,0x92,0x43,0x09,0x06,0x5a,0x09,0xb1,0x43,0x19,0xc0,0x96,0x43,0x08,0x6c,0xad,0xb0,0x43,0x77,
1590 0xe3,0x95,0x43,0x7e,0x51,0xb0,0x43,0xc0,0x73,0x94,0x43,0xd8,0x91,0xb0,0x43,0x1e,0x97,0x93,0x43,0x09,
1591 0x06,0x48,0x4d,0xad,0x43,0xbe,0x7f,0x96,0x43,0x08,0x95,0xcc,0xac,0x43,0x58,0x7e,0x95,0x43,0x4d,0x30,
1592 0xac,0x43,0x80,0xa9,0x93,0x43,0xd8,0x79,0xac,0x43,0xd6,0xfa,0x92,0x43,0x09,0x06,0x90,0xd1,0xa9,0x43,
1593 0x14,0xd1,0x95,0x43,0x08,0x83,0x10,0xa9,0x43,0xb7,0xa1,0x94,0x43,0x3b,0x74,0xa8,0x43,0xf1,0x70,0x92,
1594 0x43,0x29,0xd0,0xa8,0x43,0x1e,0x8b,0x91,0x43,0x09,0x06,0x5a,0xcd,0xa6,0x43,0x8a,0x87,0x95,0x43,0x08,
1595 0x1c,0x03,0xa6,0x43,0x23,0x86,0x94,0x43,0x5f,0xb0,0xa5,0x43,0xc1,0x67,0x92,0x43,0xe1,0x27,0xa6,0x43,
1596 0x8a,0x6f,0x91,0x43,0x09,0x06,0xd4,0x5a,0xa3,0x43,0x2c,0x58,0x94,0x43,0x08,0x29,0xac,0xa2,0x43,0x31,
1597 0x3b,0x93,0x43,0x32,0x7e,0xa2,0x43,0xff,0x25,0x91,0x43,0x83,0xec,0xa2,0x43,0x8e,0x52,0x90,0x43,0x09,
1598 0x06,0xf8,0x96,0xa0,0x43,0x1e,0x97,0x93,0x43,0x08,0xeb,0xd5,0x9f,0x43,0x7b,0xba,0x92,0x43,0x99,0x67,
1599 0x9f,0x43,0x9d,0x13,0x91,0x43,0x99,0x67,0x9f,0x43,0xfa,0x36,0x90,0x43,0x09,0x06,0xeb,0xc9,0x9d,0x43,
1600 0xc8,0x39,0x92,0x43,0x08,0xde,0x08,0x9d,0x43,0xb2,0xa6,0x91,0x43,0xe6,0xda,0x9c,0x43,0x2c,0x40,0x90,
1601 0x43,0x52,0xbf,0x9c,0x43,0x5a,0x5a,0x8f,0x43,0x09,0x06,0x37,0x3d,0x9b,0x43,0x85,0x80,0x90,0x43,0x08,
1602 0x2a,0x7c,0x9a,0x43,0xdb,0xd1,0x8f,0x43,0xf0,0xa0,0x9a,0x43,0x7d,0xa2,0x8e,0x43,0x65,0x57,0x9a,0x43,
1603 0xee,0x69,0x8d,0x43,0x09,0x02,0x04,0x06,0x2a,0xf4,0x2e,0x42,0x04,0x21,0x94,0x43,0x08,0x0d,0x8a,0x31,
1604 0x42,0x9f,0x0e,0x94,0x43,0xf3,0x1f,0x34,0x42,0x3d,0xfc,0x93,0x43,0x63,0xff,0x36,0x42,0xa9,0xe0,0x93,
1605 0x43,0x08,0xb5,0x34,0x5d,0x42,0x0b,0xf3,0x93,0x43,0x6d,0xa4,0x5e,0x42,0x03,0x39,0x98,0x43,0xe7,0x31,
1606 0x5b,0x42,0x93,0x89,0x9d,0x43,0x08,0x02,0x9c,0x58,0x42,0xd4,0x5a,0xa3,0x43,0x38,0x70,0x53,0x42,0x14,
1607 0x49,0xaa,0x43,0xf8,0xed,0x5e,0x42,0x83,0x28,0xad,0x43,0x08,0xea,0x68,0x68,0x42,0x20,0x22,0xaf,0x43,
1608 0x12,0xb8,0x6c,0x42,0xb5,0x49,0xb1,0x43,0x2a,0x4b,0x6d,0x42,0x0d,0x96,0xb3,0x43,0x07,0x2a,0x4b,0x6d,
1609 0x42,0xc6,0x05,0xb5,0x43,0x08,0x87,0x6e,0x6c,0x42,0x68,0xee,0xb7,0x43,0x1c,0x66,0x66,0x42,0x31,0x0e,
1610 0xbb,0x43,0x57,0x11,0x5e,0x42,0x8f,0x49,0xbe,0x43,0x08,0x66,0x96,0x54,0x42,0xb9,0x5c,0xb8,0x43,0x2c,
1611 0x2b,0x3c,0x42,0x68,0xd6,0xb3,0x43,0x2a,0xf4,0x2e,0x42,0x6d,0xad,0xb0,0x43,0x07,0x2a,0xf4,0x2e,0x42,
1612 0x61,0xa4,0xa3,0x43,0x08,0x55,0x1a,0x30,0x42,0xf0,0xd0,0xa2,0x43,0xf8,0xf6,0x30,0x42,0xb2,0x06,0xa2,
1613 0x43,0x98,0xd3,0x31,0x42,0xd6,0x4e,0xa1,0x43,0x08,0x1c,0x6f,0x38,0x42,0x2a,0x94,0x9e,0x43,0xc1,0x22,
1614 0x36,0x42,0xf5,0x9b,0x9d,0x43,0x2a,0xf4,0x2e,0x42,0x6a,0x52,0x9d,0x43,0x07,0x2a,0xf4,0x2e,0x42,0x57,
1615 0xa2,0x9b,0x43,0x08,0xab,0x8f,0x35,0x42,0x8a,0xab,0x9b,0x43,0xe9,0x71,0x3a,0x42,0xb2,0xe2,0x9b,0x43,
1616 0xb7,0x74,0x3c,0x42,0x34,0x5a,0x9c,0x43,0x08,0x23,0x7d,0x42,0x42,0x0b,0x2f,0x9e,0x43,0xe5,0x9a,0x3d,
1617 0x42,0x38,0x6d,0xa3,0x43,0x36,0xd9,0x35,0x42,0xf3,0xd7,0xa7,0x43,0x08,0x12,0x61,0x2e,0x42,0xb0,0x42,
1618 0xac,0x43,0x63,0xff,0x36,0x42,0xdd,0x74,0xaf,0x43,0x1e,0xa6,0x45,0x42,0x44,0x82,0xb2,0x43,0x08,0x74,
1619 0x1b,0x4b,0x42,0x79,0x7a,0xb3,0x43,0x10,0x21,0x4f,0x42,0x2a,0x18,0xb5,0x43,0xdb,0x4c,0x54,0x42,0x91,
1620 0x19,0xb6,0x43,0x08,0xee,0x3f,0x65,0x42,0x5f,0x28,0xba,0x43,0xa7,0xaf,0x66,0x42,0xb9,0x50,0xb6,0x43,
1621 0x14,0x58,0x5c,0x42,0xca,0xdc,0xb1,0x43,0x08,0x2c,0x8b,0x4c,0x42,0x4e,0x30,0xac,0x43,0x19,0xcf,0x48,
1622 0x42,0x2a,0xd0,0xa8,0x43,0xbc,0xab,0x49,0x42,0xa9,0x4c,0xa6,0x43,0x08,0x61,0x5f,0x47,0x42,0xfa,0xa2,
1623 0xa2,0x43,0xa7,0xaf,0x66,0x42,0x85,0x98,0x94,0x43,0x2a,0xf4,0x2e,0x42,0xc3,0x62,0x95,0x43,0x07,0x2a,
1624 0xf4,0x2e,0x42,0x04,0x21,0x94,0x43,0x09,0x06,0xd0,0xfe,0xea,0x41,0x9f,0x0e,0x94,0x43,0x08,0xdc,0xe3,
1625 0xf1,0x41,0xe9,0x9e,0x92,0x43,0xd2,0xe7,0x0b,0x42,0xd6,0x06,0x95,0x43,0x2a,0xf4,0x2e,0x42,0x04,0x21,
1626 0x94,0x43,0x07,0x2a,0xf4,0x2e,0x42,0xc3,0x62,0x95,0x43,0x08,0x87,0x17,0x2e,0x42,0xc3,0x62,0x95,0x43,
1627 0xe7,0x3a,0x2d,0x42,0xf5,0x6b,0x95,0x43,0x44,0x5e,0x2c,0x42,0xf5,0x6b,0x95,0x43,0x08,0xd1,0x47,0x1c,
1628 0x42,0x19,0xc0,0x96,0x43,0x66,0xdf,0x05,0x42,0x38,0x19,0x95,0x43,0x12,0x6a,0x00,0x42,0xb2,0xbe,0x95,
1629 0x43,0x08,0xbb,0x6b,0xea,0x41,0xd6,0x12,0x97,0x43,0x2d,0x82,0xfa,0x41,0x61,0x74,0x9b,0x43,0x7e,0x72,
1630 0x06,0x42,0x8a,0xab,0x9b,0x43,0x08,0xc8,0x39,0x12,0x42,0x4e,0xd0,0x9b,0x43,0x53,0xe3,0x22,0x42,0xc3,
1631 0x86,0x9b,0x43,0x2a,0xf4,0x2e,0x42,0x57,0xa2,0x9b,0x43,0x07,0x2a,0xf4,0x2e,0x42,0x6a,0x52,0x9d,0x43,
1632 0x08,0x01,0xa5,0x2a,0x42,0xa4,0x2d,0x9d,0x43,0x96,0x9c,0x24,0x42,0x06,0x40,0x9d,0x43,0x8a,0xb7,0x1d,
1633 0x42,0x9a,0x5b,0x9d,0x43,0x08,0x6b,0x16,0x13,0x42,0xcd,0x64,0x9d,0x43,0x42,0xc7,0x0e,0x42,0x9a,0x5b,
1634 0x9d,0x43,0x23,0x26,0x04,0x42,0xcd,0x64,0x9d,0x43,0x08,0xe6,0x91,0xeb,0x41,0x38,0x49,0x9d,0x43,0x73,
1635 0x7b,0xdb,0x41,0xf5,0x83,0x99,0x43,0x7f,0x60,0xe2,0x41,0x0b,0x0b,0x98,0x43,0x08,0x7f,0x60,0xe2,0x41,
1636 0xec,0x99,0x95,0x43,0xe3,0x5a,0xde,0x41,0xbe,0x7f,0x96,0x43,0xd0,0xfe,0xea,0x41,0x9f,0x0e,0x94,0x43,
1637 0x07,0xd0,0xfe,0xea,0x41,0x9f,0x0e,0x94,0x43,0x09,0x06,0x2a,0xf4,0x2e,0x42,0x6d,0xad,0xb0,0x43,0x08,
1638 0xd4,0x7e,0x29,0x42,0xab,0x6b,0xaf,0x43,0x4e,0x0c,0x26,0x42,0x44,0x6a,0xae,0x43,0x38,0x79,0x25,0x42,
1639 0xd4,0x96,0xad,0x43,0x08,0x25,0xbd,0x21,0x42,0xe2,0x4b,0xac,0x43,0x49,0x35,0x29,0x42,0x9a,0x97,0xa7,
1640 0x43,0x2a,0xf4,0x2e,0x42,0x61,0xa4,0xa3,0x43,0x07,0x2a,0xf4,0x2e,0x42,0x6d,0xad,0xb0,0x43,0x09,0x06,
1641 0x1d,0xe5,0x7f,0x43,0x87,0x4a,0xe6,0x43,0x08,0x86,0x20,0x80,0x43,0x57,0x41,0xe6,0x43,0x7d,0x4e,0x80,
1642 0x43,0x25,0x38,0xe6,0x43,0xa5,0x85,0x80,0x43,0xf3,0x2e,0xe6,0x43,0x08,0x35,0xca,0x83,0x43,0xd4,0xc9,
1643 0xe5,0x43,0x9c,0xd7,0x86,0x43,0x44,0x91,0xe4,0x43,0xd5,0xca,0x8a,0x43,0x91,0x1c,0xe6,0x43,0x08,0x53,
1644 0x5f,0x8c,0x43,0xf8,0x1d,0xe7,0x43,0x2f,0x17,0x8d,0x43,0x4e,0x7b,0xe8,0x43,0x92,0x29,0x8d,0x43,0x2f,
1645 0x22,0xea,0x43,0x07,0x92,0x29,0x8d,0x43,0x44,0xb5,0xea,0x43,0x08,0xfe,0x0d,0x8d,0x43,0x2a,0x4b,0xed,
1646 0x43,0xe3,0x8b,0x8b,0x43,0x55,0x7d,0xf0,0x43,0xec,0x51,0x89,0x43,0x72,0x0b,0xf4,0x43,0x08,0xcd,0xd4,
1647 0x84,0x43,0x9d,0x55,0xfb,0x43,0xc9,0xe5,0x83,0x43,0x74,0x1e,0xfb,0x43,0x73,0x94,0x84,0x43,0x5a,0x90,
1648 0xf7,0x43,0x08,0xe8,0x62,0x88,0x43,0xfd,0x30,0xee,0x43,0x39,0xc5,0x86,0x43,0xdd,0xbf,0xeb,0x43,0x35,
1649 0xbe,0x81,0x43,0x40,0xde,0xed,0x43,0x08,0x4f,0x34,0x81,0x43,0x36,0x0c,0xee,0x43,0x08,0x98,0x80,0x43,
1650 0xfd,0x30,0xee,0x43,0x1d,0xe5,0x7f,0x43,0x91,0x4c,0xee,0x43,0x07,0x1d,0xe5,0x7f,0x43,0x91,0x40,0xec,
1651 0x43,0x08,0x35,0xbe,0x81,0x43,0x06,0xf7,0xeb,0x43,0x15,0x65,0x83,0x43,0x49,0xa4,0xeb,0x43,0x1e,0x43,
1652 0x85,0x43,0xbe,0x5a,0xeb,0x43,0x08,0xae,0x93,0x8a,0x43,0xfd,0x18,0xea,0x43,0x42,0x97,0x86,0x43,0x5f,
1653 0x67,0xf4,0x43,0xa9,0x98,0x87,0x43,0xd4,0x1d,0xf4,0x43,0x08,0x5c,0x25,0x8a,0x43,0xcf,0x16,0xef,0x43,
1654 0x46,0xaa,0x8d,0x43,0x5a,0x3c,0xe9,0x43,0x19,0x6c,0x88,0x43,0x53,0x5e,0xe7,0x43,0x08,0xc4,0x02,0x85,
1655 0x43,0x96,0x0b,0xe7,0x43,0x85,0x2c,0x82,0x43,0x83,0x67,0xe7,0x43,0x1d,0xe5,0x7f,0x43,0x72,0xc3,0xe7,
1656 0x43,0x07,0x1d,0xe5,0x7f,0x43,0x87,0x4a,0xe6,0x43,0x09,0x06,0xfd,0x24,0x6c,0x43,0xd9,0x94,0xe0,0x43,
1657 0x08,0xfa,0x6c,0x78,0x43,0xd1,0xc2,0xe0,0x43,0x25,0x5c,0x6c,0x43,0x25,0x44,0xe8,0x43,0x1d,0xe5,0x7f,
1658 0x43,0x87,0x4a,0xe6,0x43,0x07,0x1d,0xe5,0x7f,0x43,0x72,0xc3,0xe7,0x43,0x08,0xa6,0x27,0x7b,0x43,0x91,
1659 0x28,0xe8,0x43,0xbc,0xa2,0x77,0x43,0xb0,0x8d,0xe8,0x43,0xc6,0x68,0x75,0x43,0x57,0x4d,0xe8,0x43,0x08,
1660 0xe0,0xd2,0x72,0x43,0xab,0x9e,0xe7,0x43,0x50,0x9a,0x71,0x43,0x2a,0x27,0xe7,0x43,0xea,0x98,0x70,0x43,
1661 0x57,0x35,0xe4,0x43,0x08,0x94,0x3b,0x6f,0x43,0x14,0x7c,0xe2,0x43,0xff,0x13,0x6d,0x43,0x06,0xbb,0xe1,
1662 0x43,0xcf,0xfe,0x6a,0x43,0x06,0xbb,0xe1,0x43,0x08,0x44,0x9d,0x66,0x43,0x77,0x8e,0xe2,0x43,0x3b,0xef,
1663 0x6c,0x43,0x91,0x10,0xe4,0x43,0xfd,0x24,0x6c,0x43,0xb0,0x81,0xe6,0x43,0x08,0x96,0x23,0x6b,0x43,0xee,
1664 0x57,0xe9,0x43,0xca,0x0f,0x6a,0x43,0x5f,0x37,0xec,0x43,0x55,0x71,0x6e,0x43,0x9f,0x01,0xed,0x43,0x08,
1665 0xdb,0xfb,0x75,0x43,0x3b,0xef,0xec,0x43,0x09,0x3a,0x7b,0x43,0xb0,0xa5,0xec,0x43,0x1d,0xe5,0x7f,0x43,
1666 0x91,0x40,0xec,0x43,0x07,0x1d,0xe5,0x7f,0x43,0x91,0x4c,0xee,0x43,0x08,0xa9,0x16,0x7c,0x43,0xb0,0xb1,
1667 0xee,0x43,0x47,0xec,0x77,0x43,0xd9,0xe8,0xee,0x43,0x1e,0x9d,0x73,0x43,0xcf,0x16,0xef,0x43,0x08,0x0e,
1668 0xc9,0x6b,0x43,0xee,0x7b,0xef,0x43,0x7e,0x90,0x6a,0x43,0xfd,0x30,0xee,0x43,0x01,0xfc,0x68,0x43,0x4e,
1669 0x93,0xec,0x43,0x08,0x31,0xf9,0x66,0x43,0x4e,0x87,0xea,0x43,0x31,0x11,0x6b,0x43,0xd4,0xd5,0xe7,0x43,
1670 0xd9,0xc4,0x68,0x43,0xd4,0xc9,0xe5,0x43,0x08,0xe5,0x79,0x67,0x43,0x77,0x9a,0xe4,0x43,0x44,0x9d,0x66,
1671 0x43,0xab,0x86,0xe3,0x43,0x7e,0x78,0x66,0x43,0x0b,0xaa,0xe2,0x43,0x07,0x7e,0x78,0x66,0x43,0x57,0x29,
1672 0xe2,0x43,0x08,0xa7,0xaf,0x66,0x43,0xbe,0x1e,0xe1,0x43,0x87,0x56,0x68,0x43,0x77,0x82,0xe0,0x43,0xfd,
1673 0x24,0x6c,0x43,0xd9,0x94,0xe0,0x43,0x09,0x06,0xc4,0x41,0xbf,0x43,0x85,0xc0,0x72,0x42,0x08,0x73,0xdf,
1674 0xc0,0x43,0xf4,0x76,0x72,0x42,0x97,0x33,0xc2,0x43,0x85,0xc0,0x72,0x42,0xb2,0xb5,0xc3,0x43,0x64,0x56,
1675 0x75,0x42,0x08,0x03,0x24,0xc4,0x43,0x5e,0x7f,0x78,0x42,0xfa,0x51,0xc4,0x43,0x01,0x85,0x7c,0x42,0x5c,
1676 0x64,0xc4,0x43,0xa0,0xb3,0x80,0x42,0x07,0x5c,0x64,0xc4,0x43,0x10,0x93,0x83,0x42,0x08,0xc8,0x48,0xc4,
1677 0x43,0x1c,0x78,0x8a,0x42,0x27,0x6c,0xc3,0x43,0xaf,0xcf,0x94,0x42,0x23,0x7d,0xc2,0x43,0x99,0x9c,0xa4,
1678 0x42,0x08,0x3d,0xe7,0xbf,0x43,0xfb,0xfd,0xb5,0x42,0xb3,0x9d,0xbf,0x43,0x88,0x17,0xae,0x42,0xc4,0x41,
1679 0xbf,0x43,0x69,0x76,0xa3,0x42,0x07,0xc4,0x41,0xbf,0x43,0xac,0xc8,0x8f,0x42,0x08,0x4f,0x8b,0xbf,0x43,
1680 0xed,0x81,0x91,0x42,0xe4,0xa6,0xbf,0x43,0x5d,0x61,0x94,0x42,0xfa,0x39,0xc0,0x43,0x3b,0x49,0x9d,0x42,
1681 0x08,0x2b,0x43,0xc0,0x43,0x28,0xed,0xa9,0x42,0x61,0x3b,0xc1,0x43,0x00,0x9e,0xa5,0x42,0xe4,0xb2,0xc1,
1682 0x43,0x5d,0x91,0x9c,0x42,0x08,0x78,0xce,0xc1,0x43,0xfd,0x36,0x90,0x42,0x22,0x89,0xc4,0x43,0x81,0x72,
1683 0x86,0x42,0xae,0xc6,0xc2,0x43,0xa0,0xb3,0x80,0x42,0x08,0x54,0x86,0xc2,0x43,0x58,0xd1,0x7e,0x42,0x30,
1684 0x32,0xc1,0x43,0xce,0x5e,0x7b,0x42,0xc4,0x41,0xbf,0x43,0xe8,0xf1,0x7b,0x42,0x07,0xc4,0x41,0xbf,0x43,
1685 0x85,0xc0,0x72,0x42,0x09,0x06,0xf6,0x32,0xbb,0x43,0x40,0xa7,0x60,0x42,0x08,0x35,0xfd,0xbb,0x43,0xa4,
1686 0xa1,0x5c,0x42,0x5e,0x34,0xbc,0x43,0x9d,0x2a,0x70,0x42,0x5e,0x40,0xbe,0x43,0x0e,0x0a,0x73,0x42,0x08,
1687 0x4c,0x9c,0xbe,0x43,0x0e,0x0a,0x73,0x42,0x08,0xef,0xbe,0x43,0x0e,0x0a,0x73,0x42,0xc4,0x41,0xbf,0x43,
1688 0x85,0xc0,0x72,0x42,0x07,0xc4,0x41,0xbf,0x43,0xe8,0xf1,0x7b,0x42,0x08,0xcd,0x13,0xbf,0x43,0xe8,0xf1,
1689 0x7b,0x42,0xd6,0xe5,0xbe,0x43,0x71,0x3b,0x7c,0x42,0xdf,0xb7,0xbe,0x43,0x71,0x3b,0x7c,0x42,0x08,0x08,
1690 0xe3,0xbc,0x43,0xa4,0x61,0x7d,0x42,0x28,0x3c,0xbb,0x43,0x91,0x45,0x69,0x42,0x28,0x3c,0xbb,0x43,0x58,
1691 0x71,0x6e,0x42,0x08,0xce,0xfb,0xba,0x43,0xd5,0x35,0x78,0x42,0x59,0x45,0xbb,0x43,0x58,0x23,0x82,0x42,
1692 0xa1,0xe1,0xbb,0x43,0xd7,0xbe,0x88,0x42,0x08,0xc9,0x18,0xbc,0x43,0xaf,0x9f,0x8c,0x42,0x1e,0x76,0xbd,
1693 0x43,0x51,0x7c,0x8d,0x42,0xd6,0xe5,0xbe,0x43,0xf4,0x58,0x8e,0x42,0x08,0x9c,0x0a,0xbf,0x43,0x45,0xc7,
1694 0x8e,0x42,0x30,0x26,0xbf,0x43,0x96,0x35,0x8f,0x42,0xc4,0x41,0xbf,0x43,0xac,0xc8,0x8f,0x42,0x07,0xc4,
1695 0x41,0xbf,0x43,0x69,0x76,0xa3,0x42,0x08,0x08,0xef,0xbe,0x43,0xb1,0xd6,0x99,0x42,0xe8,0x89,0xbe,0x43,
1696 0xde,0xc5,0x8d,0x42,0xc0,0x46,0xbc,0x43,0xc2,0x5b,0x90,0x42,0x08,0x9c,0xf2,0xba,0x43,0x86,0x80,0x90,
1697 0x42,0xf2,0x43,0xba,0x43,0xe8,0x73,0x87,0x42,0x8f,0x31,0xba,0x43,0xb6,0xf4,0x7d,0x42,0x07,0x8f,0x31,
1698 0xba,0x43,0x21,0xc6,0x76,0x42,0x08,0xc0,0x3a,0xba,0x43,0x5f,0x48,0x6b,0x42,0xae,0x96,0xba,0x43,0xe3,
1699 0x83,0x61,0x42,0xf6,0x32,0xbb,0x43,0x40,0xa7,0x60,0x42,0x09,0x06,0xea,0x74,0xea,0x43,0x61,0x44,0x93,
1700 0x43,0x08,0x24,0x5c,0xec,0x43,0x31,0x3b,0x93,0x43,0xfb,0x30,0xee,0x43,0x93,0x4d,0x93,0x43,0x0d,0xe1,
1701 0xef,0x43,0x80,0xa9,0x93,0x43,0x08,0x8f,0x58,0xf0,0x43,0xd1,0x17,0x94,0x43,0xb7,0x8f,0xf0,0x43,0x10,
1702 0xe2,0x94,0x43,0xea,0x98,0xf0,0x43,0xa9,0xec,0x95,0x43,0x07,0xea,0x98,0xf0,0x43,0x38,0x25,0x97,0x43,
1703 0x08,0x23,0x74,0xf0,0x43,0x9f,0x32,0x9a,0x43,0x5a,0x60,0xef,0x43,0x53,0xcb,0x9e,0x43,0x2d,0x3a,0xee,
1704 0x43,0xfd,0x91,0xa3,0x43,0x08,0xa2,0xf0,0xed,0x43,0xdd,0x38,0xa5,0x43,0x17,0xa7,0xed,0x43,0xbe,0xdf,
1705 0xa6,0x43,0x5a,0x54,0xed,0x43,0x9f,0x86,0xa8,0x43,0x08,0xfc,0x24,0xec,0x43,0xca,0xc4,0xad,0x43,0x48,
1706 0xa4,0xeb,0x43,0x40,0x6f,0xab,0x43,0x28,0x3f,0xeb,0x43,0x1c,0x0f,0xa8,0x43,0x08,0x1f,0x6d,0xeb,0x43,
1707 0x72,0x48,0xa3,0x43,0x67,0x09,0xec,0x43,0xd1,0x53,0x9e,0x43,0xea,0x74,0xea,0x43,0x1e,0xc7,0x9b,0x43,
1708 0x07,0xea,0x74,0xea,0x43,0x8a,0x9f,0x99,0x43,0x08,0x7e,0x90,0xea,0x43,0x8a,0x9f,0x99,0x43,0x12,0xac,
1709 0xea,0x43,0xbc,0xa8,0x99,0x43,0xa7,0xc7,0xea,0x43,0xbc,0xa8,0x99,0x43,0x08,0x51,0x76,0xeb,0x43,0x9f,
1710 0x32,0x9a,0x43,0x5e,0x37,0xec,0x43,0x49,0xed,0x9c,0x43,0xb0,0xa5,0xec,0x43,0x2a,0xa0,0xa0,0x43,0x08,
1711 0x09,0xe6,0xec,0x43,0xd1,0x77,0xa4,0x43,0x28,0x4b,0xed,0x43,0x61,0xa4,0xa3,0x43,0xab,0xc2,0xed,0x43,
1712 0x8e,0xb2,0xa0,0x43,0x08,0x70,0xe7,0xed,0x43,0xde,0x08,0x9d,0x43,0x87,0x86,0xf0,0x43,0x2f,0x53,0x97,
1713 0x43,0x87,0x7a,0xee,0x43,0xec,0x99,0x95,0x43,0x08,0xca,0x27,0xee,0x43,0xff,0x3d,0x95,0x43,0x74,0xca,
1714 0xec,0x43,0x55,0x8f,0x94,0x43,0xea,0x74,0xea,0x43,0xe7,0xaa,0x94,0x43,0x07,0xea,0x74,0xea,0x43,0x61,
1715 0x44,0x93,0x43,0x09,0x06,0x05,0xd3,0xe5,0x43,0x19,0x9c,0x90,0x43,0x08,0x09,0xc2,0xe6,0x43,0xd1,0xff,
1716 0x8f,0x43,0x4d,0x6f,0xe6,0x43,0x74,0xe8,0x92,0x43,0x3b,0xd7,0xe8,0x43,0xc3,0x56,0x93,0x43,0x08,0x1f,
1717 0x61,0xe9,0x43,0x93,0x4d,0x93,0x43,0x05,0xeb,0xe9,0x43,0x93,0x4d,0x93,0x43,0xea,0x74,0xea,0x43,0x61,
1718 0x44,0x93,0x43,0x07,0xea,0x74,0xea,0x43,0xe7,0xaa,0x94,0x43,0x08,0x24,0x50,0xea,0x43,0xe7,0xaa,0x94,
1719 0x43,0x2d,0x22,0xea,0x43,0xe7,0xaa,0x94,0x43,0x36,0xf4,0xe9,0x43,0xe7,0xaa,0x94,0x43,0x08,0xa2,0xcc,
1720 0xe7,0x43,0xe0,0xd8,0x94,0x43,0xd4,0xc9,0xe5,0x43,0x19,0xa8,0x92,0x43,0xd4,0xc9,0xe5,0x43,0x27,0x69,
1721 0x93,0x43,0x08,0x17,0x77,0xe5,0x43,0xe0,0xd8,0x94,0x43,0x67,0xe5,0xe5,0x43,0x47,0xda,0x95,0x43,0x43,
1722 0x9d,0xe6,0x43,0xe2,0xd3,0x97,0x43,0x08,0x9d,0xdd,0xe6,0x43,0xad,0xe7,0x98,0x43,0x09,0xce,0xe8,0x43,
1723 0xff,0x55,0x99,0x43,0xea,0x74,0xea,0x43,0x8a,0x9f,0x99,0x43,0x07,0xea,0x74,0xea,0x43,0x1e,0xc7,0x9b,
1724 0x43,0x08,0x71,0xcf,0xe9,0x43,0x53,0xb3,0x9a,0x43,0xa7,0xbb,0xe8,0x43,0xdb,0x0d,0x9a,0x43,0xc6,0x14,
1725 0xe7,0x43,0xdb,0x0d,0x9a,0x43,0x08,0x48,0x80,0xe5,0x43,0xdb,0x0d,0x9a,0x43,0x0a,0xb6,0xe4,0x43,0xc3,
1726 0x6e,0x97,0x43,0x76,0x9a,0xe4,0x43,0x74,0xf4,0x94,0x43,0x07,0x76,0x9a,0xe4,0x43,0x79,0xd7,0x93,0x43,
1727 0x08,0xd8,0xac,0xe4,0x43,0x66,0x27,0x92,0x43,0x29,0x1b,0xe5,0x43,0xe0,0xc0,0x90,0x43,0x05,0xd3,0xe5,
1728 0x43,0x19,0x9c,0x90,0x43,0x09,0x06,0x1b,0x66,0xe6,0x42,0xe3,0xa3,0x8f,0x42,0x08,0x71,0x0b,0xf4,0x42,
1729 0x00,0x0e,0x8d,0x42,0x8c,0x0f,0x01,0x43,0x3e,0xc0,0x89,0x42,0xf3,0x28,0x06,0x43,0x48,0x9e,0x8b,0x42,
1730 0x08,0x15,0x89,0x09,0x43,0x00,0x0e,0x8d,0x42,0xe0,0x9c,0x0a,0x43,0xc1,0x8b,0x98,0x42,0xa6,0xc1,0x0a,
1731 0x43,0x02,0xa5,0xaa,0x42,0x07,0xa6,0xc1,0x0a,0x43,0xf9,0xf6,0xb0,0x42,0x08,0xa6,0xc1,0x0a,0x43,0x47,
1732 0x8e,0xb4,0x42,0x42,0xaf,0x0a,0x43,0x1f,0x6f,0xb8,0x42,0xe0,0x9c,0x0a,0x43,0xba,0x74,0xbc,0x42,0x08,
1733 0xa1,0xd2,0x09,0x43,0x40,0x47,0xd0,0x42,0x0d,0xab,0x07,0x43,0x91,0xb5,0xd0,0x42,0x3b,0xb9,0x04,0x43,
1734 0xec,0x71,0xba,0x42,0x08,0xe5,0x5b,0x03,0x43,0xe3,0x33,0xa8,0x42,0x63,0xd8,0x00,0x43,0xce,0x70,0x9f,
1735 0x42,0x1b,0x66,0xe6,0x42,0xae,0x2f,0xa5,0x42,0x07,0x1b,0x66,0xe6,0x42,0xa2,0x4a,0x9e,0x42,0x08,0xed,
1736 0x6f,0xed,0x42,0x73,0x24,0x9d,0x42,0xd8,0x0c,0xf5,0x42,0x99,0x6c,0x9c,0x42,0x27,0xab,0xfd,0x42,0xea,
1737 0xda,0x9c,0x42,0x08,0x36,0xca,0x03,0x43,0x2b,0x94,0x9e,0x42,0x68,0xc7,0x01,0x43,0x8f,0xbe,0xa2,0x42,
1738 0xfa,0x06,0x08,0x43,0x73,0xb4,0xb5,0x42,0x08,0x8e,0x2e,0x0a,0x43,0x1f,0x6f,0xb8,0x42,0x9d,0xe3,0x08,
1739 0x43,0xd7,0x1e,0x99,0x42,0x28,0x15,0x05,0x43,0x32,0x3b,0x93,0x42,0x08,0x63,0xf0,0x04,0x43,0x70,0xed,
1740 0x8f,0x42,0x71,0x0b,0xf4,0x42,0x32,0x3b,0x93,0x42,0x1b,0x66,0xe6,0x42,0x73,0xf4,0x94,0x42,0x07,0x1b,
1741 0x66,0xe6,0x42,0xe3,0xa3,0x8f,0x42,0x09,0x06,0x5e,0x28,0xba,0x42,0x35,0xe2,0x87,0x42,0x08,0x8e,0x55,
1742 0xc0,0x42,0xb8,0x4d,0x86,0x42,0x60,0xbf,0xd7,0x42,0x3e,0xf0,0x91,0x42,0x63,0xf6,0xe4,0x42,0x70,0xed,
1743 0x8f,0x42,0x08,0x7a,0x89,0xe5,0x42,0xac,0xc8,0x8f,0x42,0xcc,0xf7,0xe5,0x42,0xac,0xc8,0x8f,0x42,0x1b,
1744 0x66,0xe6,0x42,0xe3,0xa3,0x8f,0x42,0x07,0x1b,0x66,0xe6,0x42,0x73,0xf4,0x94,0x42,0x08,0x63,0xf6,0xe4,
1745 0x42,0x3b,0x19,0x95,0x42,0xe6,0x61,0xe3,0x42,0x00,0x3e,0x95,0x42,0xf4,0x16,0xe2,0x42,0xc4,0x62,0x95,
1746 0x42,0x08,0x6e,0x74,0xd6,0x42,0x15,0xd1,0x95,0x42,0x97,0x63,0xca,0x42,0xaf,0xcf,0x94,0x42,0xfb,0x2d,
1747 0xbe,0x42,0x86,0x80,0x90,0x42,0x08,0x97,0x03,0xba,0x42,0xce,0x10,0x8f,0x42,0x5e,0x28,0xba,0x42,0x3e,
1748 0xf0,0x91,0x42,0xf2,0x4f,0xbc,0x42,0x45,0xf7,0x96,0x42,0x08,0x27,0x54,0xbf,0x42,0x73,0x24,0x9d,0x42,
1749 0xa5,0xe8,0xc0,0x42,0x86,0xe0,0xa0,0x42,0xe4,0xca,0xc5,0x42,0xed,0x11,0xaa,0x42,0x08,0x54,0xaa,0xc8,
1750 0x42,0x86,0x40,0xb1,0x42,0x59,0x81,0xc5,0x42,0xa1,0x11,0xc4,0x42,0x3e,0xe7,0xbf,0x42,0xfb,0x8d,0xce,
1751 0x42,0x08,0xb4,0x6d,0xb7,0x42,0x30,0xc2,0xd9,0x42,0x46,0xf5,0xc9,0x42,0xdf,0x53,0xd9,0x42,0x38,0x40,
1752 0xcb,0x42,0x62,0x8f,0xcf,0x42,0x08,0x7d,0xf9,0xcc,0x42,0xec,0xa1,0xc2,0x42,0x07,0x43,0xcd,0x42,0x6c,
1753 0xdd,0xb8,0x42,0x2b,0x8b,0xcc,0x42,0x92,0xf5,0xaf,0x42,0x08,0xf9,0x8d,0xce,0x42,0x41,0x57,0xa7,0x42,
1754 0x5b,0xb8,0xd2,0x42,0xae,0x2f,0xa5,0x42,0x18,0x2f,0xd9,0x42,0x13,0x2a,0xa1,0x42,0x08,0x41,0x7e,0xdd,
1755 0x42,0xe3,0x03,0xa0,0x42,0x2e,0xf2,0xe1,0x42,0x7c,0x02,0x9f,0x42,0x1b,0x66,0xe6,0x42,0xa2,0x4a,0x9e,
1756 0x42,0x07,0x1b,0x66,0xe6,0x42,0xae,0x2f,0xa5,0x42,0x08,0x4d,0x63,0xe4,0x42,0x00,0x9e,0xa5,0x42,0xf4,
1757 0x16,0xe2,0x42,0x15,0x31,0xa6,0x42,0x99,0xca,0xdf,0x42,0x2b,0xc4,0xa6,0x42,0x08,0xc0,0x82,0xc6,0x42,
1758 0xc4,0xc2,0xa5,0x42,0x57,0xe1,0xd5,0x42,0x91,0xb5,0xd0,0x42,0x54,0xda,0xd0,0x42,0x97,0x93,0xd2,0x42,
1759 0x08,0x9c,0x3a,0xc7,0x42,0x17,0x58,0xdc,0x42,0x9c,0x0a,0xbf,0x42,0x6e,0xa4,0xde,0x42,0x90,0x25,0xb8,
1760 0x42,0xdf,0x53,0xd9,0x42,0x08,0x59,0x21,0xb5,0x42,0xf2,0xdf,0xd4,0x42,0x51,0x43,0xb3,0x42,0x91,0xb5,
1761 0xd0,0x42,0xc5,0x29,0xbb,0x42,0x0e,0x1a,0xca,0x42,0x08,0x65,0x36,0xc4,0x42,0xd0,0x07,0xbd,0x42,0x3e,
1762 0xe7,0xbf,0x42,0x37,0x09,0xbe,0x42,0x0c,0xea,0xc1,0x42,0xcd,0xd0,0xaf,0x42,0x08,0x2b,0x5b,0xc4,0x42,
1763 0x18,0x08,0xa3,0x42,0x67,0xa6,0xab,0x42,0x99,0x3c,0x94,0x42,0x5e,0x28,0xba,0x42,0x35,0xe2,0x87,0x42,
1764 0x09,];
1766 public enum ConBaphometDims = 512; /// it is square
1768 public void conBaphometRender (scope void delegate (int x, int y) nothrow @trusted @nogc drawPixel, float ofsx=0, float ofsy=0, float scale=1) nothrow @trusted @nogc {
1769 import std.math : floor;
1771 void drawLine (int x0, int y0, int x1, int y1) {
1772 import std.math : abs;
1773 int dx = abs(x1-x0), sx = (x0 < x1 ? 1 : -1);
1774 int dy = -abs(y1-y0), sy = (y0 < y1 ? 1 : -1);
1775 int err = dx+dy; // error value e_xy
1776 for (;;) {
1777 drawPixel(x0, y0);
1778 int e2 = 2*err;
1779 // e_xy+e_x > 0
1780 if (e2 >= dy) {
1781 if (x0 == x1) break;
1782 err += dy; x0 += sx;
1784 // e_xy+e_y < 0
1785 if (e2 <= dx) {
1786 if (y0 == y1) break;
1787 err += dx; y0 += sy;
1792 // plot a limited quadratic Bezier segment
1793 void drawQuadBezierSeg (int x0, int y0, int x1, int y1, int x2, int y2) {
1794 int sx = x2-x1, sy = y2-y1;
1795 long xx = x0-x1, yy = y0-y1, xy; // relative values for checks
1796 double cur = xx*sy-yy*sx; // curvature
1797 assert(xx*sx <= 0 && yy*sy <= 0); // sign of gradient must not change
1798 // begin with longer part
1799 if (sx*cast(long)sx+sy*cast(long)sy > xx*xx+yy*yy) { x2 = x0; x0 = sx+x1; y2 = y0; y0 = sy+y1; cur = -cur; } // swap P0 P2
1800 // no straight line
1801 if (cur != 0) {
1802 xx += sx; xx *= (sx = x0 < x2 ? 1 : -1); // x step direction
1803 yy += sy; yy *= (sy = y0 < y2 ? 1 : -1); // y step direction
1804 xy = 2*xx*yy; xx *= xx; yy *= yy; // differences 2nd degree
1805 // negated curvature?
1806 if (cur*sx*sy < 0) { xx = -xx; yy = -yy; xy = -xy; cur = -cur; }
1807 double dx = 4.0*sy*cur*(x1-x0)+xx-xy; // differences 1st degree
1808 double dy = 4.0*sx*cur*(y0-y1)+yy-xy;
1809 xx += xx;
1810 yy += yy;
1811 double err = dx+dy+xy; // error 1st step
1812 do {
1813 drawPixel(x0, y0); // plot curve
1814 if (x0 == x2 && y0 == y2) return; // last pixel -> curve finished
1815 y1 = 2*err < dx; // save value for test of y step
1816 if (2*err > dy) { x0 += sx; dx -= xy; err += dy += yy; } // x step
1817 if ( y1 ) { y0 += sy; dy -= xy; err += dx += xx; } // y step
1818 } while (dy < 0 && dx > 0); // gradient negates -> algorithm fails
1820 drawLine(x0, y0, x2, y2); // plot remaining part to end
1823 // plot any quadratic Bezier curve
1824 void drawQuadBezier (int x0, int y0, int x1, int y1, int x2, int y2) {
1825 import std.math : abs, floor;
1826 int x = x0-x1, y = y0-y1;
1827 double t = x0-2*x1+x2;
1828 // horizontal cut at P4?
1829 if (cast(long)x*(x2-x1) > 0) {
1830 // vertical cut at P6 too?
1831 if (cast(long)y*(y2-y1) > 0) {
1832 // which first?
1833 if (abs((y0-2*y1+y2)/t*x) > abs(y)) { x0 = x2; x2 = x+x1; y0 = y2; y2 = y+y1; } // swap points
1834 // now horizontal cut at P4 comes first
1836 t = (x0-x1)/t;
1837 double r = (1-t)*((1-t)*y0+2.0*t*y1)+t*t*y2; // By(t=P4)
1838 t = (x0*x2-x1*x1)*t/(x0-x1); // gradient dP4/dx=0
1839 x = cast(int)floor(t+0.5); y = cast(int)floor(r+0.5);
1840 r = (y1-y0)*(t-x0)/(x1-x0)+y0; // intersect P3 | P0 P1
1841 drawQuadBezierSeg(x0, y0, x, cast(int)floor(r+0.5), x, y);
1842 r = (y1-y2)*(t-x2)/(x1-x2)+y2; // intersect P4 | P1 P2
1843 x0 = x1 = x; y0 = y; y1 = cast(int)floor(r+0.5); // P0 = P4, P1 = P8
1845 // vertical cut at P6?
1846 if (cast(long)(y0-y1)*(y2-y1) > 0) {
1847 t = y0-2*y1+y2; t = (y0-y1)/t;
1848 double r = (1-t)*((1-t)*x0+2.0*t*x1)+t*t*x2; // Bx(t=P6)
1849 t = (y0*y2-y1*y1)*t/(y0-y1); // gradient dP6/dy=0
1850 x = cast(int)floor(r+0.5); y = cast(int)floor(t+0.5);
1851 r = (x1-x0)*(t-y0)/(y1-y0)+x0; // intersect P6 | P0 P1
1852 drawQuadBezierSeg(x0, y0, cast(int)floor(r+0.5), y, x, y);
1853 r = (x1-x2)*(t-y2)/(y1-y2)+x2; // intersect P7 | P1 P2
1854 x0 = x; x1 = cast(int)floor(r+0.5); y0 = y1 = y; // P0 = P6, P1 = P7
1856 drawQuadBezierSeg(x0, y0, x1, y1, x2, y2); // remaining part
1859 // plot limited cubic Bezier segment
1860 void drawCubicBezierSeg (int x0, int y0, float x1, float y1, float x2, float y2, int x3, int y3) {
1861 import std.math : abs, floor, sqrt;
1862 immutable double EP = 0.01;
1863 int leg = 1;
1864 int sx = (x0 < x3 ? 1 : -1), sy = (y0 < y3 ? 1 : -1); // step direction
1865 float xc = -abs(x0+x1-x2-x3), xa = xc-4*sx*(x1-x2), xb = sx*(x0-x1-x2+x3);
1866 float yc = -abs(y0+y1-y2-y3), ya = yc-4*sy*(y1-y2), yb = sy*(y0-y1-y2+y3);
1867 // check for curve restrains
1868 // slope P0-P1 == P2-P3 and (P0-P3 == P1-P2 or no slope change)
1869 //!assert((x1-x0)*(x2-x3) < EP && ((x3-x0)*(x1-x2) < EP || xb*xb < xa*xc+EP));
1870 //!assert((y1-y0)*(y2-y3) < EP && ((y3-y0)*(y1-y2) < EP || yb*yb < ya*yc+EP));
1871 // quadratic Bezier
1872 if (xa == 0 && ya == 0) {
1873 // new midpoint
1874 sx = cast(int)floor((3*x1-x0+1)/2);
1875 sy = cast(int)floor((3*y1-y0+1)/2);
1876 return drawQuadBezierSeg(x0, y0, sx, sy, x3, y3);
1878 x1 = (x1-x0)*(x1-x0)+(y1-y0)*(y1-y0)+1; // line lengths
1879 x2 = (x2-x3)*(x2-x3)+(y2-y3)*(y2-y3)+1;
1880 do { // loop over both ends
1881 double ab = xa*yb-xb*ya;
1882 double ac = xa*yc-xc*ya;
1883 double bc = xb*yc-xc*yb;
1884 double ex = ab*(ab+ac-3*bc)+ac*ac; // P0 part of self-intersection loop?
1885 immutable int f = cast(int)(ex > 0 ? 1 : sqrt(1+1024/x1)); // calculate resolution
1886 // increase resolution
1887 ab *= f;
1888 ac *= f;
1889 bc *= f;
1890 ex *= f*f;
1891 // init differences of 1st degree
1892 double xy = 9*(ab+ac+bc)/8;
1893 double cb = 8*(xa-ya);
1894 double dx = 27*(8*ab*(yb*yb-ya*yc)+ex*(ya+2*yb+yc))/64-ya*ya*(xy-ya);
1895 double dy = 27*(8*ab*(xb*xb-xa*xc)-ex*(xa+2*xb+xc))/64-xa*xa*(xy+xa);
1896 // init differences of 2nd degree
1897 double xx = 3*(3*ab*(3*yb*yb-ya*ya-2*ya*yc)-ya*(3*ac*(ya+yb)+ya*cb))/4;
1898 double yy = 3*(3*ab*(3*xb*xb-xa*xa-2*xa*xc)-xa*(3*ac*(xa+xb)+xa*cb))/4;
1899 xy = xa*ya*(6*ab+6*ac-3*bc+cb);
1900 ac = ya*ya;
1901 cb = xa*xa;
1902 xy = 3*(xy+9*f*(cb*yb*yc-xb*xc*ac)-18*xb*yb*ab)/8;
1903 // negate values if inside self-intersection loop
1904 if (ex < 0) { dx = -dx; dy = -dy; xx = -xx; yy = -yy; xy = -xy; ac = -ac; cb = -cb; }
1905 // init differences of 3rd degree
1906 ab = 6*ya*ac;
1907 ac = -6*xa*ac;
1908 bc = 6*ya*cb;
1909 cb = -6*xa*cb;
1910 // error of 1st step
1911 dx += xy;
1912 ex = dx+dy;
1913 dy += xy;
1914 const(double)* pxy = &xy;
1915 zzloop: for (int fx = f, fy = f; x0 != x3 && y0 != y3; ) {
1916 drawPixel(x0, y0); // plot curve
1917 // move sub-steps of one pixel
1918 do {
1919 if (dx > *pxy || dy < *pxy) break zzloop; // confusing values
1920 y1 = 2*ex-dy; // save value for test of y step
1921 if (2*ex >= dx) { fx--; ex += dx += xx; dy += xy += ac; yy += bc; xx += ab; } // x sub-step
1922 if (y1 <= 0) { fy--; ex += dy += yy; dx += xy += bc; xx += ac; yy += cb; } // y sub-step
1923 } while (fx > 0 && fy > 0); // pixel complete?
1924 if (2*fx <= f) { x0 += sx; fx += f; } // x step
1925 if (2*fy <= f) { y0 += sy; fy += f; } // y step
1926 if (pxy == &xy && dx < 0 && dy > 0) pxy = &EP; // pixel ahead valid
1928 xx = x0; x0 = x3; x3 = cast(int)xx; sx = -sx; xb = -xb; // swap legs
1929 yy = y0; y0 = y3; y3 = cast(int)yy; sy = -sy; yb = -yb; x1 = x2;
1930 } while (leg--); // try other end
1931 drawLine(x0, y0, x3, y3); // remaining part in case of cusp or crunode
1934 // plot any cubic Bezier curve
1935 void drawCubicBezier (int x0, int y0, int x1, int y1, int x2, int y2, int x3, int y3) {
1936 import std.math : abs, floor, sqrt;
1937 int n = 0, i = 0;
1938 long xc = x0+x1-x2-x3, xa = xc-4*(x1-x2);
1939 long xb = x0-x1-x2+x3, xd = xb+4*(x1+x2);
1940 long yc = y0+y1-y2-y3, ya = yc-4*(y1-y2);
1941 long yb = y0-y1-y2+y3, yd = yb+4*(y1+y2);
1942 float fx0 = x0, fy0 = y0;
1943 double t1 = xb*xb-xa*xc;
1944 double[5] t;
1945 // sub-divide curve at gradient sign changes
1946 if (xa == 0) { // horizontal
1947 if (abs(xc) < 2*abs(xb)) t.ptr[n++] = xc/(2.0*xb); // one change
1948 } else if (t1 > 0.0) { // two changes
1949 immutable double t2 = sqrt(t1);
1950 t1 = (xb-t2)/xa; if (abs(t1) < 1.0) t.ptr[n++] = t1;
1951 t1 = (xb+t2)/xa; if (abs(t1) < 1.0) t.ptr[n++] = t1;
1953 t1 = yb*yb-ya*yc;
1954 if (ya == 0) { // vertical
1955 if (abs(yc) < 2*abs(yb)) t.ptr[n++] = yc/(2.0*yb); // one change
1956 } else if (t1 > 0.0) { // two changes
1957 immutable double t2 = sqrt(t1);
1958 t1 = (yb-t2)/ya; if (abs(t1) < 1.0) t.ptr[n++] = t1;
1959 t1 = (yb+t2)/ya; if (abs(t1) < 1.0) t.ptr[n++] = t1;
1961 // bubble sort of 4 points
1962 for (i = 1; i < n; i++) if ((t1 = t.ptr[i-1]) > t.ptr[i]) { t.ptr[i-1] = t.ptr[i]; t.ptr[i] = t1; i = 0; }
1963 t1 = -1.0; t.ptr[n] = 1.0; // begin / end point
1964 for (i = 0; i <= n; i++) { // plot each segment separately
1965 immutable double t2 = t.ptr[i]; // sub-divide at t[i-1], t[i]
1966 float fx1 = (t1*(t1*xb-2*xc)-t2*(t1*(t1*xa-2*xb)+xc)+xd)/8-fx0;
1967 float fy1 = (t1*(t1*yb-2*yc)-t2*(t1*(t1*ya-2*yb)+yc)+yd)/8-fy0;
1968 float fx2 = (t2*(t2*xb-2*xc)-t1*(t2*(t2*xa-2*xb)+xc)+xd)/8-fx0;
1969 float fy2 = (t2*(t2*yb-2*yc)-t1*(t2*(t2*ya-2*yb)+yc)+yd)/8-fy0;
1970 immutable float fx3 = (t2*(t2*(3*xb-t2*xa)-3*xc)+xd)/8;
1971 immutable float fy3 = (t2*(t2*(3*yb-t2*ya)-3*yc)+yd)/8;
1972 fx0 -= fx3;
1973 fy0 -= fy3;
1974 // scale bounds to int
1975 x3 = cast(int)floor(fx3+0.5);
1976 y3 = cast(int)floor(fy3+0.5);
1977 if (fx0 != 0.0) { fx1 *= fx0 = (x0-x3)/fx0; fx2 *= fx0; }
1978 if (fy0 != 0.0) { fy1 *= fy0 = (y0-y3)/fy0; fy2 *= fy0; }
1979 if (x0 != x3 || y0 != y3) drawCubicBezierSeg(x0, y0, x0+fx1, y0+fy1, x0+fx2, y0+fy2, x3, y3); // segment t1 - t2
1980 x0 = x3; y0 = y3; fx0 = fx3; fy0 = fy3; t1 = t2;
1984 auto path = cast(const(ubyte)[])baphometPath;
1985 immutable plen = path.length;
1986 uint ppos = 0;
1988 enum Command {
1989 Bounds, // always first, has 4 args (x0, y0, x1, y1)
1990 StrokeMode,
1991 FillMode,
1992 StrokeFillMode,
1993 NormalStroke,
1994 ThinStroke,
1995 MoveTo,
1996 LineTo,
1997 CubicTo, // cubic bezier
1998 EndPath,
2001 Command getCommand () nothrow @trusted @nogc {
2002 if (ppos >= plen) assert(0, "invalid path");
2003 return cast(Command)(path.ptr[ppos++]);
2006 float getFloat () nothrow @trusted @nogc {
2007 if (ppos >= plen || plen-ppos < float.sizeof) assert(0, "invalid path");
2008 version(LittleEndian) {
2009 float res = *cast(const(float)*)(&path.ptr[ppos]);
2010 ppos += cast(uint)float.sizeof;
2011 return res;
2012 } else {
2013 static assert(float.sizeof == 4);
2014 uint xp = path.ptr[ppos]|(path.ptr[ppos+1]<<8)|(path.ptr[ppos+2]<<16)|(path.ptr[ppos+3]<<24);
2015 ppos += cast(uint)float.sizeof;
2016 return *cast(const(float)*)(&xp);
2020 int scaleX (float v) nothrow @trusted @nogc { pragma(inline, true); return cast(int)floor(ofsx+v*scale); }
2021 int scaleY (float v) nothrow @trusted @nogc { pragma(inline, true); return cast(int)floor(ofsy+v*scale); }
2023 if (path.length == 0) return;
2024 int cx = 0, cy = 0;
2025 while (ppos < plen) {
2026 switch (getCommand()) {
2027 case Command.Bounds: ppos += 4*cast(uint)float.sizeof; break;
2028 case Command.StrokeMode: case Command.FillMode: case Command.StrokeFillMode: break;
2029 case Command.NormalStroke: case Command.ThinStroke: break;
2030 case Command.MoveTo:
2031 cx = scaleX(getFloat());
2032 cy = scaleY(getFloat());
2033 break;
2034 case Command.LineTo:
2035 immutable int ex = scaleX(getFloat());
2036 immutable int ey = scaleY(getFloat());
2037 drawLine(cx, cy, ex, ey);
2038 cx = ex;
2039 cy = ey;
2040 break;
2041 case Command.CubicTo: // cubic bezier
2042 immutable int x1 = scaleX(getFloat());
2043 immutable int y1 = scaleY(getFloat());
2044 immutable int x2 = scaleX(getFloat());
2045 immutable int y2 = scaleY(getFloat());
2046 immutable int ex = scaleX(getFloat());
2047 immutable int ey = scaleY(getFloat());
2048 drawCubicBezier(cx, cy, x1, y1, x2, y2, ex, ey);
2049 cx = ex;
2050 cy = ey;
2051 break;
2052 case Command.EndPath: // don't close this path
2053 break;
2054 default: assert(0, "invalid path command");
2060 // ////////////////////////////////////////////////////////////////////////// //
2061 version(glbinds_mixin) import iv.glbinds.binds_full_mixin; else import iv.glbinds;