{"id":16856405,"url":"https://github.com/vallentin/gl-capture","last_synced_at":"2025-03-18T11:14:17.278Z","repository":{"id":169156768,"uuid":"644974419","full_name":"vallentin/gl-capture","owner":"vallentin","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-06T20:35:46.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-28T14:44:20.560Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/vallentin.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":"2023-05-24T16:37:33.000Z","updated_at":"2023-05-24T21:44:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"e063585a-c7e4-41f8-9848-f760284b7a7e","html_url":"https://github.com/vallentin/gl-capture","commit_stats":null,"previous_names":["vallentin/gl-capture"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vallentin%2Fgl-capture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vallentin%2Fgl-capture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vallentin%2Fgl-capture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vallentin%2Fgl-capture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vallentin","download_url":"https://codeload.github.com/vallentin/gl-capture/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244207746,"owners_count":20416109,"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":[],"created_at":"2024-10-13T14:04:08.286Z","updated_at":"2025-03-18T11:14:17.271Z","avatar_url":"https://github.com/vallentin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gl-capture\n\n[![Latest Version](https://img.shields.io/crates/v/gl-capture.svg)](https://crates.io/crates/gl-capture)\n[![Docs](https://docs.rs/gl-capture/badge.svg)](https://docs.rs/gl-capture)\n[![License](https://img.shields.io/github/license/vallentin/gl-capture.svg)](https://github.com/vallentin/gl-capture)\n\nLibrary for capturing screenshots in OpenGL.\n\nSee [examples/basic.rs] for a complete example.\n\n```rust\nlet img = unsafe { gl_capture::capture() };\n// img.size: (u32, u32)\n// img.data: Vec\u003ccapture_gl::Rgb\u003e\n// Now use e.g. `png` or `image` crate to save the image data to a file\n```\n\nAlternatively, use [`capture_into()`] to reuse the same image data, instead\nof reallocating on every call.\n\n```rust\nlet mut img = gl_capture::RgbImageData::new(size);\nunsafe {\n    gl_capture::capture_into(\u0026mut img);\n}\n// img.size: (u32, u32)\n// img.data: Vec\u003ccapture_gl::Rgb\u003e\n```\n\nAlso supports other formats, e.g. [`RgbaImageData`], [`BgrImageData`], [`BgraImageData`].\n\nWhen manually using `gl::ReadPixels()`, instead it is also possible to use\n[`read_pixels()`] or [`read_pixels_ptr()`], which performs some additional checks\nand setup.\n\n```rust\nlet format = gl_capture::CaptureFormat::Rgb;\nlet mut data = format.allocate_pixel_data(size);\n\nunsafe {\n    gl_capture::read_pixels((0, 0), size, format, \u0026mut data);\n}\n```\n\n[examples/basic.rs]: https://github.com/vallentin/gl-capture/blob/master/examples/basic.rs\n\n[`capture_into()`]: https://docs.rs/gl-capture/*/gl_capture/fn.capture_into.html\n\n[`RgbaImageData`]: https://docs.rs/gl-capture/*/gl_capture/type.RgbaImageData.html\n[`BgrImageData`]: https://docs.rs/gl-capture/*/gl_capture/type.BgrImageData.html\n[`BgraImageData`]: https://docs.rs/gl-capture/*/gl_capture/type.BgraImageData.html\n\n[`read_pixels()`]: https://docs.rs/gl-capture/*/gl_capture/fn.read_pixels.html\n[`read_pixels_ptr()`]: https://docs.rs/gl-capture/*/gl_capture/fn.read_pixels_ptr.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvallentin%2Fgl-capture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvallentin%2Fgl-capture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvallentin%2Fgl-capture/lists"}