From 2951535d93f98cd1702f9e4d8a2a3aab11b07327 Mon Sep 17 00:00:00 2001 From: mguinhos Date: Mon, 26 Oct 2026 23:47:49 -0300 Subject: [PATCH] tinyblocks-plot: graficos no estilo do matplotlib Figura atual como no pyplot: linha, linha x-y, pontos, barras com nomes, histograma, titulo, nomes dos eixos (y na vertical), legenda, grade, limites e series com nome que crescem a cada passo (curvas de treino). Desenha numa imagem (para o palco) ou grava em PNG/BMP/PPM. Valores de lista, de texto ou de tensor. Paleta tab10; marcas "redondas" (1, 2, 5 x 10^n) com folga de 5%; linhas e pontos com antisserrilhado; fonte DejaVu Sans 12 px embutida (tools/gen_font.c, via tinyblocks-opentype), com os acentos do portugues. Convolucoes da ai: "filtros de tamanho %3" (o rotulo repetia o campo). Co-Authored-By: Claude Opus 5.5 --- Makefile | 15 +- examples/editor/main.c | 2 + libraries/tinyblocks-ai/src/ai_blocks.c | 4 +- libraries/tinyblocks-plot/Makefile | 30 + libraries/tinyblocks-plot/include/tb_plot.h | 34 + libraries/tinyblocks-plot/library.toml | 15 + libraries/tinyblocks-plot/src/plot_font.h | 1032 +++++++++++++++++++ libraries/tinyblocks-plot/src/tb_plot.c | 665 ++++++++++++ libraries/tinyblocks-plot/tools/gen_font.c | 64 ++ tests/plot_test.c | 100 ++ 10 files changed, 1957 insertions(+), 4 deletions(-) create mode 100644 libraries/tinyblocks-plot/Makefile create mode 100644 libraries/tinyblocks-plot/include/tb_plot.h create mode 100644 libraries/tinyblocks-plot/library.toml create mode 100644 libraries/tinyblocks-plot/src/plot_font.h create mode 100644 libraries/tinyblocks-plot/src/tb_plot.c create mode 100644 libraries/tinyblocks-plot/tools/gen_font.c create mode 100644 tests/plot_test.c diff --git a/Makefile b/Makefile index a9737b8..be64435 100644 --- a/Makefile +++ b/Makefile @@ -86,7 +86,7 @@ CAT_LDFLAGS := $(foreach l,$(CAT_LIBS),-ltinyblocks-$(l)) CAT_INCS := $(foreach l,$(CAT_LIBS),-I$(LIBDIR)/tinyblocks-$(l)/include) # Libraries que o editor registra como as de categoria, mas com varios # fontes e o Makefile proprio (o harness nao as compila junto) -APP_LIBS := socket ssl http archive tensor ai +APP_LIBS := socket ssl http archive tensor ai plot APP_A := $(foreach l,$(APP_LIBS),$(LIBDIR)/tinyblocks-$(l)/build/libtinyblocks-$(l).a) APP_INCS := $(foreach l,$(APP_LIBS),-I$(LIBDIR)/tinyblocks-$(l)/include) APP_LDLIBS := -lssl -lcrypto -lz -lpthread @@ -111,7 +111,7 @@ LIB_LDFLAGS := -L$(ED_DIR)/build -L$(GX_DIR)/build -L$(SD_DIR)/build \ editor run-editor run-sdl2 mylib vector customappearance graphics sdl2-backend test-editor \ appdir appimage run-appimage icon \ test-toml test-plugin test-blueprint test-a11y test-mcp test-mcp-server test-base64 test-curves test-meta test-ppm test-bmp test-png test-image test-vg test-svg test-jpg \ - test-tensor test-ai test-http test-archive test-syntax test-os test-value test-vars test-scratchblocks test-input test-stdlib test-regex test-markdown test-opentype \ + test-tensor test-ai test-http test-archive test-plot test-syntax test-os test-value test-vars test-scratchblocks test-input test-stdlib test-regex test-markdown test-opentype \ category-libs category-sos libs app-libs \ lib-events lib-control lib-errors lib-input lib-operators lib-number lib-string lib-variables lib-vector lib-appearance lib-pen lib-fs lib-os \ lib-environ \ @@ -648,6 +648,17 @@ $(BUILD)/archive_test: tests/archive_test.c $(LIBDIR)/tinyblocks-archive/src/tb_ test-archive: $(BUILD)/archive_test ## Roda o teste da archive (ASan/UBSan) ./$(BUILD)/archive_test +# -- Teste da library plot (figura -> imagem PNG) --- +PLOT_DIR := $(LIBDIR)/tinyblocks-plot +$(BUILD)/plot_test: tests/plot_test.c $(PLOT_DIR)/src/tb_plot.c $(PLOT_DIR)/src/plot_font.h $(TENSOR_SRCS) static + @mkdir -p $(BUILD) + $(CC) $(CFLAGS_DBG) -I$(TENSOR_DIR)/include -I$(PLOT_DIR)/include -I$(PNG_DIR)/include \ + $(TENSOR_SRCS) $(PLOT_DIR)/src/tb_plot.c $(PNG_DIR)/src/tb_png.c tests/plot_test.c -o $@ \ + -Wl,--start-group $(LIB_A) -Wl,--end-group -lpng -lm -lpthread + +test-plot: $(BUILD)/plot_test ## Roda o teste da plot (ASan/UBSan; grava /tmp/tb_plot_*.png) + ./$(BUILD)/plot_test + # -- Teste da library curves --- $(BUILD)/curves_test: tests/curves_test.c $(CV_DIR)/src/tb_curves.c static @mkdir -p $(BUILD) diff --git a/examples/editor/main.c b/examples/editor/main.c index bf70981..a6719d1 100644 --- a/examples/editor/main.c +++ b/examples/editor/main.c @@ -41,6 +41,7 @@ #include #include #include +#include #include /* Registra uma library de categoria: se existir o .so dela no disco, carrega @@ -90,6 +91,7 @@ int main(int argc, char** argv) { reg_core(rt, "tinyblocks-archive", tb_archive_get_library); reg_core(rt, "tinyblocks-tensor", tb_tensor_get_library); reg_core(rt, "tinyblocks-ai", tb_ai_get_library); + reg_core(rt, "tinyblocks-plot", tb_plot_get_library); /* Interface gráfica: o editor mede texto e cria o palco ao nascer */ tb_library_register(rt, tb_graphics_get_library()); diff --git a/libraries/tinyblocks-ai/src/ai_blocks.c b/libraries/tinyblocks-ai/src/ai_blocks.c index 4bfcc46..0de0a1b 100644 --- a/libraries/tinyblocks-ai/src/ai_blocks.c +++ b/libraries/tinyblocks-ai/src/ai_blocks.c @@ -601,8 +601,8 @@ typedef struct { static const Spec s_specs[] = { /* camadas */ { "AI.Linear", "camada linear de %1 com %2 saídas", "|10", 2, {N,I}, 0, 1, S(eval_linear), "x W + b (W [entradas, saídas]); os pesos nascem na primeira vez" }, - { "AI.Conv", "convolução de %1 com %2 filtros %3 x %3 passo %4 margem %5", "|16|3|1|1", 5, {N,I,I,I,I}, 0, 1, S(eval_conv), "Convolução 2D de [lote, canais, A, L]" }, - { "AI.ConvT", "convolução transposta de %1 com %2 filtros %3 x %3 passo %4 margem %5", "|16|4|2|1", 5, {N,I,I,I,I}, 0, 1, S(eval_conv_t), "Convolução transposta (aumenta a imagem): A' = (A-1) passo - 2 margem + filtro" }, + { "AI.Conv", "convolução de %1 com %2 filtros de tamanho %3 passo %4 margem %5", "|16|3|1|1", 5, {N,I,I,I,I}, 0, 1, S(eval_conv), "Convolução 2D de [lote, canais, A, L]" }, + { "AI.ConvT", "convolução transposta de %1 com %2 filtros de tamanho %3 passo %4 margem %5", "|16|4|2|1", 5, {N,I,I,I,I}, 0, 1, S(eval_conv_t), "Convolução transposta (aumenta a imagem): A' = (A-1) passo - 2 margem + filtro" }, { "AI.MaxPool", "max pool de %1 com janela %2", "|2", 2, {N,I}, 0, 1, S(eval_pool), "Maior valor de cada janela (passo = janela)" }, { "AI.BatchNorm", "batch norm de %1", "", 1, {N}, 0, 1, S(eval_batchnorm), "Normaliza cada canal pelo lote (médias móveis no modo de avaliação)" }, { "AI.LayerNorm", "layer norm de %1", "", 1, {N}, 0, 1, S(eval_layernorm), "Normaliza o último eixo (ganho e deslocamento treináveis)" }, diff --git a/libraries/tinyblocks-plot/Makefile b/libraries/tinyblocks-plot/Makefile new file mode 100644 index 0000000..4d3bb5d --- /dev/null +++ b/libraries/tinyblocks-plot/Makefile @@ -0,0 +1,30 @@ +# Makefile da library plot (categoria "Gráficos") +# Constroi build/libtinyblocks-plot.a e build/libtinyblocks-plot.so +CC := gcc +BUILD := build + +CFLAGS := -std=c11 -O2 -Wall -Wextra -pedantic -fvisibility=hidden \ + -D_POSIX_C_SOURCE=200809L -I../../include -Iinclude -I../tinyblocks-tensor/include + +SRCS := src/tb_plot.c +OBJS := $(BUILD)/tb_plot.o +LIB_A := $(BUILD)/libtinyblocks-plot.a +LIB_SO := $(BUILD)/libtinyblocks-plot.so + +.PHONY: all static shared clean +all: static shared +static: $(LIB_A) +shared: $(LIB_SO) + +$(BUILD)/%.o: src/%.c $(wildcard include/*.h) $(wildcard src/*.h) + @mkdir -p $(BUILD) + $(CC) $(CFLAGS) -fPIC -c $< -o $@ + +$(LIB_A): $(OBJS) + ar rcs $@ $^ + +$(LIB_SO): $(OBJS) + $(CC) -shared -o $@ $^ -lm + +clean: + $(RM) -r $(BUILD) diff --git a/libraries/tinyblocks-plot/include/tb_plot.h b/libraries/tinyblocks-plot/include/tb_plot.h new file mode 100644 index 0000000..bec6190 --- /dev/null +++ b/libraries/tinyblocks-plot/include/tb_plot.h @@ -0,0 +1,34 @@ +/* + * TinyBlocks - tb_plot.h + * Library tinyblocks-plot: graficos no estilo do pyplot do matplotlib. + * Registra a categoria "Gráficos". + * + * Ha uma figura atual: "nova figura" a limpa; "plote", "pontos", "barras" e + * "histograma" acrescentam series; titulo, nomes dos eixos, limites, + * legenda e grade a enfeitam; "imagem da figura" a desenha numa imagem + * (para o palco: "desenhe (imagem da figura) ...") e "salve a figura" grava + * (.png, .bmp, .ppm, conforme os formatos carregados). + * + * Os valores podem vir de uma lista, de um texto "1, 2, 3" ou de um tensor + * (tinyblocks-tensor, se estiver carregada). Series com nome ("acrescente + * (perda) a serie [treino]") crescem a cada passo: boas para curvas de + * treino ao vivo. + * + * Cores: a paleta tab10 do matplotlib (azul, laranja, verde, vermelho, roxo, + * marrom, rosa, cinza, oliva, ciano), preto, branco ou "#rrggbb"; vazio = + * a proxima da paleta. O texto usa uma fonte embutida (DejaVu Sans 12 px). + */ +#ifndef TINYBLOCKS_PLOT_H +#define TINYBLOCKS_PLOT_H + +#include + +TB_API const TinyBlocks_LibraryDescriptor* tb_plot_get_library(void); + +/* -- API C: a figura atual --- */ +TB_API void tb_plot_figure(int w, int h); +TB_API void tb_plot_line(const float* x, const float* y, int n, const char* color, const char* label); +TB_API void tb_plot_title(const char* title); +TB_API TinyBlocks_Image* tb_plot_render(void); /* imagem nova (ref = 1) */ + +#endif /* TINYBLOCKS_PLOT_H */ diff --git a/libraries/tinyblocks-plot/library.toml b/libraries/tinyblocks-plot/library.toml new file mode 100644 index 0000000..0aacbea --- /dev/null +++ b/libraries/tinyblocks-plot/library.toml @@ -0,0 +1,15 @@ +# Metadados da library plot. Lido pela UI/build sem recompilar o .so. +[library] +name = "tinyblocks-plot" +version = "1.0.0" +category = "Gráficos" +description = "Graficos no estilo do matplotlib: linhas, pontos, barras, histograma, legenda e series que crescem; desenha numa imagem" +color = [38, 158, 140, 255] +dark = [26, 120, 107, 255] + +[build] +sources = ["src/tb_plot.c"] +includes = ["include"] +shared = "build/libtinyblocks-plot.so" +static = "build/libtinyblocks-plot.a" +depends = ["tensor"] diff --git a/libraries/tinyblocks-plot/src/plot_font.h b/libraries/tinyblocks-plot/src/plot_font.h new file mode 100644 index 0000000..22913fe --- /dev/null +++ b/libraries/tinyblocks-plot/src/plot_font.h @@ -0,0 +1,1032 @@ +/* Gerado por tools/gen_font.c (/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf, 12 px). Nao editar. */ +#ifndef TB_PLOT_FONT_H +#define TB_PLOT_FONT_H +#include +#define PLOT_FONT_H 17 +#define PLOT_FONT_BASE 13 +#define PLOT_FONT_N 191 +typedef struct { uint16_t cp; uint8_t w; uint32_t off; } PlotGlyph; +static const PlotGlyph s_glyphs[PLOT_FONT_N] = { + {32,4,0}, {33,5,68}, {34,6,153}, {35,10,255}, {36,8,425}, {37,11,561}, + {38,9,748}, {39,3,901}, {40,5,952}, {41,5,1037}, {42,6,1122}, {43,10,1224}, + {44,4,1394}, {45,4,1462}, {46,4,1530}, {47,4,1598}, {48,8,1666}, {49,8,1802}, + {50,8,1938}, {51,8,2074}, {52,8,2210}, {53,8,2346}, {54,8,2482}, {55,8,2618}, + {56,8,2754}, {57,8,2890}, {58,4,3026}, {59,4,3094}, {60,10,3162}, {61,10,3332}, + {62,10,3502}, {63,6,3672}, {64,12,3774}, {65,8,3978}, {66,8,4114}, {67,8,4250}, + {68,9,4386}, {69,8,4539}, {70,7,4675}, {71,9,4794}, {72,9,4947}, {73,4,5100}, + {74,4,5168}, {75,8,5236}, {76,7,5372}, {77,10,5491}, {78,9,5661}, {79,9,5814}, + {80,7,5967}, {81,9,6086}, {82,8,6239}, {83,8,6375}, {84,7,6511}, {85,9,6630}, + {86,8,6783}, {87,12,6919}, {88,8,7123}, {89,7,7259}, {90,8,7378}, {91,5,7514}, + {92,4,7599}, {93,5,7667}, {94,10,7752}, {95,6,7922}, {96,6,8024}, {97,7,8126}, + {98,8,8245}, {99,7,8381}, {100,8,8500}, {101,7,8636}, {102,4,8755}, {103,8,8823}, + {104,8,8959}, {105,3,9095}, {106,3,9146}, {107,7,9197}, {108,3,9316}, {109,12,9367}, + {110,8,9571}, {111,7,9707}, {112,8,9826}, {113,8,9962}, {114,5,10098}, {115,6,10183}, + {116,5,10285}, {117,8,10370}, {118,7,10506}, {119,10,10625}, {120,7,10795}, {121,7,10914}, + {122,6,11033}, {123,8,11135}, {124,4,11271}, {125,8,11339}, {126,10,11475}, {160,4,11645}, + {161,5,11713}, {162,8,11798}, {163,8,11934}, {164,8,12070}, {165,8,12206}, {166,4,12342}, + {167,6,12410}, {168,6,12512}, {169,12,12614}, {170,6,12818}, {171,7,12920}, {172,10,13039}, + {173,4,13209}, {174,12,13277}, {175,6,13481}, {176,6,13583}, {177,10,13685}, {178,5,13855}, + {179,5,13940}, {180,6,14025}, {181,8,14127}, {182,8,14263}, {183,4,14399}, {184,6,14467}, + {185,5,14569}, {186,6,14654}, {187,7,14756}, {188,12,14875}, {189,12,15079}, {190,12,15283}, + {191,6,15487}, {192,8,15589}, {193,8,15725}, {194,8,15861}, {195,8,15997}, {196,8,16133}, + {197,8,16269}, {198,12,16405}, {199,8,16609}, {200,8,16745}, {201,8,16881}, {202,8,17017}, + {203,8,17153}, {204,4,17289}, {205,4,17357}, {206,4,17425}, {207,4,17493}, {208,9,17561}, + {209,9,17714}, {210,9,17867}, {211,9,18020}, {212,9,18173}, {213,9,18326}, {214,9,18479}, + {215,10,18632}, {216,9,18802}, {217,9,18955}, {218,9,19108}, {219,9,19261}, {220,9,19414}, + {221,7,19567}, {222,7,19686}, {223,8,19805}, {224,7,19941}, {225,7,20060}, {226,7,20179}, + {227,7,20298}, {228,7,20417}, {229,7,20536}, {230,12,20655}, {231,7,20859}, {232,7,20978}, + {233,7,21097}, {234,7,21216}, {235,7,21335}, {236,3,21454}, {237,3,21505}, {238,3,21556}, + {239,3,21607}, {240,7,21658}, {241,8,21777}, {242,7,21913}, {243,7,22032}, {244,7,22151}, + {245,7,22270}, {246,7,22389}, {247,10,22508}, {248,7,22678}, {249,8,22797}, {250,8,22933}, + {251,8,23069}, {252,8,23205}, {253,7,23341}, {254,8,23460}, {255,7,23596},}; +static const uint8_t s_font[23715] = { +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,255,0,0,0,48, +255,0,0,0,48,255,0,0,0,47,255,0,0,0,39,247,0,0,0,24,234,0,0,0, +0,0,0,0,0,48,255,0,0,0,48,255,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,216,40,160,92,0,0,216,40,160,92,0,0,216, +40,160,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,214,25, +48,193,0,0,0,0,0,36,202,0,125,117,0,0,0,104,255,255,255,255,255,255,255,0, +0,0,0,165,79,5,231,3,0,0,0,0,0,226,17,57,182,0,0,0,20,255,255,255, +255,255,255,255,120,0,0,0,100,141,0,187,56,0,0,0,0,0,177,65,12,226,1,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,136,16,0,0,0,0,51,198,250,223,106,1,0,0,215,116,141,48,147, +26,0,0,241,36,136,16,0,0,0,0,125,205,195,74,6,0,0,0,0,36,177,168,218, +40,0,0,0,0,136,16,133,146,0,0,176,50,141,44,194,120,0,0,76,200,250,231,149, +7,0,0,0,0,136,16,0,0,0,0,0,0,136,16,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,133,240,194,21,0,0,86,153,0,0,42,215,20,140,133,0,12, +208,18,0,0,79,159,0,68,171,0,141,98,0,0,0,45,214,19,138,135,45,193,1,0, +0,0,0,139,241,196,23,191,47,125,240,198,0,0,0,0,0,96,144,33,222,23,132,0, +0,0,0,16,208,14,68,171,0,60,0,0,0,0,151,89,0,33,221,22,131,0,0,0, +52,187,0,0,0,125,240,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,109,230,230,112,0, +0,0,0,33,247,54,17,146,19,0,0,0,40,243,11,0,0,0,0,0,0,6,221,182, +7,0,0,0,0,0,167,121,149,183,8,0,156,0,35,248,8,1,159,186,11,217,0,45, +248,9,0,3,169,219,176,0,4,214,168,27,19,115,254,179,0,0,32,174,238,241,169,43, +212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,216,0,0,216,0,0,216,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,127,120,0,0,17,231,13,0,0,109,163,0,0,0, +182,99,0,0,0,227,61,0,0,0,243,48,0,0,0,226,61,0,0,0,180,99,0,0, +0,106,162,0,0,0,15,229,12,0,0,0,126,120,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,199,46, +0,0,0,82,177,0,0,0,6,237,28,0,0,0,183,99,0,0,0,142,146,0,0,0, +128,162,0,0,0,142,146,0,0,0,183,99,0,0,6,237,29,0,0,81,178,0,0,0, +198,47,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,84,0, +0,104,111,85,85,111,0,1,100,210,211,102,0,1,99,210,211,101,0,104,112,85,85,112, +0,0,0,84,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,132,0,0,0,0,0, +0,0,0,120,132,0,0,0,0,0,0,0,0,120,132,0,0,0,0,0,188,255,255,255, +255,255,255,200,0,0,0,0,0,120,132,0,0,0,0,0,0,0,0,120,132,0,0,0, +0,0,0,0,0,120,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +152,164,0,0,181,106,0,3,215,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,104,255,255,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,132,0,0,184,132,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,28,0,0,0,106,0,0,0,184,0,0,12,236,0,0, +84,172,0,0,162,94,0,3,233,19,0,62,194,0,0,140,116,0,0,217,38,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,168,245,229, +105,0,0,0,155,191,24,64,243,61,0,5,244,62,0,0,156,156,0,37,255,14,0,0, +108,199,0,49,255,1,0,0,93,212,0,37,255,14,0,0,108,199,0,5,245,62,0,0, +156,156,0,0,156,191,24,64,243,61,0,0,13,169,246,230,105,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,176,255,255,152,0,0,0,0,0,0,148,152, +0,0,0,0,0,0,148,152,0,0,0,0,0,0,148,152,0,0,0,0,0,0,148,152, +0,0,0,0,0,0,148,152,0,0,0,0,0,0,148,152,0,0,0,0,0,0,148,152, +0,0,0,0,132,255,255,255,255,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,81,201,244,209,78,0,0,15,174,53,12,94,248,36,0,0,0,0,0,0, +218,87,0,0,0,0,0,25,251,43,0,0,0,0,6,189,153,0,0,0,0,4,174,179, +5,0,0,0,3,169,186,7,0,0,0,2,162,191,9,0,0,0,0,32,255,255,255,255, +255,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,186,243,219, +101,0,0,0,152,64,11,65,243,60,0,0,0,0,0,0,192,108,0,0,0,0,3,60, +234,43,0,0,0,148,255,254,120,0,0,0,0,0,4,51,222,96,0,0,0,0,0,0, +142,159,0,19,151,37,8,59,226,100,0,0,93,212,246,216,116,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,244,184,0,0,0,0,0,180,190, +184,0,0,0,0,86,170,120,184,0,0,0,15,218,28,120,184,0,0,0,152,116,0,120, +184,0,0,54,210,4,0,120,184,0,0,104,255,255,255,255,255,248,0,0,0,0,0,120, +184,0,0,0,0,0,0,120,184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,180,255,255,255,240,0,0,0,180,96,0,0,0,0,0,0,180,96,0,0, +0,0,0,0,180,240,246,208,79,0,0,0,0,0,12,97,249,50,0,0,0,0,0,0, +177,129,0,0,0,0,0,0,177,128,0,19,154,37,12,94,248,51,0,0,95,214,244,204, +79,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,217,242, +154,9,0,0,76,228,66,11,95,70,0,0,206,95,0,0,0,0,0,7,254,119,232,235, +150,8,0,34,255,195,26,33,209,131,0,25,255,79,0,0,99,204,0,0,235,79,0,0, +100,202,0,0,138,196,26,33,210,126,0,0,7,154,242,233,144,7,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,4,255,255,255,255,255,144,0,0,0,0,0,11, +244,61,0,0,0,0,0,96,221,0,0,0,0,0,0,191,126,0,0,0,0,0,32,252, +32,0,0,0,0,0,126,190,0,0,0,0,0,0,220,95,0,0,0,0,0,61,243,11, +0,0,0,0,0,156,159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,37,187,243,231,140,2,0,0,198,158,14,41,225,101,0,0,241,62,0,0, +155,144,0,0,164,156,13,39,221,68,0,0,28,216,255,255,146,0,0,5,219,125,12,33, +199,126,0,37,255,12,0,0,108,196,0,7,238,123,11,31,198,148,0,0,62,200,245,235, +161,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,189,244,221, +86,0,0,4,216,142,14,67,244,45,0,43,254,9,0,0,171,141,0,45,253,9,0,0, +171,187,0,5,223,139,13,65,245,197,0,0,48,197,246,201,156,169,0,0,0,0,0,0, +192,114,0,0,125,46,19,122,230,11,0,0,48,204,246,187,41,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,152,164,0,0,152,164,0,0,0,0,0,0,0,0,0,0, +152,164,0,0,152,164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,152,164,0,0,152,164,0,0,0,0,0,0,0,0,0,0,152,164,0,0, +181,106,0,3,215,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,1,57,144,173,0,0,0,0,53,140,223,193, +109,26,0,0,108,219,191,107,24,0,0,0,0,0,108,219,190,106,24,0,0,0,0,0, +0,0,54,141,223,192,108,25,0,0,0,0,0,0,1,58,145,173,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,188,255,255,255,255,255,255,200,0,0,0,0,0,0,0,0,0,0, +0,0,188,255,255,255,255,255,255,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,164,148,61,1,0,0,0,0,0,0,23,105, +189,225,144,57,1,0,0,0,0,0,0,21,103,187,221,116,0,0,0,0,0,21,102,186, +221,117,0,0,22,104,188,226,145,58,1,0,0,0,164,149,62,2,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,1,110,220,241,162,0,34,146,22,32,223,0,0,0,0,0,200,0,0,0,2,146,189, +0,0,0,120,184,5,0,0,0,170,116,0,0,0,0,0,0,0,0,0,0,180,124,0, +0,0,0,180,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,69,181, +238,246,206,110,4,0,0,0,0,131,211,89,26,9,52,162,191,10,0,0,84,191,10,0, +0,0,0,0,130,136,0,0,208,31,0,135,239,218,144,128,5,218,0,24,194,0,66,209, +29,26,201,128,0,186,0,46,166,0,110,130,0,0,119,128,0,211,0,26,191,0,67,206, +28,25,201,138,126,153,0,0,210,28,0,138,239,211,143,220,132,8,0,0,94,187,7,0, +0,0,0,0,0,0,0,0,0,143,205,76,14,18,70,195,45,0,0,0,0,0,80,191, +242,240,203,113,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,192,239,7,0,0,0,0,32,247,216,85,0,0,0,0,126,176,121, +180,0,0,0,0,220,89,34,251,23,0,0,60,246,12,0,203,113,0,0,155,171,0,0, +116,208,0,9,241,255,255,255,255,255,0,89,234,6,0,0,0,186,0,184,138,0,0,0, +0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,255,255,245, +193,45,0,0,212,92,0,13,147,209,0,0,212,92,0,0,54,250,0,0,212,92,0,12, +145,193,0,0,212,255,255,255,237,57,0,0,212,92,0,8,86,241,0,0,212,92,0,0, +0,231,0,0,212,92,0,7,83,252,0,0,212,255,255,249,214,96,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,83,200,246,231,171,0,0,102,241,98,23, +21,81,0,9,239,100,0,0,0,0,0,60,255,13,0,0,0,0,0,79,244,0,0,0, +0,0,0,60,255,13,0,0,0,0,0,9,239,99,0,0,0,0,0,0,103,239,96,21, +21,81,0,0,0,84,201,246,232,170,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,212,255,254,241,200,110,3,0,0,212,92,0,25,82,222,170, +0,0,212,92,0,0,0,48,253,0,0,212,92,0,0,0,0,218,0,0,212,92,0,0, +0,0,192,0,0,212,92,0,0,0,0,219,0,0,212,92,0,0,0,48,253,0,0,212, +92,0,24,82,222,167,0,0,212,255,255,242,200,109,3,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,212,255,255,255,255,180,0,0,212,92,0, +0,0,0,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0,0,0,0,212,255,255, +255,255,136,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0,0,0,0,212,92,0, +0,0,0,0,0,212,255,255,255,255,208,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,212,255,255,255,255,0,0,212,92,0,0,0,0,0,212,92,0,0,0,0,0,212,92, +0,0,0,0,0,212,255,255,255,212,0,0,212,92,0,0,0,0,0,212,92,0,0,0, +0,0,212,92,0,0,0,0,0,212,92,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,81,197,245,237,193,79,0,0,103,240,100,26,15,61,175, +0,9,239,98,0,0,0,0,0,0,60,255,13,0,0,0,0,0,0,80,244,0,0,0, +204,255,255,0,60,255,13,0,0,0,0,220,0,9,239,96,0,0,0,0,220,0,0,103, +238,98,25,9,57,236,0,0,0,81,198,245,239,200,101,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,0,0,0,88,216, +0,0,212,92,0,0,0,88,216,0,0,212,92,0,0,0,88,216,0,0,212,92,0,0, +0,88,216,0,0,212,255,255,255,255,255,216,0,0,212,92,0,0,0,88,216,0,0,212, +92,0,0,0,88,216,0,0,212,92,0,0,0,88,216,0,0,212,92,0,0,0,88,216, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92, +0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92, +0,0,212,92,0,0,212,92,0,0,222,77,1,61,251,32,159,229,111,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,0,0,70,240,0,0,212,92, +0,76,240,75,0,0,212,92,82,239,68,0,0,0,212,175,239,62,0,0,0,0,212,242, +196,7,0,0,0,0,212,105,200,180,5,0,0,0,212,92,16,205,173,4,0,0,212,92, +0,19,210,167,0,0,212,92,0,0,22,214,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,212,92,0,0,0,0,0,212,92,0,0,0,0,0,212,92,0,0,0,0,0,212, +92,0,0,0,0,0,212,92,0,0,0,0,0,212,92,0,0,0,0,0,212,92,0,0, +0,0,0,212,92,0,0,0,0,0,212,255,255,255,255,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,212,254,33,0,0,0,197,255,0,0,212, +213,129,0,0,39,219,248,0,0,212,118,223,1,0,137,123,248,0,0,212,84,192,67,3, +228,28,248,0,0,212,84,95,164,76,184,0,248,0,0,212,84,11,233,187,86,0,248,0, +0,212,84,0,157,237,7,0,248,0,0,212,84,0,0,0,0,0,248,0,0,212,84,0, +0,0,0,0,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,212,242,19,0,0,88,204,0,0,212,237,138,0, +0,88,204,0,0,212,124,242,24,0,88,204,0,0,212,84,161,146,0,88,204,0,0,212, +84,34,243,29,88,204,0,0,212,84,0,153,155,88,204,0,0,212,84,0,29,244,123,204, +0,0,212,84,0,0,146,237,204,0,0,212,84,0,0,24,245,204,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,91,209,248, +233,153,18,0,0,106,239,88,15,41,183,206,0,9,239,98,0,0,0,10,231,0,60,255, +13,0,0,0,0,153,0,80,244,0,0,0,0,0,128,0,61,255,13,0,0,0,0,153, +0,9,240,98,0,0,0,10,231,0,0,109,239,87,15,40,183,209,0,0,0,94,210,249, +234,155,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,255,255, +235,165,0,0,212,92,0,31,202,0,0,212,92,0,0,119,0,0,212,92,0,31,202,0, +0,212,255,255,236,168,0,0,212,92,0,0,0,0,0,212,92,0,0,0,0,0,212,92, +0,0,0,0,0,212,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,91,209,248,233,154,19,0,0,106,239,88,15,41,183,209,0,9,239,98, +0,0,0,10,231,0,60,255,13,0,0,0,0,153,0,80,244,0,0,0,0,0,128,0, +60,255,13,0,0,0,0,153,0,9,240,98,0,0,0,10,231,0,0,108,239,87,15,40, +183,201,0,0,0,93,210,250,255,182,14,0,0,0,0,0,0,118,227,15,0,0,0,0, +0,0,3,203,158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,212,255,255,235,169,21,0,0,212,92,0,29,198,157,0, +0,212,92,0,0,119,202,0,0,212,92,0,28,199,149,0,0,212,255,255,255,192,9,0, +0,212,92,1,55,236,72,0,0,212,92,0,0,113,212,0,0,212,92,0,0,11,237,0, +0,212,92,0,0,0,131,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,53,192,242,222,133,12,0,7,234,125,15,28,118,94,0,40,255,7,0,0,0,0,0, +9,232,142,39,1,0,0,0,0,40,166,234,237,154,19,0,0,0,0,0,36,190,176,0, +0,0,0,0,0,84,232,0,41,163,53,10,35,189,180,0,2,89,199,245,231,164,24,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,8,255,255,255,255,255,255,0,0,0,0,236,68, +0,0,0,0,0,236,68,0,0,0,0,0,236,68,0,0,0,0,0,236,68,0,0,0, +0,0,236,68,0,0,0,0,0,236,68,0,0,0,0,0,236,68,0,0,0,0,0,236, +68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,244,60,0,0, +0,116,188,0,0,244,60,0,0,0,116,188,0,0,244,60,0,0,0,116,188,0,0,244, +60,0,0,0,116,188,0,0,244,60,0,0,0,116,188,0,0,239,65,0,0,0,121,183, +0,0,208,99,0,0,0,156,151,0,0,118,215,47,10,72,244,62,0,0,4,127,221,246, +211,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +185,130,0,0,0,0,79,0,89,223,1,0,0,0,172,0,9,241,62,0,0,17,248,0, +0,155,156,0,0,103,208,0,0,60,241,9,0,197,113,0,0,0,220,88,34,250,23,0, +0,0,126,182,127,180,0,0,0,0,32,250,228,85,0,0,0,0,0,192,239,7,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,121,182,0,0,0,219,182,0,0,0,219,0,59,241,3,0, +24,224,232,3,0,24,255,0,6,246,51,0,86,159,193,51,0,86,220,0,0,191,113,0, +148,98,133,113,0,148,158,0,0,128,175,0,209,37,72,175,0,209,95,0,0,66,235,17, +230,0,14,233,17,253,33,0,0,9,250,119,171,0,0,207,119,227,0,0,0,0,198,233, +110,0,0,147,233,165,0,0,0,0,135,255,50,0,0,86,255,103,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,12,225,86,0,0,14,226,0,0,72,233,19,0,157,167,0,0,0,163,164, +73,232,19,0,0,0,19,233,239,81,0,0,0,0,0,175,239,13,0,0,0,0,77,232, +184,149,0,0,0,17,230,81,25,238,60,0,0,163,165,0,0,100,216,0,78,231,18,0, +0,0,189,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,180,147,0,0,0,64,0,27, +238,60,0,9,220,0,0,98,217,8,140,183,0,0,0,185,176,239,30,0,0,0,30,249, +111,0,0,0,0,0,236,68,0,0,0,0,0,236,68,0,0,0,0,0,236,68,0,0, +0,0,0,236,68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,84,255,255,255,255, +255,255,0,0,0,0,0,0,81,241,0,0,0,0,0,38,241,83,0,0,0,0,12,213, +137,0,0,0,0,0,169,190,3,0,0,0,0,114,227,21,0,0,0,0,62,245,55,0, +0,0,0,26,232,104,0,0,0,0,0,115,255,255,255,255,255,255,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +248,255,132,0,0,248,28,0,0,0,248,28,0,0,0,248,28,0,0,0,248,28,0,0, +0,248,28,0,0,0,248,28,0,0,0,248,28,0,0,0,248,28,0,0,0,248,28,0, +0,0,248,255,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,217,38,0,0,140,116,0,0,62,194,0,0,3,233,19,0, +0,162,94,0,0,84,172,0,0,12,236,0,0,0,184,0,0,0,106,0,0,0,28,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,212,255,168,0,0,0,112,168,0,0,0,112,168,0,0, +0,112,168,0,0,0,112,168,0,0,0,112,168,0,0,0,112,168,0,0,0,112,168,0, +0,0,112,168,0,0,0,112,168,0,0,212,255,168,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,229,232,51, +0,0,0,0,0,54,225,81,70,225,61,0,0,0,64,211,46,0,0,38,207,73,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,255,255,255, +255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,134,144,0,0,0,0,0,145,98,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,204,255,248,201,50,0,0,0,0,9,105,219,0,0, +0,0,0,0,222,0,0,105,218,249,255,255,0,39,239,54,8,0,223,0,50,236,38,12, +116,255,0,0,140,240,230,151,212,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,232,44,0,0,0,0,0,0,232, +44,0,0,0,0,0,0,232,44,0,0,0,0,0,0,232,120,215,238,153,6,0,0,232, +207,33,32,207,124,0,0,232,82,0,0,80,213,0,0,232,51,0,0,48,239,0,0,232, +82,0,0,80,213,0,0,232,205,32,31,205,126,0,0,232,121,216,239,155,7,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,26,169,235,220,76,0,2,203,157,23,34,143,0,49,241,7,0,0,0,0,78,212,0, +0,0,0,0,49,241,7,0,0,0,0,1,203,157,23,33,143,0,0,27,173,237,218,75, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,140,136,0,0,0,0,0,0,140,136,0,0,0,0, +0,0,140,136,0,0,42,201,241,182,162,136,0,3,217,130,14,83,252,136,0,54,235,3, +0,0,180,136,0,80,207,0,0,0,148,136,0,54,234,3,0,0,180,136,0,3,219,128, +14,80,252,136,0,0,44,202,241,182,162,136,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,170,237,225,113,0,1,198, +147,17,40,218,0,47,239,3,0,0,106,0,78,255,252,253,254,255,0,49,229,1,0,0, +0,0,2,199,142,22,20,98,0,0,23,164,233,233,156,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,33,203,0,0,142,148,0,0,173,100,0,184,255,255,0, +0,176,100,0,0,176,100,0,0,176,100,0,0,176,100,0,0,176,100,0,0,176,100,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,202,241,182,162,136,0, +3,219,127,14,79,251,136,0,54,234,3,0,0,178,136,0,80,207,0,0,0,147,136,0, +55,234,3,0,0,178,136,0,4,220,127,14,78,251,136,0,0,47,203,241,182,169,130,0, +0,0,0,0,0,186,101,0,0,103,60,13,96,246,27,0,0,36,190,243,209,69,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,232,44,0,0,0,0,0,0,232,44,0,0,0,0,0, +0,232,44,0,0,0,0,0,0,232,116,213,242,168,7,0,0,232,190,29,26,213,99,0, +0,232,64,0,0,133,143,0,0,232,44,0,0,124,152,0,0,232,44,0,0,124,152,0, +0,232,44,0,0,124,152,0,0,232,44,0,0,124,152,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,224,0,0,224,0, +0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,0,0,0,224,0, +0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,227,0,31,246,56, +242,128,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,232,44,0,0,0,0,0,232,44,0,0,0,0,0,232,44,0,0,0,0, +0,232,44,0,55,227,0,0,232,44,66,228,59,0,0,232,122,226,49,0,0,0,232,233, +147,0,0,0,0,232,66,214,121,0,0,0,232,44,25,218,115,0,0,232,44,0,28,220, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,0,0,224,0,0,224,0,0, +224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,232,129,214,245,156,45,201,246,182,14,0,0,232,189,25, +38,236,215,48,17,194,117,0,0,232,64,0,0,176,127,0,0,112,163,0,0,232,44,0, +0,168,108,0,0,104,172,0,0,232,44,0,0,168,108,0,0,104,172,0,0,232,44,0, +0,168,108,0,0,104,172,0,0,232,44,0,0,168,108,0,0,104,172,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,232,116,213, +242,168,7,0,0,232,190,29,26,213,99,0,0,232,64,0,0,133,143,0,0,232,44,0, +0,124,152,0,0,232,44,0,0,124,152,0,0,232,44,0,0,124,152,0,0,232,44,0, +0,124,152,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,36,187,242,215,86,0,3,214,138,15,72,244,0,53,239,5,0, +0,158,0,79,211,0,0,0,124,0,53,239,5,0,0,158,0,3,215,137,15,71,245,0, +0,38,189,243,216,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,232,120,215,238,153,6,0,0,232,207,33,32, +207,124,0,0,232,82,0,0,80,213,0,0,232,51,0,0,48,239,0,0,232,82,0,0, +80,213,0,0,232,205,32,31,205,126,0,0,232,121,216,239,155,7,0,0,232,44,0,0, +0,0,0,0,232,44,0,0,0,0,0,0,232,44,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,42,201,241,182,162,136,0,3,217,130,14,83,252,136,0,54,235,3,0,0, +180,136,0,80,207,0,0,0,148,136,0,54,234,3,0,0,180,136,0,3,219,128,14,80, +252,136,0,0,44,202,241,182,162,136,0,0,0,0,0,0,140,136,0,0,0,0,0,0, +140,136,0,0,0,0,0,0,140,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,232,117,212,0,0,232,198,31,0,0,232,72,0,0,0,232,45,0,0,0,232,44, +0,0,0,232,44,0,0,0,232,44,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,232,237, +152,0,51,230,37,15,101,0,46,223,24,0,0,0,0,94,193,197,124,0,0,0,0,12, +172,0,78,119,26,16,173,0,9,133,229,240,174,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,228,52,0,0,0,228,52,0,0,172,255,255,255, +0,0,228,52,0,0,0,228,52,0,0,0,228,52,0,0,0,226,52,0,0,0,204,97, +1,0,0,82,228,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,252,24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,252,24,0,0, +144,132,0,0,252,24,0,0,144,132,0,0,244,32,0,0,164,132,0,0,199,130,10,71, +246,132,0,0,53,212,241,175,163,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,120,172,0,0,0,145,0,31,246,14,0, +3,231,0,0,196,94,0,69,221,0,0,106,183,0,159,131,0,0,21,247,28,240,41,0, +0,0,183,187,207,0,0,0,0,93,255,117,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,97,179,0,0,220,170,0,0,227,0,34,240,2,25,225,229,0,34, +239,0,0,227,50,88,154,202,40,97,178,0,0,164,114,150,91,138,103,160,115,0,0,101, +178,211,28,75,166,223,52,0,0,38,243,220,0,14,238,242,3,0,0,0,231,159,0,0, +204,183,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,238,50,0,25,234,0,0,101,215, +10,184,140,0,0,0,178,211,210,7,0,0,0,77,255,101,0,0,0,12,221,156,229,18, +0,0,157,170,0,154,170,0,79,229,18,0,12,220,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,116,175,0,0,0,149,0,22,245,20,0, +7,237,0,0,176,111,0,86,213,0,0,78,207,0,182,120,0,0,4,232,73,250,28,0, +0,0,139,234,189,0,0,0,0,41,255,95,0,0,0,0,48,245,12,0,0,0,3,161, +155,0,0,0,12,255,213,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,88,255,255,255,255,0,0,0,0,8,203,0,0,0,0,165,149,0, +0,0,119,192,4,0,0,75,221,20,0,0,40,230,47,0,0,0,124,255,255,255,255,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,49,211,248,36,0,0,0,0,151,153,6,0,0, +0,0,0,171,104,0,0,0,0,0,0,175,102,0,0,0,0,0,27,224,72,0,0,0, +0,128,255,190,1,0,0,0,0,0,30,227,70,0,0,0,0,0,0,175,102,0,0,0, +0,0,0,171,104,0,0,0,0,0,0,151,152,6,0,0,0,0,0,51,213,249,36,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,120,132,0,0,120,132,0,0,120,132,0,0,120,132,0, +0,120,132,0,0,120,132,0,0,120,132,0,0,120,132,0,0,120,132,0,0,120,132,0, +0,120,132,0,0,120,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,241,171, +3,0,0,0,0,0,21,229,58,0,0,0,0,0,0,196,79,0,0,0,0,0,0,194, +82,0,0,0,0,0,0,164,151,8,0,0,0,0,0,44,239,255,36,0,0,0,0,162, +153,9,0,0,0,0,0,194,83,0,0,0,0,0,0,196,79,0,0,0,0,0,20,229, +58,0,0,0,0,127,242,173,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,2,0,0,52,193,243,194,86,12,54,157,0,0,125, +55,13,81,190,244,198,59,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,48,255,0,0,0,48,255,0,0,0,0,0,0,0,0, +24,234,0,0,0,39,247,0,0,0,47,255,0,0,0,48,255,0,0,0,48,255,0,0, +0,48,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,8,148,0,0,0,0,0,0,8,148,0,0,0,0,2,124,224,247,144,4,0,0, +118,219,61,156,110,47,0,0,216,85,8,148,0,0,0,0,243,47,8,148,0,0,0,0, +216,83,8,148,0,0,0,0,120,216,58,156,111,47,0,0,3,126,225,249,147,4,0,0, +0,0,8,148,0,0,0,0,0,0,8,148,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25,183,243,184,21,0,0, +0,152,179,16,65,92,0,0,0,204,92,0,0,0,0,0,0,219,80,0,0,0,0,8, +255,255,255,255,156,0,0,0,0,220,80,0,0,0,0,0,0,220,80,0,0,0,0,0, +0,220,80,0,0,0,0,64,255,255,255,255,255,148,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43, +154,0,0,0,25,180,0,14,204,184,239,215,209,127,0,0,105,177,19,49,229,22,0,0, +161,76,0,0,164,72,0,0,105,178,19,48,227,19,0,14,205,185,241,214,206,129,0,47, +152,0,0,0,22,167,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55, +216,5,0,0,64,208,0,0,150,112,0,2,204,56,0,0,15,214,18,98,151,0,0,52, +255,255,157,230,255,212,0,0,0,13,230,147,0,0,0,52,255,255,255,255,255,212,0,0, +0,0,196,104,0,0,0,0,0,0,196,104,0,0,0,0,0,0,196,104,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,120,132,0,0,120,132,0,0,120,132,0,0,120,132,0,0,0,0,0,0, +0,0,0,0,120,132,0,0,120,132,0,0,120,132,0,0,120,132,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,121,236,255,220,0,6,254,55,1,0,0,0,179,166,27,0,0,31,201,126, +232,95,0,107,140,0,37,226,0,52,231,54,0,146,0,0,70,224,155,204,0,0,0,12, +146,188,0,0,0,0,55,251,0,0,252,255,232,107,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,188,116,116,188,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,178,242,242,177,45, +0,0,0,0,0,60,210,83,13,13,81,208,59,0,0,0,3,191,23,134,231,255,192,19, +187,2,0,0,56,110,92,196,33,0,0,0,109,54,0,0,82,70,141,104,0,0,0,0, +70,81,0,0,57,110,92,196,33,1,0,0,109,55,0,0,4,192,23,135,231,255,192,19, +189,2,0,0,0,60,216,87,22,22,85,215,59,0,0,0,0,0,47,181,243,243,180,46, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,248,254,213,47,0,0,0,2,70,174,0,10,176,244,255,208,0,71,185,22, +81,212,0,17,203,245,125,212,0,0,0,0,0,0,0,48,255,255,255,216,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,30,124,0,103,0,0,57,207,59,146,163,0, +10,239,55,111,192,0,0,0,58,207,59,147,162,0,0,0,30,124,0,103,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,188,255,255,255,255,255,255, +200,0,0,0,0,0,0,0,0,52,200,0,0,0,0,0,0,0,0,52,200,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,104,255, +255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,46,178,242,242,177,45,0,0,0,0,0,60,210,83,13, +13,81,208,59,0,0,0,3,191,21,200,255,238,120,19,187,2,0,0,56,110,0,200,32, +49,227,0,109,54,0,0,82,70,0,200,255,245,82,0,70,81,0,0,57,110,0,200,40, +167,100,0,109,55,0,0,4,192,21,200,32,17,216,45,189,2,0,0,0,60,216,87,22, +22,85,215,59,0,0,0,0,0,47,181,243,243,180,46,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,255,255,192,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,57,224,222,54,0,0,187,44,45,186,0,0,188,42,43,187,0,0,61,227,224,57,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,132, +0,0,0,0,0,0,0,0,120,132,0,0,0,0,0,188,255,255,255,255,255,255,200,0, +0,0,0,0,120,132,0,0,0,0,0,0,0,0,120,132,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,188,255,255,255,255,255,255,200,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,104,255,244,141,0,0,0,33,221,0,0,0,120,76,0,15,153,65,0,0, +115,255,255,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,255,247,157,0,0,0, +26,231,0,0,120,255,143,0,0,0,22,218,0,108,255,244,167,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,153,128,0,0,0,107,139,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,24,0,0,144,132,0, +0,252,24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,252,24,0,0,144,132,0, +0,252,31,0,0,158,132,0,0,252,133,10,50,236,146,0,0,252,140,236,208,103,240,0, +0,252,24,0,0,0,0,0,0,252,24,0,0,0,0,0,0,252,24,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40,190,246,255,255,84,0, +0,209,255,255,100,124,84,0,8,255,255,255,100,124,84,0,0,224,255,255,100,124,84,0, +0,59,220,255,100,124,84,0,0,0,0,123,100,124,84,0,0,0,0,112,100,124,84,0, +0,0,0,112,100,124,84,0,0,0,0,112,100,124,84,0,0,0,0,112,100,124,84,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,184,132,0,0,184,132,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,8,179,3,0,0,65,248,216,10,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,255, +244,0,0,0,0,216,0,0,0,0,216,0,0,0,0,216,0,0,20,255,255,255,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,239,221,69,0,62,205,22, +62,225,0,103,133,0,0,221,0,62,205,21,63,227,0,0,138,240,223,72,0,0,0,0, +0,0,0,48,255,255,255,216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,142, +11,72,81,0,0,0,91,199,45,182,123,0,0,0,106,199,6,215,0,0,91,199,45,181, +124,0,0,143,11,72,81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,255,244,0, +0,0,0,59,180,0,0,0,0,0,216,0,0,0,4,200,34,0,0,0,0,0,216,0, +0,0,113,126,0,0,0,0,0,0,216,0,0,26,205,7,0,0,0,0,20,255,255,255, +40,168,71,0,8,202,116,0,0,0,0,0,68,171,0,0,117,120,116,0,0,0,0,6, +204,28,0,66,53,100,116,0,0,0,0,123,117,0,0,202,255,255,255,0,0,0,32,203, +5,0,0,0,0,100,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,52,255,244,0,0,0,0,59,180,0,0,0,0,0,216,0, +0,0,4,200,34,0,0,0,0,0,216,0,0,0,113,126,0,0,0,0,0,0,216,0, +0,26,205,7,0,0,0,0,20,255,255,255,40,168,71,152,255,236,101,0,0,0,0,0, +68,171,0,0,0,67,187,0,0,0,0,6,204,28,0,0,6,147,42,0,0,0,0,123, +117,0,0,33,163,37,0,0,0,0,32,203,5,0,0,163,255,255,224,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,255,247,157, +0,0,0,59,180,0,0,0,0,0,26,231,7,0,4,200,34,0,0,0,0,120,255,143, +0,0,113,126,0,0,0,0,0,0,22,218,36,26,205,7,0,0,0,0,108,255,244,167, +4,168,71,0,8,202,116,0,0,0,0,0,68,171,0,0,117,120,116,0,0,0,0,6, +204,28,0,66,53,100,116,0,0,0,0,123,117,0,0,202,255,255,255,0,0,0,32,203, +5,0,0,0,0,100,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,255, +20,0,0,0,28,255,20,0,0,0,0,0,0,0,0,0,16,255,11,0,0,0,42,243, +1,0,0,16,207,130,0,0,0,183,160,0,0,0,22,255,24,0,0,0,9,245,100,13, +87,0,0,82,222,239,166,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,20,221,25,0,0,0,0,0,0,82,161,0,0,0,0,0, +0,192,239,7,0,0,0,0,32,247,216,85,0,0,0,0,126,176,121,180,0,0,0,0, +220,89,34,251,23,0,0,60,246,12,0,203,113,0,0,155,171,0,0,116,208,0,9,241, +255,255,255,255,255,0,89,234,6,0,0,0,186,0,184,138,0,0,0,0,83,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,4,209,50,0,0,0,0,0,110,129,0,0,0,0,0,0,192,239,7,0,0,0,0, +32,247,216,85,0,0,0,0,126,176,121,180,0,0,0,0,220,89,34,251,23,0,0,60, +246,12,0,203,113,0,0,155,171,0,0,116,208,0,9,241,255,255,255,255,255,0,89,234, +6,0,0,0,186,0,184,138,0,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,187,212,15,0,0,0,0, +93,128,73,147,0,0,0,0,0,192,239,7,0,0,0,0,32,247,216,85,0,0,0,0, +126,176,121,180,0,0,0,0,220,89,34,251,23,0,0,60,246,12,0,203,113,0,0,155, +171,0,0,116,208,0,9,241,255,255,255,255,255,0,89,234,6,0,0,0,186,0,184,138, +0,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,109,230,67,197,2,0,0,0,190,46,211,156,0,0,0,0, +0,192,239,7,0,0,0,0,32,247,216,85,0,0,0,0,126,176,121,180,0,0,0,0, +220,89,34,251,23,0,0,60,246,12,0,203,113,0,0,155,171,0,0,116,208,0,9,241, +255,255,255,255,255,0,89,234,6,0,0,0,186,0,184,138,0,0,0,0,83,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +160,144,88,216,0,0,0,0,0,0,0,0,0,0,0,0,0,192,239,7,0,0,0,0, +32,247,216,85,0,0,0,0,126,176,121,180,0,0,0,0,220,89,34,251,23,0,0,60, +246,12,0,203,113,0,0,155,171,0,0,116,208,0,9,241,255,255,255,255,255,0,89,234, +6,0,0,0,186,0,184,138,0,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,17,202,226,48,0,0,0,0,109,114,54,165,0,0,0,0, +97,112,52,149,0,0,0,0,5,232,255,36,0,0,0,0,38,245,208,93,0,0,0,0, +133,171,116,187,0,0,0,1,224,87,32,252,27,0,0,65,246,12,0,203,118,0,0,159, +174,0,0,118,211,0,10,242,255,255,255,255,255,0,91,234,6,0,0,0,186,0,185,138, +0,0,0,0,83,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,129,255,255,255,255,255,255, +208,0,0,0,3,228,85,184,120,0,0,0,0,0,0,0,81,236,6,184,120,0,0,0, +0,0,0,0,185,143,0,184,120,0,0,0,0,0,0,34,254,44,0,184,255,255,255,255, +164,0,0,137,201,0,0,184,120,0,0,0,0,0,6,234,255,255,255,255,120,0,0,0, +0,0,89,234,9,0,0,184,120,0,0,0,0,0,192,123,0,0,0,184,255,255,255,255, +236,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,83,200,246,231,171,0,0,102,241,98,23,21, +81,0,9,239,100,0,0,0,0,0,60,255,13,0,0,0,0,0,79,244,0,0,0,0, +0,0,60,255,13,0,0,0,0,0,9,239,99,0,0,0,0,0,0,103,239,96,21,21, +81,0,0,0,84,201,246,232,170,0,0,0,0,0,34,157,0,0,0,0,0,120,250,169, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,51,211,5,0,0,0,0,0,0,130,113,0, +0,0,0,212,255,255,255,255,180,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0, +0,0,0,212,92,0,0,0,0,0,0,212,255,255,255,255,136,0,0,212,92,0,0,0, +0,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0,0,0,0,212,255,255,255,255, +208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,24,219,20,0,0,0,0,0,158,81,0,0,0,0,212,255,255,255,255, +180,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0, +0,0,0,212,255,255,255,255,136,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0, +0,0,0,212,92,0,0,0,0,0,0,212,255,255,255,255,208,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12,210,191,1, +0,0,0,0,141,80,120,100,0,0,0,212,255,255,255,255,180,0,0,212,92,0,0,0, +0,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0,0,0,0,212,255,255,255,255, +136,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0, +0,0,0,212,255,255,255,255,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,208,96,136,168,0,0,0,0,0,0,0,0, +0,0,0,212,255,255,255,255,180,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0, +0,0,0,212,92,0,0,0,0,0,0,212,255,255,255,255,136,0,0,212,92,0,0,0, +0,0,0,212,92,0,0,0,0,0,0,212,92,0,0,0,0,0,0,212,255,255,255,255, +208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,185,0,0,0,166, +77,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212, +92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,208,0,0,189,50,0,0,212, +92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212, +92,0,0,212,92,0,0,212,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,30,222,161,0,171,50,155,0,0,212,92,0,0,212, +92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212, +92,0,0,212,92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,244,60,172,0,0,0,0,0,0,212,92,0,0,212,92,0,0,212, +92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212,92,0,0,212, +92,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,196,255,255,243,204,118,6,0,0,196,108,0,23,76,215,185,0, +0,196,108,0,0,0,36,249,0,0,196,108,0,0,0,0,202,0,240,255,255,255,100,0, +0,176,0,0,196,108,0,0,0,0,203,0,0,196,108,0,0,0,36,249,0,0,196,108, +0,22,76,215,182,0,0,196,255,255,244,205,117,6,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31, +231,139,111,92,0,0,0,0,103,103,149,227,21,0,0,0,212,242,19,0,0,88,204,0, +0,212,237,138,0,0,88,204,0,0,212,124,242,24,0,88,204,0,0,212,84,161,146,0, +88,204,0,0,212,84,34,243,29,88,204,0,0,212,84,0,153,155,88,204,0,0,212,84, +0,29,244,123,204,0,0,212,84,0,0,146,237,204,0,0,212,84,0,0,24,245,204,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,95,173,0,0,0,0,0,0,0,0,177,66,0,0,0, +0,0,91,209,248,233,153,18,0,0,106,239,88,15,41,183,206,0,9,239,98,0,0,0, +10,231,0,60,255,13,0,0,0,0,153,0,80,244,0,0,0,0,0,128,0,61,255,13, +0,0,0,0,153,0,9,240,98,0,0,0,10,231,0,0,109,239,87,15,40,183,209,0, +0,0,94,210,249,234,155,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,201,3,0,0, +0,0,0,1,196,41,0,0,0,0,0,91,209,248,233,153,18,0,0,106,239,88,15,41, +183,206,0,9,239,98,0,0,0,10,231,0,60,255,13,0,0,0,0,153,0,80,244,0, +0,0,0,0,128,0,61,255,13,0,0,0,0,153,0,9,240,98,0,0,0,10,231,0, +0,109,239,87,15,40,183,209,0,0,0,94,210,249,234,155,19,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,38,227,150,0,0,0,0,0,0,179,41,166,54,0,0,0,0,91,209,248,233, +153,18,0,0,106,239,88,15,41,183,206,0,9,239,98,0,0,0,10,231,0,60,255,13, +0,0,0,0,153,0,80,244,0,0,0,0,0,128,0,61,255,13,0,0,0,0,153,0, +9,240,98,0,0,0,10,231,0,0,109,239,87,15,40,183,209,0,0,0,94,210,249,234, +155,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,1,200,186,62,156,0,0,0,0,39,163,97,237, +67,0,0,0,0,91,209,248,233,153,18,0,0,106,239,88,15,41,183,206,0,9,239,98, +0,0,0,10,231,0,60,255,13,0,0,0,0,153,0,80,244,0,0,0,0,0,128,0, +61,255,13,0,0,0,0,153,0,9,240,98,0,0,0,10,231,0,0,109,239,87,15,40, +183,209,0,0,0,94,210,249,234,155,19,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,48,184, +120,0,0,0,0,0,0,0,0,0,0,0,0,0,91,209,248,233,153,18,0,0,106,239, +88,15,41,183,206,0,9,239,98,0,0,0,10,231,0,60,255,13,0,0,0,0,153,0, +80,244,0,0,0,0,0,128,0,61,255,13,0,0,0,0,153,0,9,240,98,0,0,0, +10,231,0,0,109,239,87,15,40,183,209,0,0,0,94,210,249,234,155,19,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,182, +12,0,0,8,176,43,0,0,1,157,192,9,6,181,170,3,0,0,0,2,165,186,174,175, +4,0,0,0,0,0,7,230,237,12,0,0,0,0,0,2,164,186,174,175,4,0,0,0, +1,157,193,10,6,181,169,3,0,0,33,183,12,0,0,8,177,43,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,93,209,248,222,138,103,0,0,109,239,88,15,42,195,246,0,9,240,98,0,0,35,204, +230,0,61,255,13,0,19,202,44,151,0,77,242,0,7,190,67,0,127,0,48,254,9,167, +97,0,0,153,0,6,228,196,130,0,0,10,231,0,0,144,251,87,13,40,183,209,0,38, +190,78,200,244,235,156,19,0,2,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,85,0,0,0,0,0, +0,0,27,207,9,0,0,0,0,244,60,0,0,0,116,188,0,0,244,60,0,0,0,116, +188,0,0,244,60,0,0,0,116,188,0,0,244,60,0,0,0,116,188,0,0,244,60,0, +0,0,116,188,0,0,239,65,0,0,0,121,183,0,0,208,99,0,0,0,156,151,0,0, +118,215,47,10,72,244,62,0,0,4,127,221,246,211,90,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,147,117,0,0,0,0,0,0,42,194,2,0,0,0,0,244,60,0,0,0,116, +188,0,0,244,60,0,0,0,116,188,0,0,244,60,0,0,0,116,188,0,0,244,60,0, +0,0,116,188,0,0,244,60,0,0,0,116,188,0,0,239,65,0,0,0,121,183,0,0, +208,99,0,0,0,156,151,0,0,118,215,47,10,72,244,62,0,0,4,127,221,246,211,90, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,120,233,63,0,0,0,0,0,31,186,27,191,6, +0,0,0,244,60,0,0,0,116,188,0,0,244,60,0,0,0,116,188,0,0,244,60,0, +0,0,116,188,0,0,244,60,0,0,0,116,188,0,0,244,60,0,0,0,116,188,0,0, +239,65,0,0,0,121,183,0,0,208,99,0,0,0,156,151,0,0,118,215,47,10,72,244, +62,0,0,4,127,221,246,211,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,216,16,255,32, +0,0,0,0,0,0,0,0,0,0,0,0,244,60,0,0,0,116,188,0,0,244,60,0, +0,0,116,188,0,0,244,60,0,0,0,116,188,0,0,244,60,0,0,0,116,188,0,0, +244,60,0,0,0,116,188,0,0,239,65,0,0,0,121,183,0,0,208,99,0,0,0,156, +151,0,0,118,215,47,10,72,244,62,0,0,4,127,221,246,211,90,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,74,188,1,0,0,0,5,203,31,0,0,180,147,0,0,0,64,0,27,238,60,0,9, +220,0,0,98,217,8,140,183,0,0,0,185,176,239,30,0,0,0,30,249,111,0,0,0, +0,0,236,68,0,0,0,0,0,236,68,0,0,0,0,0,236,68,0,0,0,0,0,236, +68,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,212,92,0,0,0,0,0,212,255,255,235,165, +0,0,212,92,0,31,202,0,0,212,92,0,0,119,0,0,212,92,0,31,202,0,0,212, +255,255,236,168,0,0,212,92,0,0,0,0,0,212,92,0,0,0,0,0,212,92,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,25,180,242,220,77,0,0,0,165,161,13,62,233,12,0,0,221, +57,0,74,235,55,0,0,232,48,84,207,41,0,0,0,232,48,152,125,0,0,0,0,232, +48,96,234,55,0,0,0,232,48,0,119,244,99,0,0,232,48,0,0,73,242,0,0,232, +48,0,3,92,227,0,0,232,84,255,251,213,69,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36,210,32,0, +0,0,0,0,43,189,12,0,0,0,0,0,0,0,0,0,0,204,255,248,201,50,0,0, +0,0,9,105,219,0,0,0,0,0,0,222,0,0,105,218,249,255,255,0,39,239,54,8, +0,223,0,50,236,38,12,116,255,0,0,140,240,230,151,212,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,209,29, +0,0,0,18,193,34,0,0,0,0,0,0,0,0,0,0,204,255,248,201,50,0,0,0, +0,9,105,219,0,0,0,0,0,0,222,0,0,105,218,249,255,255,0,39,239,54,8,0, +223,0,50,236,38,12,116,255,0,0,140,240,230,151,212,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,235,72,0,0, +0,27,185,20,186,22,0,0,0,0,0,0,0,0,0,204,255,248,201,50,0,0,0,0, +9,105,219,0,0,0,0,0,0,222,0,0,105,218,249,255,255,0,39,239,54,8,0,223, +0,50,236,38,12,116,255,0,0,140,240,230,151,212,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +29,230,126,106,93,0,0,102,98,131,229,25,0,0,204,255,248,201,50,0,0,0,0,9, +105,219,0,0,0,0,0,0,222,0,0,105,218,249,255,255,0,39,239,54,8,0,223,0, +50,236,38,12,116,255,0,0,140,240,230,151,212,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64, +240,0,248,56,0,0,0,0,0,0,0,0,0,204,255,248,201,50,0,0,0,0,9,105, +219,0,0,0,0,0,0,222,0,0,105,218,249,255,255,0,39,239,54,8,0,223,0,50, +236,38,12,116,255,0,0,140,240,230,151,212,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,127,240,120,0,0,0,13,199,17,198,7,0,0,13,198,16,197,7,0,0,0,127, +241,120,0,0,0,0,0,0,0,0,0,0,204,255,248,201,50,0,0,0,0,9,105,219, +0,0,0,0,0,0,222,0,0,105,218,249,255,255,0,39,239,54,8,0,223,0,50,236, +38,12,116,255,0,0,140,240,230,151,212,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,204,255,252,215,85,119,229, +241,170,17,0,0,0,0,9,105,255,216,47,14,142,166,0,0,0,0,0,0,222,90,0, +0,8,249,0,0,105,218,249,255,255,252,252,253,254,255,0,39,239,54,8,1,230,79,0, +0,0,0,0,50,236,38,14,130,255,212,50,10,56,165,0,0,138,237,237,178,49,156,219, +244,198,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26, +169,235,220,76,0,2,203,157,23,34,143,0,49,241,7,0,0,0,0,78,212,0,0,0, +0,0,49,241,7,0,0,0,0,1,203,157,23,33,143,0,0,27,173,237,218,75,0,0, +0,0,22,168,0,0,0,0,101,250,189,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,4,177,96,0,0,0,0,0,7,179,57,0,0,0,0,0,0,0,0,0,0,23,170, +237,225,113,0,1,198,147,17,40,218,0,47,239,3,0,0,106,0,78,255,252,253,254,255, +0,49,229,1,0,0,0,0,2,199,142,22,20,98,0,0,23,164,233,233,156,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,5,191,84,0,0,0,0,153,92,0,0,0,0,0,0,0,0,0,0,23,170,237, +225,113,0,1,198,147,17,40,218,0,47,239,3,0,0,106,0,78,255,252,253,254,255,0, +49,229,1,0,0,0,0,2,199,142,22,20,98,0,0,23,164,233,233,156,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +21,213,154,0,0,0,0,169,50,136,83,0,0,0,0,0,0,0,0,0,23,170,237,225, +113,0,1,198,147,17,40,218,0,47,239,3,0,0,106,0,78,255,252,253,254,255,0,49, +229,1,0,0,0,0,2,199,142,22,20,98,0,0,23,164,233,233,156,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,236,68,164,140,0,0,0,0,0,0,0,0,0,23,170,237,225,113, +0,1,198,147,17,40,218,0,47,239,3,0,0,106,0,78,255,252,253,254,255,0,49,229, +1,0,0,0,0,2,199,142,22,20,98,0,0,23,164,233,233,156,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,14,199,65,0,19,191,0,0,0,0,0,224,0,0,224,0,0, +224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,17,0,3,178,0,0,0,0,0,224,0,0, +224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,227,7,185,29,0,0,0,0,0, +224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,255,32,0,0, +0,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0,224,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,194,141,69,150,0,0,38, +153,250,170,20,0,0,84,49,61,236,41,0,0,49,196,246,253,218,0,12,230,122,14,22, +219,0,67,225,0,0,0,135,0,66,224,0,0,0,138,0,12,228,113,12,56,234,0,0, +47,193,243,219,99,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,159,208,31,187, +0,0,0,2,194,51,229,109,0,0,0,232,116,213,242,168,7,0,0,232,190,29,26,213, +99,0,0,232,64,0,0,133,143,0,0,232,44,0,0,124,152,0,0,232,44,0,0,124, +152,0,0,232,44,0,0,124,152,0,0,232,44,0,0,124,152,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +14,199,65,0,0,0,0,0,19,191,34,0,0,0,0,0,0,0,0,0,0,36,187,242, +215,86,0,3,214,138,15,72,244,0,53,239,5,0,0,158,0,79,211,0,0,0,124,0, +53,239,5,0,0,158,0,3,215,137,15,71,245,0,0,38,189,243,216,89,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,17,206,57,0,0,0,3,178,64,0,0,0,0,0,0,0,0,0,0,36,187,242,215, +86,0,3,214,138,15,72,244,0,53,239,5,0,0,158,0,79,211,0,0,0,124,0,53, +239,5,0,0,158,0,3,215,137,15,71,245,0,0,38,189,243,216,89,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41, +227,119,0,0,0,7,185,29,166,53,0,0,0,0,0,0,0,0,0,36,187,242,215,86, +0,3,214,138,15,72,244,0,53,239,5,0,0,158,0,79,211,0,0,0,124,0,53,239, +5,0,0,158,0,3,215,137,15,71,245,0,0,38,189,243,216,89,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,5,209,168,62,141,0,0,54,144,90,237,59,0,0,36,187,242,215,86,0, +3,214,138,15,72,244,0,53,239,5,0,0,158,0,79,211,0,0,0,124,0,53,239,5, +0,0,158,0,3,215,137,15,71,245,0,0,38,189,243,216,89,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,16,255,32,200,104,0,0,0,0,0,0,0,0,0,36,187,242,215,86,0,3, +214,138,15,72,244,0,53,239,5,0,0,158,0,79,211,0,0,0,124,0,53,239,5,0, +0,158,0,3,215,137,15,71,245,0,0,38,189,243,216,89,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176, +192,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,188,255,255,255,255,255,255,200, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,176,192,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,188,242,214,142,0, +4,216,137,15,108,255,0,54,239,5,22,193,171,0,80,209,7,185,46,122,0,53,232,160, +80,0,156,0,1,219,185,12,69,243,0,59,177,187,244,216,89,0,28,12,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10, +193,74,0,0,0,0,0,0,14,189,41,0,0,0,0,0,0,0,0,0,0,0,0,252, +24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,252, +24,0,0,144,132,0,0,244,32,0,0,164,132,0,0,199,130,10,71,246,132,0,0,53, +212,241,175,163,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,203,65,0,0,0,0, +1,171,73,0,0,0,0,0,0,0,0,0,0,0,0,252,24,0,0,144,132,0,0,252, +24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,244, +32,0,0,164,132,0,0,199,130,10,71,246,132,0,0,53,212,241,175,163,132,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,34,223,131,0,0,0,0,4,181,35,157,62,0,0,0,0, +0,0,0,0,0,0,0,252,24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,252, +24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,244,32,0,0,164,132,0,0,199, +130,10,71,246,132,0,0,53,212,241,175,163,132,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,4,255,44,188,116,0,0,0,0,0,0,0,0,0,0,0,252, +24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,252,24,0,0,144,132,0,0,252, +24,0,0,144,132,0,0,244,32,0,0,164,132,0,0,199,130,10,71,246,132,0,0,53, +212,241,175,163,132,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,211,37,0,0,0,12,190,43,0, +0,0,0,0,0,0,0,0,116,175,0,0,0,149,0,22,245,20,0,7,237,0,0,176, +111,0,86,213,0,0,78,207,0,182,120,0,0,4,232,73,250,28,0,0,0,139,234,189, +0,0,0,0,41,255,95,0,0,0,0,48,245,12,0,0,0,3,161,155,0,0,0,12, +255,213,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,232,44,0,0,0,0,0,0,232,44, +0,0,0,0,0,0,232,44,0,0,0,0,0,0,232,120,215,238,153,6,0,0,232,207, +33,32,207,124,0,0,232,82,0,0,80,213,0,0,232,51,0,0,48,239,0,0,232,82, +0,0,80,213,0,0,232,205,32,31,205,126,0,0,232,121,216,239,155,7,0,0,232,44, +0,0,0,0,0,0,232,44,0,0,0,0,0,0,232,44,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,0,0,0,48,255,0,232,72,0,0,0,0,0,0,0,0,116, +175,0,0,0,149,0,22,245,20,0,7,237,0,0,176,111,0,86,213,0,0,78,207,0, +182,120,0,0,4,232,73,250,28,0,0,0,139,234,189,0,0,0,0,41,255,95,0,0, +0,0,48,245,12,0,0,0,3,161,155,0,0,0,12,255,213,28,0,0,0,0,0,0, +0,0,0,}; +#endif diff --git a/libraries/tinyblocks-plot/src/tb_plot.c b/libraries/tinyblocks-plot/src/tb_plot.c new file mode 100644 index 0000000..8125a0b --- /dev/null +++ b/libraries/tinyblocks-plot/src/tb_plot.c @@ -0,0 +1,665 @@ +/* + * TinyBlocks - tb_plot.c + * A figura atual, o desenho dela numa imagem (linhas e pontos com + * antisserrilhado, barras, eixos com marcas "redondas", legenda, grade, + * texto com a fonte embutida) e os blocos da categoria "Gráficos". + */ +#define _POSIX_C_SOURCE 200809L +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include "tb_tensor.h" +#include "tb_plot.h" +#include "plot_font.h" + +/* == Figura =========================================================== */ +enum { S_LINE, S_SCATTER, S_BAR }; + +typedef struct { + int kind; + float* x; + float* y; + int n; + uint32_t color; /* 0xRRGGBB */ + char label[64]; + char** names; /* barras: nomes no eixo x (ou NULL) */ +} Series; + +static struct { + int w, h; + char title[128], xlabel[96], ylabel[96]; + bool legend, grid; + bool xlim, ylim; + double x0, x1, y0, y1; + Series* s; + int n, cap, next_color; +} F = { 480, 320, "", "", "", false, false, false, false, 0, 1, 0, 1, NULL, 0, 0, 0 }; + +static const uint32_t s_tab10[10] = { + 0x1f77b4, 0xff7f0e, 0x2ca02c, 0xd62728, 0x9467bd, 0x8c564b, 0xe377c2, 0x7f7f7f, 0xbcbd22, 0x17becf }; +static const char* s_names[] = { "azul", "laranja", "verde", "vermelho", "roxo", "marrom", "rosa", "cinza", "oliva", "ciano" }; + +static uint32_t color_of(const char* c) { + while (c && isspace((unsigned char)*c)) c++; + if (!c || !*c) return s_tab10[F.next_color++ % 10]; + if (c[0] == '#' && strlen(c) >= 7) return (uint32_t)strtoul(c + 1, NULL, 16) & 0xffffff; + for (int i = 0; i < 10; i++) if (!strcasecmp(c, s_names[i])) return s_tab10[i]; + if (!strcasecmp(c, "preto")) return 0x000000; + if (!strcasecmp(c, "branco")) return 0xffffff; + return s_tab10[F.next_color++ % 10]; +} + +static void series_free(Series* s) { + free(s->x); free(s->y); + for (int i = 0; s->names && i < s->n; i++) free(s->names[i]); + free(s->names); +} + +void tb_plot_figure(int w, int h) { + for (int i = 0; i < F.n; i++) series_free(&F.s[i]); + F.n = 0; + F.w = w < 64 ? 64 : w > 4096 ? 4096 : w; + F.h = h < 64 ? 64 : h > 4096 ? 4096 : h; + F.title[0] = F.xlabel[0] = F.ylabel[0] = 0; + F.legend = F.grid = F.xlim = F.ylim = false; + F.next_color = 0; +} + +/* Acrescenta uma serie (copia os vetores; x NULL = 1..n) */ +static Series* add(int kind, const float* x, const float* y, int n, const char* color, const char* label) { + if (F.n == F.cap) { + int nc = F.cap ? F.cap * 2 : 8; + Series* p = realloc(F.s, (size_t)nc * sizeof(*p)); + if (!p) return NULL; + F.s = p; F.cap = nc; + } + Series* s = &F.s[F.n]; + memset(s, 0, sizeof(*s)); + s->x = malloc((size_t)(n ? n : 1) * sizeof(float)); + s->y = malloc((size_t)(n ? n : 1) * sizeof(float)); + if (!s->x || !s->y) { free(s->x); free(s->y); return NULL; } + for (int i = 0; i < n; i++) { s->x[i] = x ? x[i] : (float)(i + 1); s->y[i] = y[i]; } + s->n = n; s->kind = kind; + s->color = color_of(color); + snprintf(s->label, sizeof(s->label), "%s", label ? label : ""); + F.n++; + return s; +} + +void tb_plot_line(const float* x, const float* y, int n, const char* color, const char* label) { + add(S_LINE, x, y, n, color, label); +} + +void tb_plot_title(const char* t) { snprintf(F.title, sizeof(F.title), "%s", t ? t : ""); } + +/* == Desenho ========================================================== */ +typedef struct { uint8_t* p; int w, h; int cx0, cy0, cx1, cy1; } Canvas; /* recorte [cx0,cx1) */ + +static void blend(Canvas* c, int x, int y, uint32_t rgb, float a) { + if (x < c->cx0 || y < c->cy0 || x >= c->cx1 || y >= c->cy1 || a <= 0) return; + if (a > 1) a = 1; + uint8_t* q = c->p + ((size_t)y * c->w + x) * 4; + float r = (float)((rgb >> 16) & 255), g = (float)((rgb >> 8) & 255), b = (float)(rgb & 255); + q[0] = (uint8_t)(q[0] + (r - q[0]) * a + .5f); + q[1] = (uint8_t)(q[1] + (g - q[1]) * a + .5f); + q[2] = (uint8_t)(q[2] + (b - q[2]) * a + .5f); + q[3] = 255; +} + +static void fill_rect(Canvas* c, float x0, float y0, float x1, float y1, uint32_t rgb, float a) { + if (x1 < x0) { float t = x0; x0 = x1; x1 = t; } + if (y1 < y0) { float t = y0; y0 = y1; y1 = t; } + for (int y = (int)floorf(y0); y < (int)ceilf(y1); y++) + for (int x = (int)floorf(x0); x < (int)ceilf(x1); x++) { + float cx = fminf(x + 1.f, x1) - fmaxf((float)x, x0), cy = fminf(y + 1.f, y1) - fmaxf((float)y, y0); + if (cx > 0 && cy > 0) blend(c, x, y, rgb, a * cx * cy); + } +} + +/* Segmento com espessura w: cobertura pela distancia ao segmento */ +static void line(Canvas* c, float x0, float y0, float x1, float y1, float w, uint32_t rgb) { + float r = w * 0.5f; + int bx0 = (int)floorf(fminf(x0, x1) - r - 1), bx1 = (int)ceilf(fmaxf(x0, x1) + r + 1); + int by0 = (int)floorf(fminf(y0, y1) - r - 1), by1 = (int)ceilf(fmaxf(y0, y1) + r + 1); + if (bx0 < c->cx0) bx0 = c->cx0; + if (by0 < c->cy0) by0 = c->cy0; + if (bx1 > c->cx1) bx1 = c->cx1; + if (by1 > c->cy1) by1 = c->cy1; + float dx = x1 - x0, dy = y1 - y0, L2 = dx * dx + dy * dy; + for (int y = by0; y < by1; y++) + for (int x = bx0; x < bx1; x++) { + float px = x + .5f - x0, py = y + .5f - y0; + float t = L2 > 0 ? (px * dx + py * dy) / L2 : 0; + t = t < 0 ? 0 : t > 1 ? 1 : t; + float ex = px - t * dx, ey = py - t * dy; + float cov = r + 0.5f - sqrtf(ex * ex + ey * ey); + if (cov > 0) blend(c, x, y, rgb, cov); + } +} + +static void disc(Canvas* c, float cx, float cy, float r, uint32_t rgb) { + for (int y = (int)(cy - r - 1); y <= (int)(cy + r + 1); y++) + for (int x = (int)(cx - r - 1); x <= (int)(cx + r + 1); x++) { + float d = sqrtf((x + .5f - cx) * (x + .5f - cx) + (y + .5f - cy) * (y + .5f - cy)); + blend(c, x, y, rgb, r + 0.5f - d); + } +} + +/* -- texto ---------------------------------------------------------------- */ +static const PlotGlyph* glyph(unsigned cp) { + if (cp >= 32 && cp < 127) return &s_glyphs[cp - 32]; + if (cp >= 160 && cp < 256) return &s_glyphs[95 + cp - 160]; + return &s_glyphs['?' - 32]; +} + +static const char* next_cp(const char* p, unsigned* cp) { + unsigned char c = (unsigned char)*p; + if (c < 0x80) { *cp = c; return p + 1; } + if ((c & 0xE0) == 0xC0 && p[1]) { *cp = ((c & 0x1Fu) << 6) | ((unsigned char)p[1] & 0x3Fu); return p + 2; } + int n = (c & 0xF0) == 0xE0 ? 3 : (c & 0xF8) == 0xF0 ? 4 : 1; + for (int i = 1; i < n && p[i]; i++) p++; + *cp = '?'; + return p + 1; +} + +static int text_w(const char* s) { + int w = 0; + for (unsigned cp; *s; ) { s = next_cp(s, &cp); w += glyph(cp)->w; } + return w; +} + +/* Texto com o topo em (x, y); vertical = de baixo para cima (eixo y) */ +static void text(Canvas* c, int x, int y, const char* s, uint32_t rgb, bool vertical) { + int pen = 0; + for (unsigned cp; *s; ) { + s = next_cp(s, &cp); + const PlotGlyph* g = glyph(cp); + const uint8_t* a = s_font + g->off; + for (int gy = 0; gy < PLOT_FONT_H; gy++) + for (int gx = 0; gx < g->w; gx++) { + float al = a[gy * g->w + gx] / 255.f; + if (!al) continue; + if (vertical) blend(c, x + gy, y - pen - gx, rgb, al); + else blend(c, x + pen + gx, y + gy, rgb, al); + } + pen += g->w; + } +} + +/* -- eixos ---------------------------------------------------------------- */ +static double nice_step(double range, int want) { + double raw = range / (want > 0 ? want : 5); + if (raw <= 0 || !isfinite(raw)) return 1; + double p = pow(10, floor(log10(raw))), f = raw / p; + return (f < 1.5 ? 1 : f < 3 ? 2 : f < 7 ? 5 : 10) * p; +} + +static void num_text(double v, double step, char* out, size_t cap) { + if (fabs(v) < step * 1e-6) v = 0; + int dec = step >= 1 ? 0 : (int)ceil(-log10(step) - 1e-9); + if (dec > 6) dec = 6; + if (fabs(v) >= 1e6 || (fabs(v) < 1e-4 && v != 0)) snprintf(out, cap, "%.2g", v); + else snprintf(out, cap, "%.*f", dec, v); +} + +static void bounds(double* x0, double* x1, double* y0, double* y1) { + bool any = false, bars = false; + *x0 = *y0 = INFINITY; *x1 = *y1 = -INFINITY; + for (int i = 0; i < F.n; i++) { + const Series* s = &F.s[i]; + if (s->kind == S_BAR) bars = true; + for (int k = 0; k < s->n; k++) { + if (!isfinite(s->x[k]) || !isfinite(s->y[k])) continue; + double bx = s->kind == S_BAR ? 0.4 : 0; + if (s->x[k] - bx < *x0) *x0 = s->x[k] - bx; + if (s->x[k] + bx > *x1) *x1 = s->x[k] + bx; + if (s->y[k] < *y0) *y0 = s->y[k]; + if (s->y[k] > *y1) *y1 = s->y[k]; + any = true; + } + } + if (!any) { *x0 = 0; *x1 = 1; *y0 = 0; *y1 = 1; } + if (bars && *y0 > 0) *y0 = 0; + if (*x1 - *x0 < 1e-12) { *x0 -= 0.5; *x1 += 0.5; } + if (*y1 - *y0 < 1e-12) { *y0 -= 0.5; *y1 += 0.5; } + double mx = (*x1 - *x0) * 0.05, my = (*y1 - *y0) * 0.05; /* folga, como no matplotlib */ + *x0 -= mx; *x1 += mx; + if (!(bars && *y0 == 0)) *y0 -= my; + *y1 += my; + if (F.xlim) { *x0 = F.x0; *x1 = F.x1; } + if (F.ylim) { *y0 = F.y0; *y1 = F.y1; } +} + +TinyBlocks_Image* tb_plot_render(void) { + int W = F.w, H = F.h; + TinyBlocks_Image* img = tb_image_new(W, H, 4); + if (!img) return NULL; + Canvas c = { tb_image_data(img), W, H, 0, 0, W, H }; + memset(c.p, 255, (size_t)W * H * 4); + double x0, x1, y0, y1; + bounds(&x0, &x1, &y0, &y1); + double xs = nice_step(x1 - x0, W / 90), ys = nice_step(y1 - y0, H / 55); + /* margem esquerda pela largura das marcas do eixo y */ + int ylw = 0; + char buf[64]; + for (double v = ceil(y0 / ys) * ys; v <= y1 + ys * 1e-9; v += ys) { + num_text(v, ys, buf, sizeof(buf)); + int w = text_w(buf); + if (w > ylw) ylw = w; + } + int L = 12 + ylw + 8 + (F.ylabel[0] ? PLOT_FONT_H + 4 : 0); + int T = F.title[0] ? PLOT_FONT_H + 14 : 12; + int R = 16, B = PLOT_FONT_H + 16 + (F.xlabel[0] ? PLOT_FONT_H + 4 : 0); + int px0 = L, px1 = W - R, py0 = T, py1 = H - B; + if (px1 - px0 < 20 || py1 - py0 < 20) return img; +#define SX(v) (px0 + (float)(((v) - x0) / (x1 - x0)) * (px1 - px0)) +#define SY(v) (py1 - (float)(((v) - y0) / (y1 - y0)) * (py1 - py0)) + const uint32_t axis = 0x333333, gridc = 0xdddddd; + /* barras com nomes: as marcas do x sao os nomes */ + const Series* named = NULL; + for (int i = 0; i < F.n; i++) if (F.s[i].kind == S_BAR && F.s[i].names) named = &F.s[i]; + /* grade e marcas */ + for (double v = ceil(y0 / ys) * ys; v <= y1 + ys * 1e-9; v += ys) { + float y = SY(v); + if (F.grid) fill_rect(&c, px0, y - .5f, px1, y + .5f, gridc, 1); + fill_rect(&c, px0 - 4, y - .5f, px0, y + .5f, axis, 1); + num_text(v, ys, buf, sizeof(buf)); + text(&c, px0 - 7 - text_w(buf), (int)(y - PLOT_FONT_BASE * 0.5f - 3), buf, axis, false); + } + if (named) { + float last = -1e9f; /* nomes que encostariam no anterior: pula */ + for (int k = 0; k < named->n; k++) { + float x = SX(named->x[k]); + fill_rect(&c, x - .5f, py1, x + .5f, py1 + 4, axis, 1); + const char* nm = named->names[k] ? named->names[k] : ""; + int w = text_w(nm); + if (!w || x - w * 0.5f < last + 6) continue; + text(&c, (int)(x - w * 0.5f), py1 + 6, nm, axis, false); + last = x + w * 0.5f; + } + } else { + for (double v = ceil(x0 / xs) * xs; v <= x1 + xs * 1e-9; v += xs) { + float x = SX(v); + if (F.grid) fill_rect(&c, x - .5f, py0, x + .5f, py1, gridc, 1); + fill_rect(&c, x - .5f, py1, x + .5f, py1 + 4, axis, 1); + num_text(v, xs, buf, sizeof(buf)); + text(&c, (int)(x - text_w(buf) * 0.5f), py1 + 6, buf, axis, false); + } + } + /* series, recortadas na area do grafico */ + Canvas in = c; + in.cx0 = px0; in.cy0 = py0; in.cx1 = px1; in.cy1 = py1; + for (int i = 0; i < F.n; i++) { + const Series* s = &F.s[i]; + for (int k = 0; k < s->n; k++) { + if (!isfinite(s->x[k]) || !isfinite(s->y[k])) continue; + float x = SX(s->x[k]), y = SY(s->y[k]); + if (s->kind == S_BAR) { + float hw = (float)(0.4 / (x1 - x0) * (px1 - px0)); + double base = y0 > 0 ? y0 : y1 < 0 ? y1 : 0; /* barras partem do zero (ou da borda) */ + fill_rect(&in, x - hw, SY(base), x + hw, y, s->color, 1); + } else if (s->kind == S_SCATTER) { + disc(&in, x, y, 3.f, s->color); + } else if (k > 0 && isfinite(s->x[k - 1]) && isfinite(s->y[k - 1])) { + line(&in, SX(s->x[k - 1]), SY(s->y[k - 1]), x, y, 1.8f, s->color); + } else if (s->n == 1) disc(&in, x, y, 2.f, s->color); + } + } + /* moldura, titulo e nomes dos eixos */ + fill_rect(&c, px0 - .5f, py0, px0 + .5f, py1, axis, 1); + fill_rect(&c, px0, py1 - .5f, px1, py1 + .5f, axis, 1); + fill_rect(&c, px1 - .5f, py0, px1 + .5f, py1, 0xbbbbbb, 1); + fill_rect(&c, px0, py0 - .5f, px1, py0 + .5f, 0xbbbbbb, 1); + if (F.title[0]) text(&c, (px0 + px1 - text_w(F.title)) / 2, 5, F.title, 0x111111, false); + if (F.xlabel[0]) text(&c, (px0 + px1 - text_w(F.xlabel)) / 2, H - PLOT_FONT_H - 4, F.xlabel, axis, false); + if (F.ylabel[0]) text(&c, 4, (py0 + py1 + text_w(F.ylabel)) / 2, F.ylabel, axis, true); + /* legenda: canto de cima a direita */ + if (F.legend) { + int rows = 0, lw = 0; + for (int i = 0; i < F.n; i++) if (F.s[i].label[0]) { rows++; int w = text_w(F.s[i].label); if (w > lw) lw = w; } + if (rows) { + int bw = lw + 40, bh = rows * (PLOT_FONT_H + 2) + 8; + int bx = px1 - bw - 8, by = py0 + 8; + fill_rect(&c, bx, by, bx + bw, by + bh, 0xffffff, 0.9f); + fill_rect(&c, bx, by, bx + bw, by + 1, 0xcccccc, 1); + fill_rect(&c, bx, by + bh - 1, bx + bw, by + bh, 0xcccccc, 1); + fill_rect(&c, bx, by, bx + 1, by + bh, 0xcccccc, 1); + fill_rect(&c, bx + bw - 1, by, bx + bw, by + bh, 0xcccccc, 1); + int ry = by + 4; + for (int i = 0; i < F.n; i++) { + const Series* s = &F.s[i]; + if (!s->label[0]) continue; + float cy = ry + PLOT_FONT_H * 0.5f; + if (s->kind == S_LINE) line(&c, bx + 6, cy, bx + 24, cy, 1.8f, s->color); + else if (s->kind == S_SCATTER) disc(&c, bx + 15, cy, 3.f, s->color); + else fill_rect(&c, bx + 8, cy - 4, bx + 22, cy + 4, s->color, 1); + text(&c, bx + 28, ry, s->label, 0x222222, false); + ry += PLOT_FONT_H + 2; + } + } + } +#undef SX +#undef SY + return img; +} + +/* == Valores ========================================================== */ +/* Numeros de um valor: tensor, lista ou texto "1, 2, 3"; malloc ou NULL */ +static float* numbers(TinyBlocks* rt, TinyBlocks_Value v, int* n) { + *n = 0; + const TbTensorApi* api = tb_tensor_api(rt); + const TbTensor* t = api ? api->of_value(v) : NULL; + if (t) { + float* out = malloc((t->n ? t->n : 1) * sizeof(float)); + if (out) { memcpy(out, t->d, t->n * sizeof(float)); *n = (int)t->n; } + return out; + } + TinyBlocks_JsonValue* j = v.kind == TB_VALUE_JSON ? v.as.json : NULL; + bool own = false; + if (!j && v.kind == TB_VALUE_TEXT && v.as.text) { + const char* s = v.as.text; + while (isspace((unsigned char)*s)) s++; + if (*s == '[') { j = tb_json_parse(s, NULL, 0); own = j != NULL; } + } + if (j && tb_json_kind(j) == TB_JSON_ARRAY) { + uint32_t len = tb_json_array_length(j); + float* out = malloc((len ? len : 1) * sizeof(float)); + for (uint32_t i = 0; out && i < len; i++) { + TinyBlocks_JsonValue* e = tb_json_array_get(j, i); + const char* es = tb_json_as_string(e); + out[i] = es ? (float)strtod(es, NULL) : (float)tb_json_as_number(e, 0); + tb_json_release(e); + } + if (own) tb_json_release(j); + *n = out ? (int)len : 0; + return out; + } + if (own) tb_json_release(j); + double d; + if (v.kind != TB_VALUE_TEXT && tb_value_to_number(v, &d)) { + float* out = malloc(sizeof(float)); + if (out) { out[0] = (float)d; *n = 1; } + return out; + } + char* s = tb_value_to_string(v); /* "1, 2, 3" ou "1 2 3" */ + int cap = 64; + float* out = malloc((size_t)cap * sizeof(float)); + for (char* p = s; out && p && *p; ) { + while (*p && !(isdigit((unsigned char)*p) || *p == '-' || *p == '.' || *p == '+')) p++; + if (!*p) break; + char* e; + double x = strtod(p, &e); + if (e == p) { p++; continue; } + if (*n == cap) { cap *= 2; float* q = realloc(out, (size_t)cap * sizeof(float)); if (!q) break; out = q; } + out[(*n)++] = (float)x; + p = e; + } + free(s); + return out; +} + +/* Nomes (barras): lista JSON ou "a, b, c" */ +static char** names_of(TinyBlocks_Value v, int n) { + char** out = calloc((size_t)(n ? n : 1), sizeof(char*)); + if (!out) return NULL; + if (v.kind == TB_VALUE_JSON && tb_json_kind(v.as.json) == TB_JSON_ARRAY) { + for (int i = 0; i < n && i < (int)tb_json_array_length(v.as.json); i++) { + TinyBlocks_JsonValue* e = tb_json_array_get(v.as.json, (uint32_t)i); + TinyBlocks_Value ev = tb_value_json(e); + out[i] = tb_value_to_string(ev); + tb_value_free(&ev); + tb_json_release(e); + } + return out; + } + char* s = tb_value_to_string(v); + char* p = s; + for (int i = 0; p && *p && i < n; i++) { + char* e = strchr(p, ','); + size_t len = e ? (size_t)(e - p) : strlen(p); + while (len && isspace((unsigned char)*p)) { p++; len--; } + while (len && isspace((unsigned char)p[len - 1])) len--; + out[i] = strndup(p, len); + p = e ? e + 1 : NULL; + } + free(s); + return out; +} + +/* == Series com nome (crescem a cada passo) =========================== */ +typedef struct { char name[64]; float* v; int n, cap; } Named; +static Named* s_named; +static int s_named_n; + +static Named* named(const char* name, bool create) { + for (int i = 0; i < s_named_n; i++) if (!strcmp(s_named[i].name, name)) return &s_named[i]; + if (!create) return NULL; + Named* p = realloc(s_named, (size_t)(s_named_n + 1) * sizeof(*p)); + if (!p) return NULL; + s_named = p; + Named* s = &s_named[s_named_n++]; + memset(s, 0, sizeof(*s)); + snprintf(s->name, sizeof(s->name), "%s", name); + return s; +} + +/* == Blocos =========================================================== */ +static void eval_figure(TinyBlocks_Block* self, TinyBlocks* rt) { + tb_plot_figure((int)tb_block_input_integer(self, rt, 0, 480), (int)tb_block_input_integer(self, rt, 1, 320)); + self->dirty = false; +} + +static void plot_xy(TinyBlocks_Block* self, TinyBlocks* rt, int kind, bool with_x) { + int nx = 0, ny = 0; + float* x = with_x ? numbers(rt, tb_block_get_input(self, rt, 0), &nx) : NULL; + float* y = numbers(rt, tb_block_get_input(self, rt, with_x ? 1 : 0), &ny); + uint32_t c0 = with_x ? 2 : 1; + if (with_x && nx != ny) tinyblocks_set_error(rt, "o x tem %d números e o y tem %d", nx, ny); + else if (y) add(kind, x, y, ny, tb_block_input_text(self, rt, c0), tb_block_input_text(self, rt, c0 + 1)); + free(x); free(y); + self->dirty = false; +} +static void eval_line(TinyBlocks_Block* self, TinyBlocks* rt) { plot_xy(self, rt, S_LINE, false); } +static void eval_line_xy(TinyBlocks_Block* self, TinyBlocks* rt) { plot_xy(self, rt, S_LINE, true); } +static void eval_scatter(TinyBlocks_Block* self, TinyBlocks* rt) { plot_xy(self, rt, S_SCATTER, true); } + +static void eval_bar(TinyBlocks_Block* self, TinyBlocks* rt) { + int n = 0; + float* y = numbers(rt, tb_block_get_input(self, rt, 0), &n); + Series* s = y ? add(S_BAR, NULL, y, n, tb_block_input_text(self, rt, 2), "") : NULL; + TinyBlocks_Value nv = tb_block_get_input(self, rt, 1); + if (s && nv.kind != TB_VALUE_NONE && tb_block_input_text(self, rt, 1)[0]) s->names = names_of(nv, n); + free(y); + self->dirty = false; +} + +static void eval_hist(TinyBlocks_Block* self, TinyBlocks* rt) { + int n = 0, bins = (int)tb_block_input_integer(self, rt, 1, 10); + if (bins < 1) bins = 1; + if (bins > 1000) bins = 1000; + float* v = numbers(rt, tb_block_get_input(self, rt, 0), &n); + if (v && n) { + float lo = v[0], hi = v[0]; + for (int i = 1; i < n; i++) { if (v[i] < lo) lo = v[i]; if (v[i] > hi) hi = v[i]; } + if (hi <= lo) hi = lo + 1; + float* cnt = calloc((size_t)bins, sizeof(float)); + float* xs = malloc((size_t)bins * sizeof(float)); + for (int i = 0; cnt && i < n; i++) { + int b = (int)((v[i] - lo) / (hi - lo) * bins); + if (b >= bins) b = bins - 1; + cnt[b] += 1; + } + for (int b = 0; xs && b < bins; b++) xs[b] = lo + (b + 0.5f) * (hi - lo) / bins; + if (cnt && xs) { + Series* s = add(S_BAR, NULL, cnt, bins, tb_block_input_text(self, rt, 2), ""); + if (s) { /* barras no centro de cada faixa, numa escala 1..bins */ + for (int b = 0; b < bins; b++) s->x[b] = (float)(b + 1); + s->names = calloc((size_t)bins, sizeof(char*)); + for (int b = 0; s->names && b < bins; b++) { + char t[32]; + snprintf(t, sizeof(t), "%.3g", xs[b]); + s->names[b] = strdup(t); + } + } + } + free(cnt); free(xs); + } + free(v); + self->dirty = false; +} + +#define TEXT_SETTER(name, field) \ + static void name(TinyBlocks_Block* self, TinyBlocks* rt) { \ + snprintf(F.field, sizeof(F.field), "%s", tb_block_input_text(self, rt, 0)); \ + self->dirty = false; } +TEXT_SETTER(eval_title, title) +TEXT_SETTER(eval_xlabel, xlabel) +TEXT_SETTER(eval_ylabel, ylabel) + +static void eval_legend(TinyBlocks_Block* self, TinyBlocks* rt) { (void)rt; F.legend = true; self->dirty = false; } +static void eval_grid(TinyBlocks_Block* self, TinyBlocks* rt) { (void)rt; F.grid = true; self->dirty = false; } + +static void eval_xlim(TinyBlocks_Block* self, TinyBlocks* rt) { + F.x0 = tb_block_input_number(self, rt, 0, 0); F.x1 = tb_block_input_number(self, rt, 1, 1); + F.xlim = F.x1 > F.x0; + self->dirty = false; +} + +static void eval_ylim(TinyBlocks_Block* self, TinyBlocks* rt) { + F.y0 = tb_block_input_number(self, rt, 0, 0); F.y1 = tb_block_input_number(self, rt, 1, 1); + F.ylim = F.y1 > F.y0; + self->dirty = false; +} + +static void eval_push(TinyBlocks_Block* self, TinyBlocks* rt) { + int n = 0; + float* v = numbers(rt, tb_block_get_input(self, rt, 0), &n); + Named* s = named(tb_block_input_text(self, rt, 1), true); + for (int i = 0; s && v && i < n; i++) { + if (s->n == s->cap) { + int nc = s->cap ? s->cap * 2 : 256; + float* p = realloc(s->v, (size_t)nc * sizeof(float)); + if (!p) break; + s->v = p; s->cap = nc; + } + s->v[s->n++] = v[i]; + } + free(v); + self->dirty = false; +} + +static void eval_series_plot(TinyBlocks_Block* self, TinyBlocks* rt) { + const char* nm = tb_block_input_text(self, rt, 0); + Named* s = named(nm, false); + if (s && s->n) add(S_LINE, NULL, s->v, s->n, tb_block_input_text(self, rt, 1), nm); + self->dirty = false; +} + +static void eval_series_clear(TinyBlocks_Block* self, TinyBlocks* rt) { + Named* s = named(tb_block_input_text(self, rt, 0), false); + if (s) s->n = 0; + self->dirty = false; +} + +static void eval_series_len(TinyBlocks_Block* self, TinyBlocks* rt) { + Named* s = named(tb_block_input_text(self, rt, 0), false); + tb_block_set_output(self, 0, tb_value_integer(s ? s->n : 0)); + self->dirty = false; +} + +static void eval_image(TinyBlocks_Block* self, TinyBlocks* rt) { + (void)rt; + TinyBlocks_Image* img = tb_plot_render(); + if (img) { tb_block_set_output(self, 0, tb_value_image(img)); tb_image_release(img); } + self->dirty = false; +} + +static void eval_save(TinyBlocks_Block* self, TinyBlocks* rt) { + const char* path = tb_block_input_text(self, rt, 0); + TinyBlocks_Image* img = tb_plot_render(); + if (!img || !tb_image_save(img, path)) + tinyblocks_set_error(rt, "não gravou '%s' (o formato da extensão está carregado?)", path); + tb_image_release(img); + self->dirty = false; +} + +/* == Registro ========================================================= */ +typedef struct { + const char* name; const char* label; const char* defs; + int nin; TinyBlocks_ValueKind in[4]; + int out; /* 0 comando, 1 imagem, 2 numero */ + void (*fn)(TinyBlocks_Block*, TinyBlocks*); const char* fname; const char* doc; +} Spec; + +#define N TB_VALUE_NONE +#define T TB_VALUE_TEXT +#define I TB_VALUE_INTEGER +#define R TB_VALUE_REAL +#define S(fn) fn, #fn +static const Spec s_specs[] = { + { "Plot.Figure", "nova figura de %1 por %2", "480|320", 2, {I,I}, 0, S(eval_figure), "Limpa a figura (largura e altura em pixels)" }, + { "Plot.Line", "plote %1 cor %2 rótulo %3", "1, 4, 2, 5||", 3, {N,T,T}, 0, S(eval_line), "Linha dos valores (x = 1, 2, 3...)" }, + { "Plot.LineXY", "plote %2 em função de %1 cor %3 rótulo %4", "1, 2, 3|1, 4, 9||", 4, {N,N,T,T}, 0, S(eval_line_xy), "Linha de y em função de x" }, + { "Plot.Scatter", "pontos %2 em função de %1 cor %3 rótulo %4", "1, 2, 3|1, 4, 9||", 4, {N,N,T,T}, 0, S(eval_scatter), "Um ponto para cada (x, y)" }, + { "Plot.Bar", "barras %1 com nomes %2 cor %3", "3, 5, 2|a, b, c|", 3, {N,N,T}, 0, S(eval_bar), "Barras dos valores, com nomes no eixo x" }, + { "Plot.Hist", "histograma de %1 com %2 faixas cor %3", "|10|", 3, {N,I,T}, 0, S(eval_hist), "Quantos valores caem em cada faixa" }, + { "Plot.Title", "título da figura %1", "Gráfico", 1, {T}, 0, S(eval_title), "Título no alto" }, + { "Plot.XLabel", "nome do eixo x %1", "x", 1, {T}, 0, S(eval_xlabel), "Texto embaixo do eixo x" }, + { "Plot.YLabel", "nome do eixo y %1", "y", 1, {T}, 0, S(eval_ylabel), "Texto ao lado do eixo y" }, + { "Plot.Legend", "mostre a legenda", "", 0, {N}, 0, S(eval_legend), "Caixa com o rótulo de cada série" }, + { "Plot.Grid", "mostre a grade", "", 0, {N}, 0, S(eval_grid), "Linhas de grade nas marcas" }, + { "Plot.XLim", "eixo x de %1 até %2", "0|10", 2, {R,R}, 0, S(eval_xlim), "Limites do eixo x" }, + { "Plot.YLim", "eixo y de %1 até %2", "0|10", 2, {R,R}, 0, S(eval_ylim), "Limites do eixo y" }, + { "Plot.Push", "acrescente %1 à série %2", "0|perda", 2, {N,T}, 0, S(eval_push), "Junta valores no fim de uma série com nome" }, + { "Plot.Series", "plote a série %1 cor %2", "perda|", 2, {T,T}, 0, S(eval_series_plot), "Linha da série com nome (rótulo = o nome)" }, + { "Plot.SeriesClear", "apague a série %1", "perda", 1, {T}, 0, S(eval_series_clear), "Esvazia a série" }, + { "Plot.SeriesLen", "tamanho da série %1", "perda", 1, {T}, 2, S(eval_series_len), "Quantos valores a série tem" }, + { "Plot.Image", "imagem da figura", "", 0, {N}, 1, S(eval_image), "Desenha a figura numa imagem" }, + { "Plot.Save", "salve a figura em %1", "grafico.png", 1, {T}, 0, S(eval_save), "Grava a figura (.png, .bmp ou .ppm)" }, +}; +#undef N +#undef T +#undef I +#undef R + +static bool plot_init(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) { + static const TinyBlocks_Category cat = { "Gráficos", {0.15f, 0.62f, 0.55f, 1.f}, {0.10f, 0.47f, 0.42f, 1.f} }; + tb_library_set_category(lib, &cat); + static const char* names[] = { "a", "b", "c", "d" }; + static const TinyBlocks_SlotDesc out_img[] = {{"imagem", TB_VALUE_IMAGE}}; + static const TinyBlocks_SlotDesc out_num[] = {{"valor", TB_VALUE_INTEGER}}; + for (size_t i = 0; i < sizeof(s_specs) / sizeof(s_specs[0]); i++) { + const Spec* sp = &s_specs[i]; + TinyBlocks_SlotDesc in[4]; + for (int k = 0; k < sp->nin; k++) in[k] = (TinyBlocks_SlotDesc){ names[k], sp->in[k] }; + const TinyBlocks_SlotDesc* out = sp->out == 1 ? out_img : sp->out == 2 ? out_num : NULL; + TinyBlocks_TypeBlock* t = tb_type_block_create(rt, sp->name, sp->nin ? in : NULL, (uint32_t)sp->nin, + out, out ? 1u : 0u, sp->fn); + if (!t) return false; + tb_type_block_set_label(t, sp->label, sp->defs); + tb_meta_declare(sp->name, sp->fname, __FILE__, sp->doc); + if (!tb_library_add(lib, &t->base)) return false; + } + return true; +} + +static void plot_deinit(TinyBlocks* rt, TinyBlocks_LibraryBlock* lib) { + (void)rt; (void)lib; + tb_plot_figure(480, 320); + free(F.s); F.s = NULL; F.cap = 0; + for (int i = 0; i < s_named_n; i++) free(s_named[i].v); + free(s_named); s_named = NULL; s_named_n = 0; +} + +TINYBLOCKS_DEFINE_LIBRARY(plot, "tinyblocks-plot", "1.0.0", plot_init, plot_deinit) + +const TinyBlocks_LibraryDescriptor* tb_plot_get_library(void) { + return &_tb_lib_desc_plot; +} diff --git a/libraries/tinyblocks-plot/tools/gen_font.c b/libraries/tinyblocks-plot/tools/gen_font.c new file mode 100644 index 0000000..396f7fe --- /dev/null +++ b/libraries/tinyblocks-plot/tools/gen_font.c @@ -0,0 +1,64 @@ +/* + * gen_font.c - gera src/plot_font.h: a fonte da tinyblocks-plot (DejaVu Sans + * 12 px, com antisserrilhado), renderizada pela tinyblocks-opentype. Assim a + * plot desenha texto sem depender de outra library em execucao. + * + * make -C libraries/tinyblocks-plot font (precisa da opentype compilada) + * + * Caracteres: ASCII 32..126 e Latin-1 160..255 (acentos do portugues). + */ +#include +#include +#include +#include +#include + +static void utf8(unsigned cp, char* out) { + if (cp < 0x80) { out[0] = (char)cp; out[1] = 0; } + else { out[0] = (char)(0xC0 | (cp >> 6)); out[1] = (char)(0x80 | (cp & 0x3F)); out[2] = 0; } +} + +int main(int argc, char** argv) { + const char* font = argc > 1 ? argv[1] : tb_opentype_default_font(); + int px = argc > 2 ? atoi(argv[2]) : 12; + int h = tb_opentype_load(font); + if (!h) { fprintf(stderr, "fonte: %s\n", tb_opentype_last_error()); return 1; } + double asc, dsc, lh; + tb_opentype_metrics(h, px, &asc, &dsc, &lh); + unsigned cps[256]; int n = 0; + for (unsigned c = 32; c < 127; c++) cps[n++] = c; + for (unsigned c = 160; c < 256; c++) cps[n++] = c; + int H = 0; + printf("/* Gerado por tools/gen_font.c (%s, %d px). Nao editar. */\n", font, px); + printf("#ifndef TB_PLOT_FONT_H\n#define TB_PLOT_FONT_H\n#include \n"); + size_t total = 0; + TinyBlocks_Image* imgs[256]; + for (int i = 0; i < n; i++) { + char s[4]; utf8(cps[i], s); + imgs[i] = tb_opentype_render(h, s, px, 255, 255, 255); + if (imgs[i]) { H = tb_image_height(imgs[i]); total += (size_t)tb_image_width(imgs[i]) * H; } + } + printf("#define PLOT_FONT_H %d\n#define PLOT_FONT_BASE %d\n#define PLOT_FONT_N %d\n", H, (int)(1 + asc + 0.5), n); + printf("typedef struct { uint16_t cp; uint8_t w; uint32_t off; } PlotGlyph;\n"); + printf("static const PlotGlyph s_glyphs[PLOT_FONT_N] = {\n"); + size_t off = 0; + for (int i = 0; i < n; i++) { + int w = imgs[i] ? tb_image_width(imgs[i]) - 2 : 4; /* sem a folga (o render poe 2 px) */ + printf(" {%u,%d,%zu},%s", cps[i], w, off, i % 6 == 5 ? "\n" : ""); + off += (size_t)w * H; + } + printf("};\nstatic const uint8_t s_font[%zu] = {\n", off); + size_t k = 0; + for (int i = 0; i < n; i++) { + int W = imgs[i] ? tb_image_width(imgs[i]) : 6, w = W - 2; + for (int y = 0; y < H; y++) + for (int x = 0; x < w; x++) { + uint8_t r, g, b, a = 0; + if (imgs[i]) tb_image_get_pixel(imgs[i], x, y, &r, &g, &b, &a); + printf("%d,%s", a, ++k % 24 == 0 ? "\n" : ""); + } + } + printf("};\n#endif\n"); + (void)total; + return 0; +} diff --git a/tests/plot_test.c b/tests/plot_test.c new file mode 100644 index 0000000..8cb3fcd --- /dev/null +++ b/tests/plot_test.c @@ -0,0 +1,100 @@ +/* + * plot_test.c - testa a tinyblocks-plot pelos blocos: linha, pontos, + * barras, histograma, serie com nome, legenda, grade e texto com acento; + * valores de lista, de texto e de tensor. Grava /tmp/tb_plot_*.png. + */ +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static int fails = 0; +#define CHECK(c, m) do { if (c) printf("ok %s\n", m); else { printf("FAIL %s\n", m); fails++; } } while (0) + +static TinyBlocks* rt; + +static TinyBlocks_Block* run(const char* type, const char* a, const char* b, const char* c, const char* d) { + TinyBlocks_Block* x = tb_block_create(rt, tb_type_block_find(rt, type)); + const char* v[4] = { a, b, c, d }; + for (int i = 0; i < 4; i++) + if (v[i]) { TinyBlocks_Value t = tb_value_text(v[i]); tb_block_set_default(x, (uint32_t)i, t); tb_value_free(&t); } + tb_block_eval(x, rt); + return x; +} + +/* A cor do pixel e (quase) a pedida? */ +static bool near_color(const TinyBlocks_Image* img, int x, int y, uint32_t rgb, int tol) { + uint8_t r, g, b, a; + if (!tb_image_get_pixel(img, x, y, &r, &g, &b, &a)) return false; + return abs(r - (int)(rgb >> 16 & 255)) <= tol && abs(g - (int)(rgb >> 8 & 255)) <= tol && abs(b - (int)(rgb & 255)) <= tol; +} + +static int count_color(const TinyBlocks_Image* img, uint32_t rgb) { + int n = 0; + for (int y = 0; y < tb_image_height(img); y++) + for (int x = 0; x < tb_image_width(img); x++) n += near_color(img, x, y, rgb, 30); + return n; +} + +int main(void) { + setvbuf(stdout, NULL, _IOLBF, 0); + tinyblocks_init(&rt, NULL); + tb_library_register(rt, tb_png_get_library()); + tb_library_register(rt, tb_tensor_get_library()); + tb_library_register(rt, tb_plot_get_library()); + + run("Plot.Figure", "480", "320", NULL, NULL); + run("Plot.Line", "[1, 4, 2, 5, 3]", "azul", "treino", NULL); + run("Plot.Scatter", "1, 2, 3, 4, 5", "2, 3, 3.5, 4.5, 4", "laranja", "validação"); + run("Plot.Title", "Perda por época", NULL, NULL, NULL); + run("Plot.XLabel", "época", NULL, NULL, NULL); + run("Plot.YLabel", "perda média", NULL, NULL, NULL); + run("Plot.Legend", NULL, NULL, NULL, NULL); + run("Plot.Grid", NULL, NULL, NULL, NULL); + TinyBlocks_Block* im = run("Plot.Image", NULL, NULL, NULL, NULL); + TinyBlocks_Image* img = im->outputs[0].kind == TB_VALUE_IMAGE ? im->outputs[0].as.image : NULL; + CHECK(img && tb_image_width(img) == 480 && tb_image_height(img) == 320, "imagem da figura 480x320"); + CHECK(img && count_color(img, 0x1f77b4) > 150, "a linha azul (tab10) foi desenhada"); + CHECK(img && count_color(img, 0xff7f0e) > 60, "os pontos laranja foram desenhados"); + CHECK(img && near_color(img, 2, 2, 0xffffff, 0), "fundo branco"); + run("Plot.Save", "/tmp/tb_plot_linha.png", NULL, NULL, NULL); + CHECK(!tinyblocks_last_error(rt)[0], "salva em PNG"); + + /* tensor, barras e serie com nome */ + run("Plot.Figure", "400", "260", NULL, NULL); + TinyBlocks_Block* tz = run("Tensor.Randn", "500", NULL, NULL, NULL); + TinyBlocks_Block* h = tb_block_create(rt, tb_type_block_find(rt, "Plot.Hist")); + tb_block_connect(h, 0, tz, 0); + tz->dirty = false; + tb_block_set_default(h, 1, tb_value_integer(15)); + tb_block_eval(h, rt); + run("Plot.Title", "Histograma de um tensor normal", NULL, NULL, NULL); + TinyBlocks_Block* im2 = run("Plot.Image", NULL, NULL, NULL, NULL); + CHECK(im2->outputs[0].kind == TB_VALUE_IMAGE && count_color(im2->outputs[0].as.image, 0x1f77b4) > 3000, + "histograma de um tensor (as barras aparecem)"); + run("Plot.Save", "/tmp/tb_plot_hist.png", NULL, NULL, NULL); + + run("Plot.Figure", "400", "260", NULL, NULL); + for (int i = 0; i < 50; i++) { + char v[32]; + snprintf(v, sizeof(v), "%g", exp(-i / 12.0) + 0.05 * sin(i)); + run("Plot.Push", v, "perda", NULL, NULL); + } + TinyBlocks_Block* len = run("Plot.SeriesLen", "perda", NULL, NULL, NULL); + CHECK(len->outputs[0].as.integer == 50, "a série com nome cresce (50 valores)"); + run("Plot.Series", "perda", "vermelho", NULL, NULL); + run("Plot.Bar", "0.2, 0.4", "a, b", "verde", NULL); + run("Plot.Legend", NULL, NULL, NULL, NULL); + run("Plot.Save", "/tmp/tb_plot_serie.png", NULL, NULL, NULL); + CHECK(!tinyblocks_last_error(rt)[0], "série + barras na mesma figura"); + tinyblocks_deinit(&rt); + if (fails) printf("\n%d FALHA(S)\n", fails); + else printf("\nTUDO OK\n"); + return fails != 0; +}