/* * TinyBlocks - tb_vg.h * Library tinyblocks-vg: construcao de desenhos vetoriais (TinyBlocks_VectorData) * e rasterizacao para TinyBlocks_Image. Base de renderizacao do tinyblocks-svg. * * Cada helper gera comandos autocontidos (incluindo a cor), de modo que o * documento pode ser rasterizado pela tinyblocks-vg e tambem reproduzido no * palco por tb_draw_ctx_play. */ #ifndef TINYBLOCKS_VG_H #define TINYBLOCKS_VG_H #include TB_API const TinyBlocks_LibraryDescriptor* tb_vg_get_library(void); /* -- API C --- */ TB_API TinyBlocks_VectorData* tb_vg_new(void); /* Rasteriza o documento numa imagem w x h. "scale" amplia as coordenadas * (0 ou negativo = 1). O fundo e' transparente. */ TB_API TinyBlocks_Image* tb_vg_render(const TinyBlocks_VectorData* v, int w, int h, float scale); TB_API bool tb_vg_line (TinyBlocks_VectorData* v, float x1, float y1, float x2, float y2, float r, float g, float b, float a, float width); TB_API bool tb_vg_rect (TinyBlocks_VectorData* v, float x, float y, float w, float h, float r, float g, float b, float a); TB_API bool tb_vg_circle (TinyBlocks_VectorData* v, float cx, float cy, float rad, float r, float g, float b, float a); TB_API bool tb_vg_polygon(TinyBlocks_VectorData* v, const double* xy, int n, bool closed, float r, float g, float b, float a); #endif /* TINYBLOCKS_VG_H */