linebender / linebender/tiny-skia

Derive AnyBitPattern for ColorU8

Open
#120 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
1.6k
Forks
99
Avg merge
2h 52m
Merged PRs (30d)
1

Description

If ColorU8 derived AnyBitPattern, I'd be able to replace the `transmute` calls in this method with bytemuck's `cast` and remove the unsafe code. This will be possible even if `bytemuck` becomes an optional dependency; it'll just have to be guarded by `cfg_attr`.

https://github.com/Pr0methean/OcHd-RustBuild/blob/main/main/src/image_tasks/png_output.rs#L312-L324

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the ColorU8 definition and inspect its existing derives, then review the linked png_output.rs method at lines 312-324. Done means ColorU8 can derive AnyBitPattern and the referenced transmute calls can be replaced with bytemuck casts, including the optional-dependency cfg_attr case.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.