Commit Graph

35 Commits

Author SHA1 Message Date
Andrew Leech
5e9bc80a2e lib/imlib: Replace FatFS calls with VFS abstraction.
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
2025-10-14 12:16:16 +11:00
iabdalkader
f8e110ca91 misc: Format code.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-28 19:45:07 +02:00
iabdalkader
552f4ada8e lib/imlib: Fix raw stream buffer size check.
Check frame dimensions as well as total image size
top scale the image if needed.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-21 16:41:34 +02:00
iabdalkader
1308129fdb lib/imlib: Enable raw streaming control at runtime.
Not for use with USBDBG.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-11 21:43:16 +02:00
iabdalkader
22981bdb61 lib/imlib: Add an embedded frame header in the streaming buffer.
Embed framebuffer header before frame data in streaming protocol to
enable protocol channels to read header+data from contiguous memory
with zero-copy operations. Header contains width, height, pixformat
and compressed size.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-11 18:09:24 +02:00
iabdalkader
f177d221e9 lib/imlib: Remove test loop.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-02 18:54:38 +02:00
iabdalkader
d05d5f1d3c lib/imlib: Use framebuffer_t for main and streaming buffers.
Removes separate jpegbuffer_t and consolidates streaming/preview
functionality into the main framebuffer_t structure.

Main changes:
- Remove jpegbuffer_t structure and global jpegbuffer variable
- Add streaming fields (enabled, quality, lock, raw_w, raw_h) to framebuffer_t
- Replace framebuffer_update_jpeg_buffer() with framebuffer_update_preview()

API improvements:
- Rename framebuffer_init_image() -> framebuffer_to_image()
- Rename framebuffer_init_from_image() -> framebuffer_from_image()
- Add framebuffer_set_enabled() and framebuffer_set_preview() utilities
- Remove accessor macros, use direct field access (kept framebuffer_get_buffer_size)
- Update framebuffer_init() to accept enabled parameter
- Add configurable raw preview dimensions per framebuffer

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-02 15:52:17 +02:00
iabdalkader
4c2c59d0e5 lib/imlib: Remove old framebuffer macros.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-09-02 13:41:30 +02:00
iabdalkader
e5cdccc72e common: Introduce profiling support.
This adds a simple code profiler that leverages both SysTick and
the Performance Monitoring Unit (PMU) available on Armv8.1-M cores.
SysTick provides a simple high-resolution timer source, while the PMU
offers a cycle counter and multiple configurable event counters that
can track low-level performance metrics such as cache misses, pipeline
stalls, etc... See the Armv8.1-M Performance Monitoring User Guide
for additional details.

Function-level instrumentation is enabled using -finstrument-functions
on select files to automatically record statistics on entry/exit.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-24 16:57:06 +02:00
iabdalkader
cf7b84d682 ports/all: Remove old profiling macros.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-24 14:40:02 +02:00
Ibrahim Abdelkader
72d09d8f61
Merge pull request #2747 from kwagyeman/kwabena/genx320_event_mode
Some checks failed
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Has been cancelled
🔥 Firmware Build / build-firmware (DOCKER) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV2) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_AE3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_N6) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Has been cancelled
🔥 Firmware Build / code-size-report (push) Has been cancelled
🔥 Firmware Build / stable-release (push) Has been cancelled
🔥 Firmware Build / development-release (push) Has been cancelled
drivers/sensors: Add RAW event output mode for the genx320.
2025-08-09 21:14:40 +03:00
Kwabena W. Agyeman
051396b4b8 modules/py_image: Add event histogram drawing method. 2025-08-09 09:32:10 -07:00
Kwabena W. Agyeman
af9679c3a0 lib/imlib: Add event camera imlib data structure. 2025-08-09 09:32:10 -07:00
Kwabena W. Agyeman
dabdd6994a lib/imlib: Add f32 conversion ops. 2025-08-07 15:40:48 -07:00
Kwabena W. Agyeman
0e9e936553 lib/imlib: Add rgb565 to rgb888 simd conversion. 2025-08-05 11:05:38 -07:00
Kwabena W. Agyeman
1b2c38fa6d lib/imlib: Add s8/s16 scatter/gather ops. 2025-08-05 10:48:52 -07:00
Kwabena W. Agyeman
374d1a8de2 lib/imlib: Add simd constant add/sub.
Broadcast a constant to add across all values.
2025-08-05 10:40:55 -07:00
Kwabena W. Agyeman
d786099bb4 lib/imlib: Fix simd intrinsics compile issue.
These lines cause compile time errors when using simd.h in more
files.
2025-08-05 10:38:16 -07:00
Kwabena W. Agyeman
47c5618231 lib/imlib: Add transform argument to draw_image. 2025-07-31 13:13:45 -07:00
Kwabena W. Agyeman
20839405a2 lib/imlib: Add transform support to GPU drivers. 2025-07-31 13:12:48 -07:00
Kwabena W. Agyeman
680bd322ce lib/imlib: Fix draw line glitch. 2025-07-28 19:40:35 -07:00
iabdalkader
0458db2130 misc: Use updated mutex API.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-25 20:20:57 +02:00
iabdalkader
5d1f8860b1 imlib: Rework framebuffer management.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-23 18:24:52 +02:00
iabdalkader
8df82bdc00 lib: Use common alignment macros.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-16 11:18:56 +02:00
Kwabena W. Agyeman
e6dff41517 lib/imlib: Remove old fallback image transfer code. 2025-07-07 20:39:29 -07:00
Kwabena W. Agyeman
e14bbe586d lib/imlib: Fix update_jpeg_buffer to update from the passed image.
framebuffer_update_jpeg_buffer was previously bugged as it always
updated the jpeg buffer from the frame buffer versus the image
object it was attached to. e.g. img.flush() always flushed the
frame buffer and not the image object it was called on.
2025-07-07 20:39:29 -07:00
Kwabena W. Agyeman
84c3db58a4 modules/py_omv: Remove disable fb from omv module. 2025-07-07 20:39:29 -07:00
Kwabena W. Agyeman
a63c8ba8d6 lib/imlib: Remove unused functions. 2025-06-27 19:16:29 -07:00
iabdalkader
4ded9fba91 common: Remove xalloc.
Originally meant to abstract gc_collect but we could just use
m_alloc and friends. Also was meant to provide functions like
alloc0, alloc_maybe etc.. which are all available in MP anyway.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-27 14:50:16 +02:00
iabdalkader
c7d84b8ca5 lib/imlib: Add deep copy flag to image_copy.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-25 21:16:00 +02:00
iabdalkader
2913d78182 imlib/framebuffer: Support dynamic frame buffers.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-24 20:19:25 +02:00
Kwabena W. Agyeman
8e543c2a96 lib/imlib: Refactor fill_image_from_lepton out of py_fir_lepton. 2025-06-23 14:49:37 -07:00
iabdalkader
c122c9dfc2 imlib: Refactor framebuffer API to accept a context.
Updated all framebuffer functions to take a framebuffer_t argument.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-26 10:41:58 +03:00
iabdalkader
4772ff2f27 misc: Refactor Makefiles.
Remove old Makefiles and replace with Makefile fragments.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-15 18:54:04 +02:00
iabdalkader
daf2bb30da misc: Restructure repo.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-04-13 08:28:34 +02:00