{"id":19857061,"url":"https://github.com/nateseymour/cofgifs","last_synced_at":"2025-02-28T21:45:34.061Z","repository":{"id":221975292,"uuid":"755893175","full_name":"NateSeymour/cofgifs","owner":"NateSeymour","description":"GIF Decoder for Arm Cortex-M Microprocessors","archived":false,"fork":false,"pushed_at":"2024-02-20T19:44:46.000Z","size":42,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T16:38:53.536Z","etag":null,"topics":["arm","c","cmake","cortex-m","embedded"],"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/NateSeymour.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-11T12:05:46.000Z","updated_at":"2025-02-19T15:13:47.000Z","dependencies_parsed_at":"2024-02-20T14:50:38.489Z","dependency_job_id":"e0353be8-15d8-4ce1-b6a3-8e3346766f14","html_url":"https://github.com/NateSeymour/cofgifs","commit_stats":null,"previous_names":["nateseymour/cofgifs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateSeymour%2Fcofgifs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateSeymour%2Fcofgifs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateSeymour%2Fcofgifs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NateSeymour%2Fcofgifs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NateSeymour","download_url":"https://codeload.github.com/NateSeymour/cofgifs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241246114,"owners_count":19933299,"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":["arm","c","cmake","cortex-m","embedded"],"created_at":"2024-11-12T14:17:21.914Z","updated_at":"2025-02-28T21:45:34.016Z","avatar_url":"https://github.com/NateSeymour.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cofgifs\n\n_Pronounced 'sea' of gifs._\n\nA gif decoder library made for embedded devices. \n\n## Features\n\n- Ultra-low memory consumption.\n- No dynamic memory allocation.\n- In-place GIF parsing. No extra memory used for storing GIF structures.\n\n## Memory Usage\n\nReduction of memory usage to the minimum while retaining performance is the main focus of this project. The ``cgif`` \nstructure itself only consumes 28 (32-bit addressing) or 56 (64-bit addressing) bytes of memory, mostly pointers to \nspecific areas of the \nGIF data itself.\n\nThe render buffer is an array of 4 bytes per pixel. The extra byte is empty to help retain alignment of the pixels \nin memory for efficient access by the rendering code. \n\nBesides the ``cgif`` structure and the render buffer, the library also needs access to space to store its LZW \ndictionary during decompression of the GIF data. Currently (lazily), the library assumes it will need one dictionary \nentry per pixel to be outputted. \n\nThat brings the total memory consumption of the library to 8 bytes per pixel. For animations, half of this space is \nreusable, as the dictionary is discarded between render passes. \n\n## Portability\n\nThis project was originally written with RP2040 processor (Cortex-M0+) in mind, and it leans on the assumption of \nlittle-endianness. Significant changes would need to be made to support BE processing elements. \n\n## Example\n\n```c\nstruct cgif gif;\nstruct cgif_dict_entry dictionary[CGIF_DICT_COUNT_MAX(32, 16)];\nstruct cgif_render_rgb render_buffer[512];\ncgif_error_t err;\n\nerr = cgif_init(\u0026gif, data, dictionary, sizeof(dictionary));\nif(err) { /* Handle Error */ }\n\nerr = cgif_render_next(\u0026gif, render_buffer, sizeof(render_buffer));\nif(err) { /* Handle Error */ }\n```\n\n## Limitations\n\n- Currently doesn't support GIF extensions and will return an error when they are encountered.\n\n## Motivation\n\nWhile working on an embedded project involving a rather large LED matrix, I need a convenient way to create and \nupload color matrices to the device. GIF seemed to be the natural choice for its small file sizes, great compression \nperformance and built-in support for animation, not to mention its support by nearly all modern image editors.\n\nNone of the libraries I could find met my standards and exact use case of the project. Working with a Raspberry Pi \nPico W, the available memory was quite limited. Also, working with an embedded device, I wanted to avoid dynamic \nmemory allocation when at all possible.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnateseymour%2Fcofgifs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnateseymour%2Fcofgifs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnateseymour%2Fcofgifs/lists"}