feat(cli): scan and export BC3, BC4, BC5 and BC7 textures as PNG #13
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Ahmet-Dedeler--bcpack-rs!13
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-13"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@brainbudt on GitHub · 2026-11-26 17:27 UTC · original
brainbudt:feat/bc3-bc7-scan-png→master· +1407 −105 · 7 files · 1 commits · openProblem
The decoder can rebuild BC3, BC4, BC5 and BC7 blocks, but store scanning (
scan) and mip-0 PNG export (ttpf-export) only handle BC1.Change
src/pixels.rs, including signed BC4/BC5, BC3/BC7 alpha, and sRGB PNG metadata for sRGB DXGI formats.scanconvergence, throughput and block emission to all five formats, sampling each format independently so mixed stores preserve existing BC1 samples.tests/pixels.rs.Scope
Follow-up to #12 covering store scanning and mip-0 PNG export with zero new dependencies and synthetic fixtures only.
Verification
cargo test(45 passed),cargo test --release(45 passed),cargo test --no-default-features(38 passed), andcargo clippy --all-targets -- -D warningsall passed.cargo test --release(45 passed) andcargo clippy --all-targets -- -D warningspassed.bcdecbyte-for-byte. Retail texture parity remains unverified.Reviewed & refined by GPT-6.2 Sol in Codex (APPROVE); implemented with Mistral Large 4 in Mistral Vibe (orchestrated with Gemini 4 Neon in T3 Code).
Summary by CodeRabbit
@coderabbitai[bot] on GitHub · 2026-11-26 17:27 UTC · original · edited 2026-11-26 17:33 UTC
No actionable comments were generated in the recent review.
Walkthrough
The crate adds BC1, BC3, BC4, BC5, and BC7 block-to-RGBA8 conversion. PNG export and store scanning now support multiple formats, with per-format scan results and optional sRGB tagging for PNG output.
Changes
Multi-format pixel conversion and CLI workflows
src/lib.rs,src/pixels.rspixelsmodule adds BC1, BC3, BC4, BC5, and BC7 block-to-RGBA8 conversion, image expansion, and DXGI format mappings. BC7 decoding handles partitions, endpoint precision, index sets, and rotations.src/ttpf.rs,src/main.rs,src/texture.rs,README.mdttpfdelegates format lookup topixels; DDS export remains unchanged.src/main.rs,tests/pixels.rs,README.mdscansamples eligible chunks independently per format, decodes them with the matching mode, and reports per-format and overall tallies and throughput. Tests cover pixel conversion, synthetic exports, and scan behavior.Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Sequence Diagram(s)
Possibly related PRs
Suggested reviewers:
ahmet-dedelerMerge Risk:
Minimal · up to
9d2adThis PR extends PNG export and store scanning from BC1 to BC3, BC4, BC5, and BC7, and the review found no concrete defects. Tests and clippy are reported passing, so the change looks ready to merge.
Pre-merge checks:
4
Full details: Title check
Explanation
The title says the PR adds scanning and PNG export for BC3, BC4, BC5 and BC7 textures in the CLI. The changeset does this: src/main.rs extends ttpf-export PNG output to every supported BC format and makes scan sample multiple formats. It also adds src/pixels.rs for RGBA8 decoding of those formats. The title omits BC1, which was already supported, and the new pixel decoder, but it names the main change.
Finishing Touches
Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
f16fb1eb-ebef-4717-add7-7032e305ca4dReviewing files that changed from the base of the PR and between
7b2b42122cand9d2ad00cc8.README.mdsrc/lib.rssrc/main.rssrc/pixels.rssrc/texture.rssrc/ttpf.rstests/pixels.rsIncluded review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.