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

オープン
#4,259 コメント 2 件 リアクション 2 件 担当者 0 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@eric-frazier-dev がすでに取り組んでいます。

2026年9月15日 から。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
cpp, numpy, python
領域
api

調査の方向性

ソースファイルやテストは指定されていません。まず Python の ImageBuf binding と、既存の C++ の ImageBuf バッファをラップするコンストラクタを見つけ、次に ndarray 入力がどのように処理されるかを追跡します。完了条件は、Python から NumPy 配列をコピーも所有権の取得もせずにラップでき、明記された lifetime と shape に関する注意点をカバーできることです。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
C++
スター
2.4k
フォーク
727
平均マージ
4日 8時間
マージ済み PR(30日)
67

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

AcademySoftwareFoundation/OpenImageIO のほかの issue

AcademySoftwareFoundation/OpenImageIO の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。