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

Aperta
#4,259 2 commenti 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@eric-frazier-dev ci sta già lavorando.

Dal 15/9/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp, numpy, python
Ambito
api

Direzione di ricerca

Non sono indicati file sorgente né test. Inizia individuando il binding Python di ImageBuf e il costruttore C++ esistente che avvolge i buffer ImageBuf, quindi traccia il modo in cui vengono gestiti gli input ndarray. Il lavoro è completato quando Python può avvolgere un array NumPy senza copiarlo né assumerne la proprietà, con una copertura della precisazione indicata su lifetime e shape.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

difficulty/easy feature request help wanted python

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.)

Lingua principale
C++
Stelle
2.4k
Fork
727
Merge medio
4g 8h
PR unite (30g)
67

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AcademySoftwareFoundation/OpenImageIO

Tutte le issue di AcademySoftwareFoundation/OpenImageIO

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.