AcademySoftwareFoundation / AcademySoftwareFoundation/OpenImageIO

Convert the rest of ImageBufAlgo to use KWArgs where helpful

Open
#4,160 0 comments 0 reactions 0 assignees View on GitHub
core APIs image processing roadmap
Dominant language
C++
Stars
2.4k
Forks
698
Avg merge
3d 4h
Merged PRs (30d)
47

Description

[#1449](https://github.com/AcademySoftwareFoundation/OpenImageIO/pull/4149) 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 ` 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.

Contributor guide

Open the contributing guide

Research direction

Start with the KWArgs approach prototyped in PR #1449 and review the ImageBufAlgo functions, including rotate(), to identify which parameters are fundamental versus optional. Define the compatibility approach around the proposed imagebufalgo_legacy.h header. Done means suitable IBA functions use KWArgs while deprecated source compatibility remains available through the legacy header.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.