Convert the rest of ImageBufAlgo to use KWArgs where helpful

未关闭
#4,160 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
停滞
技术栈
cpp

调研方向

从 PR #1449 中完成原型设计的 KWArgs 方法开始,检查 ImageBufAlgo 函数(包括 rotate()),以确定哪些参数是基本参数,哪些是可选参数。围绕提议的头文件 imagebufalgo_legacy.h 定义兼容性方案。当适用的 IBA 函数使用 KWArgs,同时仍可通过 legacy 头文件提供已弃用的源代码兼容性时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

core APIs image processing roadmap

#1449 prototypes a new approach to handling the shifting sets of optional parameters to ImageBufAlgo functions. Assuming we like this, we should look for other IBA functions that could use this conversion.

An important part of this is making the correct judgment call about which parameters to an IBA function are fundamental, and should therefore be explicit and required, versus which are optional, special purpose, or can almost always be adequately covered by a default. For example, for rotate(), the angle to rotate is required and should be explicit, but the parameters controlling the reconstruction filter are for most uses and most users find to be defaulted, and so those should be passed among the keyword options.

Because this will be a hard incompatibility at the source level, I recommend that rather than deleting them outright, we put the old (now deprecated) functions in an optional header imagebufalgo_legacy.h. There, they can be defined as inline functions that call the new KWArgs versions. This way, if not convenient at this time for a user to change all of their use of IBA, they can just add a #include <OpenImageIO/imagebufalgo_legacy.h> and get the old definitions. For now. We will eventually remove it for real. By being inline, removing them later will not create a future ABI break.

主要语言
C++
星标
2.4k
派生
727
平均合并
4 天 8 小时
30 天内合并 PR
67

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AcademySoftwareFoundation/OpenImageIO 的其他 Issue

查看 AcademySoftwareFoundation/OpenImageIO 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。