-
-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededtriagewait for a maintainer to approve and assign this ticketwait for a maintainer to approve and assign this ticket
Description
Title: Implement zero-copy conversion for NumPy arrays to Image
Description
The impl_pyarray_to_image macro currently performs a deep copy when converting Python NumPy arrays to Rust Image structs:
// TODO: we should find a way to avoid copying the data
let data = match pyarray.to_vec() { ... }Calling to_vec() allocates new memory on the Rust heap and copies the entire image buffer. For high-resolution images or video streams, this introduces significant latency and doubles memory usage.
The goal is to resolve the TODO by implementing a mechanism (such as a custom Storage or Allocator backend) that allows the Rust Image struct to reference the existing Python memory buffer directly without taking ownership or performing a copy.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededtriagewait for a maintainer to approve and assign this ticketwait for a maintainer to approve and assign this ticket