|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Module-private seam shared by the zoom state machine and its render. More...
Go to the source code of this file.
Data Structures | |
| struct | zoom_axis_t |
| One axis of the viewport resolved against the image: coverage + source span. More... | |
Functions | |
| void | priv_zoom_axis (int32_t anchor, int32_t extent, int32_t scale, int32_t src_dim, zoom_axis_t *out) |
| Resolve one viewport axis against the image at the current magnification. | |
Module-private seam shared by the zoom state machine and its render.
zoom.c owns the viewport state and zoom_render.c owns the strip composite, but both have to answer exactly the same geometry question – "given this anchor, viewport extent and magnification, which destination columns are covered and which source columns feed them?" – and answering it twice is how a render and a residency report drift apart. It is answered once, here, by priv_zoom_axis.
Nothing in this header is public API. It is not installed, it is not reachable from inc/, and production code outside apps/shared_libs/zoom must never call it.
Definition in file zoom_internal.h.
| void priv_zoom_axis | ( | int32_t | anchor, |
| int32_t | extent, | ||
| int32_t | scale, | ||
| int32_t | src_dim, | ||
| zoom_axis_t * | out ) |
Resolve one viewport axis against the image at the current magnification.
The single definition of the viewer's geometry. Destination offset d maps to magnified-plane coordinate anchor + d and therefore to source index (anchor + d) / scale; the covered span is where that plane coordinate lies inside [0, src_dim * scale). Both the render (which columns to fill, which source row segment to read) and zoom_view_window (which source pixels are live) are views onto this one result. The division is only ever performed on a non-negative plane coordinate, so it never depends on the implementation of signed truncation.
| [in] | anchor | Magnified-plane coordinate shown at viewport offset 0. |
| [in] | extent | Viewport extent on this axis, destination pixels (> 0). |
| [in] | scale | Integer magnification (>= 1). |
| [in] | src_dim | Source extent on this axis, pixels (>= 1). |
| [out] | out | Receives the resolved axis. |
out is always fully populated.out is non-NULL (callers are inside this module and hold storage). Definition at line 60 of file zoom.c.
References zoom_axis_t::count, zoom_axis_t::d0, zoom_axis_t::d1, and zoom_axis_t::s0.
Referenced by zoom_view_render(), and zoom_view_window().