OpenImageIO
OpenImageIO copied to clipboard
api: deprecation cleanup in imageio.h
Track down and fix many places internal to OIIO where we were still using deprecated API calls.
Add deprecation warnings to some things that have been nominally deprecated, but weren't already tagged as such.
Guard deprecated things behind OIIO_DISABLE_DEPRECATED so that downstream projects can hide them to help them find and change any use of the deprecated calls, and behind !defined(OIIO_INTERNAL) so they are hidden from the rest of the internals of our code base.
Make some of the deprecated things inline, so that their final removal later doesn't constitute a link ABI compatibility change. (We do absorb an ABI compatibility boundary with this PR, so I've bumped the version number appropriately.) Move all the OIIO-namespace level deprecated items to the end of imageio.h so they're as out of the way as possible.
A lot of the things that are still present here, just guarded by the deprecation warnings, will be removed entirely before the final OIIO 3.0 release.
Please note some particular things in imageio that have been deprecated for a while and that we expect to disappear entirely by 3.0:
-
The old style
ImageInput::read_*functions that don't take explicit subimage and miplevel paramters, because they aren't thread-safe due to their implied statefulness. You are expected to use the ones that take those parameters and are stateless. -
The variety of seek_subimage that takes an
ImageSpec&to fill in. -
Some obsolete varieties of ImageInput and ImageOutput create() static methods.
-
The
destroymethods that are no longer needed (plain olddeleteis fine). -
The various error-setting functions that use the old printf-like formatting conventions. Use
errorfmt()and friends that use the std::format conventions.