Skip to content

Convert the rest of ImageBufAlgo to use KWArgs where helpful #4160

Open
@lgritz

Description

@lgritz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    core APIsAffecting public APIs of core functionality classes, such as ImageInput, ImageOutput, ImageBuf.image processingRelated to ImageBufAlgo or other image processing topic.roadmapThis is a priority item on the roadmap for the next major release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions