rust-windowing / rust-windowing/softbuffer
Pixel format API design
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 506
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
We need an API to list available pixel formats, and select one. Some considerations:
- We want a way to support transparency: https://github.com/rust-windowing/softbuffer/issues/17
- The web backend current converts BGRX to RGBA. It would be better if it could use RGBA directly, if an application can render that way.
- It looks like for https://github.com/rust-windowing/softbuffer/issues/44 we'd have to use RGBX, rather than BGRX.
- For https://github.com/rust-windowing/softbuffer/pull/95, it seems BGRA is supported, but not BGRX. So we need to make sure to set alpha to 255.
- Wayland's
wl_shmcan support many formats, but only two are required to be supported by compositors.
So some questions here:
- What formats should be supported?
- We want to offer a format for each platform that can be used efficiently without conversion, at least, and there doesn't seem to be one that can be assumed everywhere, unfortunately.
- There are many formats that could be supported on at least some platforms.
- Do we want to support formats that are not 4 byte per pixel? This will impact the API, which currently uses u32 values for pixels.
- How to we communicate what formats are supported, and what formats are optimal?
- We still want at least one format to work on all platforms, even if it requires conversion on some, right? What formats should be universally supported, then?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the pixel-format requirements in this issue alongside issues 17 and 44 and pull request 95. Inspect the web backend's BGRX-to-RGBA conversion and Wayland's wl_shm format constraints. Done means agreeing on supported and optimal formats, alpha handling, universal fallback behavior, and an API for listing and selecting them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100