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

Pure bounded tile rotation plus checked raw-surface row writes. More...

#include "emu_view.h"
#include "emu_view_tile_internal.h"
Include dependency graph for emu_view_tile.c:

Go to the source code of this file.

Data Structures

struct  tile_destination_t
 Rotated tile placement and dimensions. More...

Functions

static RA8_INTERNAL size_t internal_row_offset (const emu_presentation_workspace_t *presentation, uint16_t x, uint16_t y)
 Return the raw-surface byte offset of one display row.
static RA8_INTERNAL bool internal_write_rows (emu_presentation_workspace_t *presentation, const uint16_t *pixels, const tile_destination_t *destination)
 Write one contiguous tile into checked raw-surface rows.
static RA8_INTERNAL tile_destination_t internal_tile_destination (const emu_presentation_workspace_t *presentation, uint16_t source_x, uint16_t source_y, uint16_t width, uint16_t height)
 Resolve one source tile's placement after panel rotation.
static RA8_INTERNAL void internal_rotate_tile (const emu_presentation_workspace_t *presentation, const uint16_t *source, uint16_t *rotated, uint16_t width, uint16_t height, uint16_t output_width)
 Rotate one bounded RGB565 tile into caller scratch.
bool priv_emu_view_tile_write (emu_presentation_workspace_t *presentation, const uint16_t *source, uint16_t source_x, uint16_t source_y, uint16_t width, uint16_t height)
 Rotate and write one native-panel tile into its exact display location.

Detailed Description

Pure bounded tile rotation plus checked raw-surface row writes.

Maps native panel coordinates through each supported display rotation and writes exact RGB565 row spans into the descriptor-backed composite while rejecting overflow and out-of-range placements.

Since
0.1.0

Definition in file emu_view_tile.c.

Function Documentation

◆ internal_rotate_tile()

RA8_INTERNAL void internal_rotate_tile ( const emu_presentation_workspace_t * presentation,
const uint16_t * source,
uint16_t * rotated,
uint16_t width,
uint16_t height,
uint16_t output_width )
static

Rotate one bounded RGB565 tile into caller scratch.

Rotate one bounded rgb565 tile into caller scratch; this step is contained within the emu view tile model and uses bounded caller or module-owned storage.

Parameters
[in]presentationDescriptor-backed presentation workspace accessed by the operation.
[in]sourceSource input used by the operation.
[in,out]rotatedRotated state or storage updated in place by the operation.
[in]widthWidth of the affected region in pixels.
[in]heightHeight of the affected region in pixels.
[in]output_widthOutput width input used by the operation.
Precondition
Arguments satisfy the ranges documented for rotate tile.
The call executes on the emulator's single owning thread.
Postcondition
State changes remain confined to the emu view tile model and documented output objects.
Ownership of caller-supplied storage is unchanged.
Note
The operation is synchronous and does not transfer heap ownership.
Since
0.1.0

Definition at line 127 of file emu_view_tile.c.

References k_rotate_180, k_rotate_90, RA8_INTERNAL, and emu_presentation_workspace_t::rotate_deg.

Referenced by priv_emu_view_tile_write().

◆ internal_row_offset()

RA8_INTERNAL size_t internal_row_offset ( const emu_presentation_workspace_t * presentation,
uint16_t x,
uint16_t y )
static

Return the raw-surface byte offset of one display row.

Return the raw-surface byte offset of one display row; this step is contained within the emu view tile model and uses bounded caller or module-owned storage.

Parameters
[in]presentationDescriptor-backed presentation workspace accessed by the operation.
[in]xHorizontal coordinate in pixels.
[in]yVertical coordinate in pixels.
Returns
The row offset result produced by the emu view tile model.
Return values
valueThe operation-specific row offset value.
Precondition
Arguments satisfy the ranges documented for row offset.
The call executes on the emulator's single owning thread.
Postcondition
State changes remain confined to the emu view tile model and documented output objects.
Ownership of caller-supplied storage is unchanged.
Note
The operation is synchronous and does not transfer heap ownership.
Since
0.1.0

Definition at line 30 of file emu_view_tile.c.

References emu_presentation_workspace_t::composite_width.

Referenced by internal_write_rows().

◆ internal_tile_destination()

