Repository navigation
feat(image): fit a picture into a box, and scale its pixels - #118
Merged
Merged
Conversation
A photo is far larger than where it is shown, and inkcell_fb_blit_bgra draws one for one. ui/image.h adds inkcell_image_fit() - contain or cover, which part of the picture shows and where - and inkcell_image_scale_bgra(), a box filter down and nearest pixel up, so a viewer scales once and blits the result each frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VUf1KjJ3LhZrw5yTNk8LqB
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VUf1KjJ3LhZrw5yTNk8LqB
For a viewer's empty grid. Only the new sprite is added: regenerating the whole table from today's Material Symbols moves every other sprite, so the existing runs are kept as they were and photo_library's are appended. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VUf1KjJ3LhZrw5yTNk8LqB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
For inkos R8b (Photos): thumbnails in a grid and a picture on the viewer's page.
include/inkcell/ui/image.h,src/image.c. Pure: no panel and no allocation.inkcell_image_fit(w, h, box, cover)says where the picture lands and which part of it shows. Contain fits all of it, centred. Cover fills the box and cuts the middle to the box's shape.inkcell_image_scale_bgra()scales down with a box filter (the mean of the source pixels under each output pixel, with 64-bit sums) and up with the nearest pixel. Rows are by stride, so it can scale part of an image.INKCELL_ICON_PHOTO(photo_library), for the grid's empty state. Only its sprite is appended: the font upstream has moved, and regenerating the whole table would change every other icon.Tests: contain and cover in both orientations, a side of 0, a checkerboard averaged to grey, an upscale, and a stride wider than the row.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VUf1KjJ3LhZrw5yTNk8LqB