{"id":17025246,"url":"https://github.com/eyzi/ember","last_synced_at":"2026-05-02T01:33:19.047Z","repository":{"id":231783945,"uuid":"782397416","full_name":"eyzi/ember","owner":"eyzi","description":"media byte reader","archived":false,"fork":false,"pushed_at":"2024-04-08T00:07:11.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T23:16:21.619Z","etag":null,"topics":["image","media","sound","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eyzi.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,"publiccode":null,"codemeta":null}},"created_at":"2024-04-05T08:12:15.000Z","updated_at":"2024-04-07T05:44:47.000Z","dependencies_parsed_at":"2024-04-05T23:24:25.103Z","dependency_job_id":"0572ed11-33ca-4d03-a69f-7276ba5429f5","html_url":"https://github.com/eyzi/ember","commit_stats":null,"previous_names":["eyzi/ember"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyzi%2Fember","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyzi%2Fember/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyzi%2Fember/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyzi%2Fember/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyzi","download_url":"https://codeload.github.com/eyzi/ember/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245007238,"owners_count":20546142,"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":["image","media","sound","zig"],"created_at":"2024-10-14T07:28:37.704Z","updated_at":"2026-05-02T01:33:19.014Z","avatar_url":"https://github.com/eyzi.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ember\nMedia Byte Reader\n\n## Usage\n\n1. Add to build.zig.zon:\n```\n.{\n    .dependencies = .{\n        .ember = .{\n            .url = \"https://github.com/eyzi/ember/archive/2b83332d5bc5ab259d3064c25e6b90eded9f3dad.tar.gz\",\n            .hash = \"12202221a4415efd2186a651add316c5247d2ecc6dbac55e43a30658c833075dabe1\",\n        },\n    },\n}\n```\n\n2. Add module to your exe in build.zig\n```\nconst ember_dep = b.dependency(\"ember\", .{\n    .target = target,\n    .optimize = optimize,\n});\nexe.addModule(\"ember\", ember_dep.module(\"ember\"));  \n```\n\n3. Import in code\n```\nconst ember = @import(\"ember\");\n```\n\n## Image\n\n```\nconst image: ember.types.EmberImage = try ember.load_image(.BMP, \"assets/images/icon.bmp\", allocator);\ndefer image.deallocate(allocator);\n```\n\n`ember.types.EmberImage` has the following structure:\n```\n{\n    meta: {\n        file: [:0]const u8, // filepath\n        bytes: []u8, // raw file content\n    },\n    format: EmberImageFormat,\n    width: u32,\n    height: u32,\n    pixels: []{\n        red: u8,\n        green: u8,\n        blue: u8,\n        alpha: u8,\n    },\n}\n```\n\n## Sound\n\n```\nconst sound: ember.types.EmberSound = try ember.load_sound(.WAV, \"assets/sounds/completion.wav\", allocator);\ndefer sound.deallocate(allocator);\n```\n\n`ember.types.EmberSound` has the following structure:\n```\n{\n    meta: {\n        file: [:0]const u8, // filepath\n        bytes: []u8, // raw file content\n    },\n    format: EmberSoundFormat,\n    n_channels: u16,\n    sample_rate: u32,\n    bit_depth: u16,\n    data_size: usize,\n    samples: []u8,\n}\n```\n\n## 3d\n\n```\nconst model: ember.types.Ember3d = try ember.load_3d(.OBJ, \"assets/models/cube.obj\", allocator);\ndefer model.deallocate(allocator);\n```\n\n`ember.types.Ember3d` has the following structure:\n```\n{\n    meta: {\n        file: [:0]const u8, // filepath\n        bytes: []u8, // raw file content\n    },\n    format: Ember3dFormat,\n    vertices: []@Vector(3, f32),\n    uvs: []@Vector(2, f32),\n    normals: []@Vector(3, f32),\n    indices: []@Vector(3, u32),\n}\n```\n\n## Raw Bytes\n\n```\nconst bytes: []u8 = try ember.load(filepath, allocator);\ndefer allocator.free(bytes);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyzi%2Fember","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyzi%2Fember","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyzi%2Fember/lists"}