Expand description
The loupe: the pixels under the pointer, magnified, in a square that follows it.
It shows displayed pixels: the viewport’s own tile textures,
after the display transform, drawn again through a magnifying
mapping and clipped to the loupe. On the GPU path the half-float
tiles are sampled in a second paint callback (the same shader, its
own uniforms), with no read back to the CPU; on the CPU path the
tiles’ egui textures (nearest filtering) are drawn again. Each
displayed pixel (an image pixel from 100 % up, a screen pixel below)
becomes a square of magnification points, crisp, with an optional
grid, a marker around the centre pixel and a readout of its values:
as displayed (RGB, 0 to 255, and Lab) or as the source gave them
(the scene values).
The loupe sits beside the pointer, above and to the right, and flips
at the viewport’s edges. It is turned on by the application (a tool
option: ViewportState::loupe_mut)
or by a key (Loupe::key); the viewport signals each toggle
(Signal::Loupe).
Structs§
- Loupe
- A viewport’s loupe settings.
- Loupe
Frame - What the loupe showed in the last frame (for tests and the debug bridge).
- Sampling
- How the loupe magnifies: what is at window physical pixel
plands atat + (p - center) × scale.
Enums§
- Values
- What the loupe’s readout shows.
Constants§
- MAX_
MAGNIFICATION - The largest magnification.
- MIN_
MAGNIFICATION - The smallest magnification.
Functions§
- displayed
- A scene colour (the source’s
R,GandB, when it names them) as displayed: through the display stage, in 8 bits. - lab_
from_ srgb8 - CIE Lab* (D65) of an 8-bit sRGB colour.
- place
- Where a loupe of
sizegoes for a pointer:offsetpoints above and to the right of it, flipped to the left at the right edge ofboundsand below at its top, and kept inside when it does not fit either way. - readout_
lines - The readout’s lines for a pixel: its coordinates and the mode, then
its values as asked (
nonewhen the source gave nothing usable). - readout_
templates - The widest text each line of the readout can hold, one per line: what the loupe’s readout block is measured from, so that its size stays the same while the values change, lag or go away.
- stale
- Whether the readout’s values shown for
pixelare another pixel’s: the pointer moved on and the source has not answered yet.