feat: add Image pixel buffer and image I/O (PPM/EXR/PNG)#2
Open
mtao wants to merge 2 commits into
Open
Conversation
Implement Phase 3 of the ART viewer plan: - art::Image: PBRT Film-style pixel buffer with direct pixel access, weighted sample accumulation, bulk set (scanline/tile), progress tracking (atomic), dirty notification (version + callback), and tone-mapped RGBA8 conversion. Move-only due to std::atomic members. - Camera::render() now produces Image pixels (white for hits, black for misses) instead of printing ASCII to stdout. - Image I/O with generic load()/save() dispatch on file extension: - PPM: always available, no dependencies (P6 binary format) - EXR: optional via -Dexr=true (tinyexr subproject wrap) - PNG: optional via -Dpng=true (stb_image subproject wrap) - 31 test cases (292 assertions with all I/O enabled, 274 without)
…l, trailing returns)
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.
Summary
Implements Phase 3 of the ART viewer plan: a real pixel buffer and image I/O infrastructure.
art::Image (PBRT Film-style pixel buffer)
set_pixel/pixel) and weighted sample accumulation (add_sample/resolved_pixel)set_scanline,set_tile,pixels()span,raw_pixels()increment_progress/pixels_completed/progress_fraction)version()+set_on_update()callback)to_rgba8with exposure/gamma)std::atomicmembers)Camera::render() → Image
Image(nx, ny), writes white pixels for hits, black for missesincrement_progress()per pixelImage I/O
art::io::load()/art::io::save()dispatch on file extension (Auto mode) or explicitImageFormatenum-Dexr=true(tinyexr subproject wrap with miniz)-Dpng=true(stb_image/stb_image_write subproject wrap)has_exr_support()/has_png_support()/has_ppm_support()queriesBuild
-Dexr=true -Dpng=true): 31 test cases, 292 assertions, 0 skipped