RA8_INTERNAL tile_destination_t internal_tile_destination ( const emu_presentation_workspace_t * presentation,
uint16_t source_x,
uint16_t source_y,
uint16_t width,
uint16_t height )
static

Resolve one source tile's placement after panel rotation.

Resolve one source tile's placement after panel rotation; this step is contained within the emu view tile model and uses bounded caller or module-owned storage.

Parameters
[in]presentationDescriptor-backed presentation workspace accessed by the operation.
[in]source_xSource x input used by the operation.
[in]source_ySource y input used by the operation.
[in]widthWidth of the affected region in pixels.
[in]heightHeight of the affected region in pixels.
Returns
The tile destination result produced by the emu view tile model.
Return values
valueThe operation-specific tile destination value.
Precondition
Arguments satisfy the ranges documented for tile destination.
The call executes on the emulator's single owning thread.
Postcondition
State changes remain confined to the emu view tile model and documented output objects.
Ownership of caller-supplied storage is unchanged.
Note
The operation is synchronous and does not transfer heap ownership.
Since
0.1.0

Definition at line 88 of file emu_view_tile.c.

References tile_destination_t::height, k_rotate_180, k_rotate_270, k_rotate_90, emu_presentation_workspace_t::panel_height, emu_presentation_workspace_t::panel_width, emu_presentation_workspace_t::rotate_deg, tile_destination_t::width, tile_destination_t::x, and tile_destination_t::y.

Referenced by priv_emu_view_tile_write().

◆ internal_write_rows()

RA8_INTERNAL bool internal_write_rows ( emu_presentation_workspace_t * presentation,
const uint16_t * pixels,
const tile_destination_t * destination )
static

Write one contiguous tile into checked raw-surface rows.

Write one contiguous tile into checked raw-surface rows; this step is contained within the emu view tile model and uses bounded caller or module-owned storage.

Parameters
[in,out]presentationDescriptor-backed presentation workspace accessed by the operation.
[in]pixelsPixels input used by the operation.
[in]destinationDestination input used by the operation.
Returns
The write rows result produced by the emu view tile model.
Return values
trueThe write rows condition holds or completed successfully; false otherwise.
Precondition
Arguments satisfy the ranges documented for write rows.
The call executes on the emulator's single owning thread.
Postcondition
State changes remain confined to the emu view tile model and documented output objects.
Ownership of caller-supplied storage is unchanged.
Note
The operation is synchronous and does not transfer heap ownership.
Since
0.1.0

Definition at line 56 of file emu_view_tile.c.

References emu_presentation_write(), tile_destination_t::height, internal_row_offset(), RA8_INTERNAL, tile_destination_t::width, tile_destination_t::x, and tile_destination_t::y.

Referenced by priv_emu_view_tile_write().

◆ priv_emu_view_tile_write()

bool priv_emu_view_tile_write ( emu_presentation_workspace_t * presentation,
const uint16_t * source,
uint16_t source_x,
uint16_t source_y,
uint16_t width,
uint16_t height )

Rotate and write one native-panel tile into its exact display location.

Rotate and write one native-panel tile into its exact display location; this step is contained within the emu view tile model and uses bounded caller or module-owned storage.

Parameters
[in,out]presentationDescriptor-backed presentation workspace accessed by the operation.
[in]sourceSource input used by the operation.
[in]source_xSource x input used by the operation.
[in]source_ySource y input used by the operation.
[in]widthWidth of the affected region in pixels.
[in]heightHeight of the affected region in pixels.
Returns
The emu view tile write result produced by the emu view tile model.
Return values
trueThe emu view tile write condition holds or completed successfully; false otherwise.
Precondition
Arguments satisfy the ranges documented for emu view tile write.
The call executes on the emulator's single owning thread.
Postcondition
State changes remain confined to the emu view tile model and documented output objects.
Ownership of caller-supplied storage is unchanged.
Note
The operation is synchronous and does not transfer heap ownership.
Since
0.1.0

Definition at line 154 of file emu_view_tile.c.

References internal_rotate_tile(), internal_tile_destination(), internal_write_rows(), k_emu_presentation_tile_px, emu_presentation_workspace_t::panel_height, emu_presentation_workspace_t::panel_width, emu_presentation_workspace_t::rotate_deg, emu_presentation_workspace_t::scratch, and tile_destination_t::width.

Referenced by internal_write_layer().