AcademySoftwareFoundation / AcademySoftwareFoundation/OpenColorIO

Const correctness of PackedImageDesc

オープン
#2,114 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
2.1k
フォーク
503
PR マージ指標
30日以内にマージされた PR はありません

説明

In our use case, we are passing const void pointers to build a source `PackedImageDesc` for use in `CPUProcessor::apply`. However, `PackedImageDesc` requires a non-const pointer. I assume this is so that users with non-const data can call `getData` and modify the result. This makes it dangerous to const_cast our pointer as a caller could then end up inadvertently modifying a const buffer through those calls.

Perhaps there should be a `ConstPackedImageDesc`? Or is the design to keep the scope of `PackedImageDesc` tightly around the `apply` call so that it's unlikely that users can access the `getData` functions?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず、CPUProcessor::apply を通じて PackedImageDesc を追跡し、issue で言及されている getData 関数を確認します。意図された const-correctness の挙動と、別の ConstPackedImageDesc が適切か、または apply のみに限定したより狭いスコープが適切かを判断します;完了とは、API の方向性について合意され、仕様化されていることを意味します。

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

評価

技術スタック
cpp
領域
backend-api-design
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

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

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