Skip to content

Make Header::bytes_per_row() public#55

Merged
rfuest merged 4 commits into
embedded-graphics:mainfrom
Enyium:patch-1
Apr 29, 2026
Merged

Make Header::bytes_per_row() public#55
rfuest merged 4 commits into
embedded-graphics:mainfrom
Enyium:patch-1

Conversation

@Enyium

@Enyium Enyium commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Thank you for helping out with tinybmp development! Please:

  • Check that you've added passing tests and documentation
  • Add a CHANGELOG.md entry in the Unreleased section under the appropriate heading (Added, Fixed, etc) if your changes affect the public API
  • Run rustfmt on the project
  • Run just build (Linux/macOS only) and make sure it passes. If you use Windows, check that CI passes once you've opened the PR.

PR description

Access to Header::bytes_per_row() is essential information when you want to walk through the bytes yourself. This is my use case on desktop, trying to performantly update a 20-to-60-MiB .bmp file with a solid color regularly. See also commit messages.

@rfuest rfuest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, expect for a few documentation nits.

Comment thread src/header/mod.rs Outdated
Comment thread src/header/mod.rs Outdated
Comment thread src/header/mod.rs Outdated
Comment thread tests/embedded_graphics.rs Outdated
Enyium added 4 commits April 29, 2026 06:07
This is essential information for the user when walking through the bytes themselves.

The original crate-private function is kept with the `_uncompressed` suffix. The new public one returns an `Option`.
@Enyium

Enyium commented Apr 29, 2026

Copy link
Copy Markdown
Contributor Author

I force-pushed, only changing the comments and the test code.

@rfuest rfuest left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@rfuest rfuest merged commit 43287fb into embedded-graphics:main Apr 29, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants