Skip to content

[FEATURE REQUEST] ImageBuf "wrap" numpy array in python #4259

Open
@lgritz

Description

@lgritz

In C++, it is straightforward to construct an ImageBuf that "wraps" an existing buffer without owning the memory, where you just give it the pointer to the memory and the strides.

There's not currently an equivalent in python, but there should be! It's a great idea suggested by a question from João Vítor Silva on the slack channel. We could imagine a Python-side IB constructor that takes a numpy ndarray and knows it's just a reference to that data and not to do any copies or ownership. (With the caveat that you need to ensure that you don't change the shape or where the data lives in the numpy array, because the IB that wraps it would have no way of knowing.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty/easyHours-to-days for veterans, days for newcomers to the projectfeature requesthelp wantedA task that is desired, but needs somebody to commit the effort to implement it.pythonPython APIs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions