ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
zoom_internal.h File Reference

Module-private seam shared by the zoom state machine and its render. More...

#include <stdint.h>
#include "ra8_attributes.h"
Include dependency graph for zoom_internal.h:
This graph shows which files directly or indirectly include this file:

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.

Detailed Description

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.

Since
0.1.0

Definition in file zoom_internal.h.

Function Documentation

◆ priv_zoom_axis()

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.

Parameters
[in]anchorMagnified-plane coordinate shown at viewport offset 0.
[in]extentViewport extent on this axis, destination pixels (> 0).
[in]scaleInteger magnification (>= 1).
[in]src_dimSource extent on this axis, pixels (>= 1).
[out]outReceives the resolved axis.
Returns
Nothing; out is always fully populated.
Precondition
out is non-NULL (callers are inside this module and hold storage).
scale >= 1 and src_dim * scale fits in int32 (guaranteed by k_zoom_dim_max and k_zoom_scale_max).
Postcondition
Every invariant of zoom_axis_t holds.
No input is modified.
Note
Pure; thread-safe.
See also
zoom_axis_t
Since
0.1.0

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().