|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Bounded raw-fd RGB565 to CoreGraphics byte-range expansion. More...
#include <string.h>#include <sys/stat.h>#include "board_view.h"#include "emu_host_io_internal.h"#include "ra8_attributes.h"Go to the source code of this file.
Enumerations | |
| enum | view_pixel_geometry_t : size_t { k_view_pixel_chunk = 128U , k_rgb565_red_shift = 11U , k_rgb565_green_shift = 5U , k_rgb565_five_bit_max = 0x1FU , k_rgb565_six_bit_max = 0x3FU } |
| Bounded conversion chunk and RGB565 channel geometry. More... | |
Functions | |
| static size_t | internal_available_bytes (int fd, off_t position, size_t count) |
| Clamp one provider request to the bytes the surface can still supply. | |
| static void | internal_expand_chunk (const uint16_t *rgb565, uint32_t *rgb888, size_t pixel_count) |
| Expand one bounded RGB565 chunk into packed 32-bit RGB888 words. | |
| size_t | board_view_read_rgb888_fd (int fd, off_t position, void *buffer, size_t count) |
| Expand an arbitrary byte range from a sealed RGB565 descriptor. | |
Bounded raw-fd RGB565 to CoreGraphics byte-range expansion.
Converts arbitrary provider byte ranges from the sealed RGB565 surface descriptor into RGB888 using a fixed-size stack chunk, including unaligned range boundaries and checked positional reads.
Definition in file board_view_pixels.c.
| enum view_pixel_geometry_t : size_t |
Bounded conversion chunk and RGB565 channel geometry.
Definition at line 21 of file board_view_pixels.c.
| size_t board_view_read_rgb888_fd | ( | int | fd, |
| off_t | position, | ||
| void * | buffer, | ||
| size_t | count ) |
Expand an arbitrary byte range from a sealed RGB565 descriptor.
| [in] | fd | Immutable RGB565 surface descriptor. |
| [in] | position | Byte position in the virtual 0x00RRGGBB stream. |
| [out] | buffer | CoreGraphics-supplied destination bytes. |
| [in] | count | Requested destination byte count. |
fd remains open and immutable for the call. Expand an arbitrary byte range from a sealed rgb565 descriptor; this step is contained within the board view model and uses bounded caller or module-owned storage.
| value | The operation-specific board view read rgb888 descriptor value. |
Definition at line 87 of file board_view_pixels.c.
References internal_available_bytes(), internal_expand_chunk(), k_emu_io_ok, k_view_pixel_chunk, memcpy(), and priv_emu_io_pread_exact().
|
static |
Clamp one provider request to the bytes the surface can still supply.
Measures the sealed RGB565 descriptor, derives the virtual RGB888 stream length from it, and clamps count to what remains after position.
| [in] | fd | Sealed RGB565 surface descriptor. |
| [in] | position | Provider byte offset into the virtual RGB888 stream. |
| [in] | count | Bytes the caller is willing to receive. |
position, never more than count. | 0 | The descriptor is unusable, or position is at or past the end. |
fd is open and position is non-negative. count is the exact caller buffer capacity. count. fd. Definition at line 44 of file board_view_pixels.c.
References RA8_INTERNAL.
Referenced by board_view_read_rgb888_fd().
|
static |
Expand one bounded RGB565 chunk into packed 32-bit RGB888 words.
Replicates the high channel bits into the low ones so a full-scale RGB565 value expands to a full-scale RGB888 value.
| [in] | rgb565 | Source chunk holding pixel_count RGB565 pixels. |
| [out] | rgb888 | Destination chunk receiving pixel_count packed words. |
| [in] | pixel_count | Pixels to convert, at most k_view_pixel_chunk. |
pixel_count elements. pixel_count words of rgb888 are initialized. rgb565 is unchanged. Definition at line 73 of file board_view_pixels.c.
References k_rgb565_five_bit_max, k_rgb565_green_shift, k_rgb565_red_shift, and k_rgb565_six_bit_max.
Referenced by board_view_read_rgb888_fd().