[minor] Add PixelLoupe, a magnified pixel readout beside an ImageCanvas - #574
Merged
Merged
Conversation
ImGuiWidgets.PixelLoupe draws a grid of the pixels around the pointer while it is over an ImageCanvas, outlines the centre pixel, and reads it out as coordinates, RGBA and hex. It also marks that pixel on the canvas. Pixels come from a caller-supplied callback, so no texture is read back, and the loupe takes no input, so the canvas keeps its pan and zoom. PixelLoupeState holds the hover and clamping rules with no ImGui dependency. ImageCanvasState gains ImageToViewport, the inverse of ViewportToImage. The gallery's SampleImage exposes PixelAt so the loupe tile reads the same pixels the texture holds. Closes #529 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LXUsRiHnKs6HCgLAbC1L6D
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HgjMCJ9MQRmUk6c8KABDYH
|
This was referenced Oct 1, 2026
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.



Requested by Matt · project thread
Before: an
ImageCanvasgave no way to inspect the exact value of the pixel under the pointer.After: while the pointer is over an
ImageCanvas,ImGuiWidgets.PixelLoupedraws a magnified grid of the surrounding pixels. It outlines the centre pixel, marks the same pixel on the canvas, and reads it out as coordinates, RGBA and hex. Pixels come from a callback the caller supplies, so nothing is read back from the GPU. The loupe takes no input, so the canvas keeps its own pan and zoom.How:
PixelLoupeStateholds the hover and clamping rules and has no ImGui dependency.ImageCanvasState.ImageToViewportis the same inverse mapping the CropOverlay PR adds, so it appears only once in the stack. The gallery'sSampleImageexposesPixelAt, so the loupe tile reads the same pixels the texture holds. The PR adds a demo section, an isolation suite, a gallery tile and docs entries.Stacked PR. The base is #573 (CropOverlay), and this is the top of the image-widget stack. Merge order: #570 → #571 → #572 → #573 → this.
Validation, Release build: the solution builds clean, and
ImGuiWidgetsDemo.UITestspasses 46/46. On this top branch,ImGui.Widgets.Testspasses 931/931,ImGui.Widgets.UITests629/629 andWidgetGallery.UITests6/6, andWidgetGallery --checkpasses.Closes #529
🤖 Generated with Claude Code
https://claude.ai/code/session_01LXUsRiHnKs6HCgLAbC1L6D
Generated by Claude Code