{"id":15366774,"url":"https://github.com/erkkah/jaggies","last_synced_at":"2025-04-15T12:31:15.761Z","repository":{"id":51769068,"uuid":"162347410","full_name":"erkkah/jaggies","owner":"erkkah","description":"Jaggies - a tiny vector graphics library","archived":false,"fork":false,"pushed_at":"2020-03-03T22:25:22.000Z","size":530,"stargazers_count":29,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T20:12:05.357Z","etag":null,"topics":["c","e-ink","embedded","polygon","tiny","tinylib","vector-graphics"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erkkah.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-18T21:29:38.000Z","updated_at":"2024-09-30T17:57:49.000Z","dependencies_parsed_at":"2022-08-22T19:31:49.208Z","dependency_job_id":null,"html_url":"https://github.com/erkkah/jaggies","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Fjaggies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Fjaggies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Fjaggies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erkkah%2Fjaggies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erkkah","download_url":"https://codeload.github.com/erkkah/jaggies/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249072170,"owners_count":21208129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","e-ink","embedded","polygon","tiny","tinylib","vector-graphics"],"created_at":"2024-10-01T13:19:48.909Z","updated_at":"2025-04-15T12:31:15.734Z","avatar_url":"https://github.com/erkkah.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Jaggies - a tiny vector graphics library\n\n```asciiart\n    |               o\n    |,---.,---.,---..,---.,---.\n    |,---||   ||   |||---'`---.\n`---'`---^`---|`---|``---'`---'\n          `---'`---'\n```\n\nJaggies is a tiny C library for drawing filled polygons\nand lines using only integer math, static allocations\nand the standard C library.\n\nThis makes Jaggies well suited for running on micro\ncontrollers with limited memory.\n\nJaggies uses a global state, which is built up by\nadding polygons and lines.\n\nThe global state is then rendered in one continuous flow,\none pixel at a time, row by row. Polygons are renderer\nback to front, where latest added polygons will overdraw\nearlier. Lines are always drawn on top.\n\nThis makes it possible to draw basic vector graphics\nto destinations without random access frame buffer\naccess. No frame buffer is used internally either,\nkeeping memory requirements low.\n\nJaggies is distributed under the MIT license.\n\n## Getting started\n\nBasic example:\n\n```C\nvoid setPixel(void* context, unsigned char color) {\n    SomeBitmap* bmp = (SomeBitmap*) context;\n    // implementation here!\n}\n\nSomeBitmap *bmp = createBitmapSomehow();\n\n// Clear the global state\njaggieClear();\n\n// A square\njaggiePoint square[] = {\n    {4, 1},\n\n    {10, 10},\n    {100, 10},\n    {100, 100},\n    {10, 100}\n};\n\n// Add a polygon\njaggiePoly(square);\n\n// Render using `setPixel` above\njaggieRender(150, 150, 0, setPixel, bmp);\n```\n\nThe full five function API is documented in [jaggies.h](jaggies.h).\n\nCheck out the example in the [test](test) folder.\n\n![Animated demo](test/test.gif)\n\n\u003e NOTE: The example uses the awesome [tigr](https://github.com/erkkah/tigr) library, which is included as a submodule, but Jaggies itself has no external dependencies.\n\n## Memory requirement and other tweaks\n\nSince required structures are statically allocated, the overall memory requirement is defined by the coordinate type and the maximum number of lines and polygons in the global render state.\n\nThese are set to relatively low levels (`short int` coordinates, 16 polygons and 48 lines) by default, and can be overridden by setting the `JAGGIE_INT`, `JAGGIE_MAX_POLYS` and `JAGGIE_MAX_LINES` preprocessor defines.\n\nThe pixel type is `unsigned char` by default, but can be changed by setting the `JAGGIE_COLOR` define.\n\nIf you are really low on memory and cycles, multi-color support can be turned off by setting the `JAGGIE_SINGLE_COLOR` define.\nThis causes all primitives to be drawn in the same color, using the last value set by `jaggieColor()`.\n\n## Known issues\n\n* Jaggies is designed for limited memory situations, it is not your fastest pixel pushing friend. But that's OK.\n\n* Jaggies uses a global state which makes drawing several scenes at the same time impossible. Also fine.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Fjaggies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferkkah%2Fjaggies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferkkah%2Fjaggies/lists"}