Skip to content

Commit

Permalink
api: Remove deprecations
Browse files Browse the repository at this point in the history
These are all things long marked as deprecated (often since before the
official launch of 2.0) tht we've waited for 3.0 to finally
remove. Now is the time.

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed Oct 12, 2024
1 parent 5b962b6 commit e5c9781
Show file tree
Hide file tree
Showing 31 changed files with 101 additions and 1,204 deletions.
1 change: 0 additions & 1 deletion .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
CMAKE_UNITY_BUILD=OFF
CODECOV=1
CTEST_TEST_TIMEOUT=1200
OIIO_CMAKE_FLAGS="-DOIIO_TEX_IMPLEMENT_VARYINGREF=OFF"

runs-on: ${{ matrix.os }}
container:
Expand Down
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,6 @@ set (TEX_BATCH_SIZE "" CACHE STRING "Force TextureSystem SIMD batch size (e.g. 1
if (TEX_BATCH_SIZE)
add_compile_definitions (OIIO_TEXTURE_SIMD_BATCH_WIDTH=${TEX_BATCH_SIZE})
endif ()
option (OIIO_TEX_IMPLEMENT_VARYINGREF "Implement the deprecated batch texture functions taking VaryingRef params" ON)
if (NOT OIIO_TEX_IMPLEMENT_VARYINGREF)
add_compile_definitions (OIIO_TEX_NO_IMPLEMENT_VARYINGREF=1)
endif ()

# Set the default namespace
set (${PROJ_NAME}_NAMESPACE ${PROJECT_NAME} CACHE STRING
Expand Down
46 changes: 44 additions & 2 deletions docs/Deprecations-3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ about being deprecated will be removed in the final 3.0 release.
* The versions of `createDisplayTransform()` that lack an `inverse` parameter
now have deprecation warnings. Use the version that takes an `inverse` bool.

## dassert.h

* Poorly named `ASSERT`, `DASSERT`, and `ASSERTMSG` macros have been removed.
They were deprecated since 2.1, since they could easily clash with macros
from other projects. Please instead use the `OIIO_ASSERT`, `OIIO_DASSERT`,
and `OIIO_ASSERT_MSG` macros.

## errorhandler.h

* All of the old methods that did printf-style formatting have been deprecated
Expand Down Expand Up @@ -93,6 +100,16 @@ about being deprecated will be removed in the final 3.0 release.
against it. (However, the IBA functions involving OpenCV still exist and are
defined in `imagebufalgo_opencv.h` as inline functions, so it is up to the
application calling these API functions to find and link against OpenCV.)
* The old varieties of ImageInput::read_scanlines, read_tiles, and read_image
that did not take `subimage` and `miplevel` parameters, and were not
thread-safe, have been removed. These have been marked as deprecated since
OIIO 2.0.
* The type aliases ImageIOParameter and ImageIOParameterList, which have been
marked as deprecated since OIIO 2.0, have been removed. Use ParamValue and
ParamValueList instead.
* The utility functions convert_image and parallel_convert_image (the variety
that took alpha_channel and z_channel arguments) that have been deprecated
since OIIO 2.0 have been removed.

## imagebuf.h

Expand Down Expand Up @@ -172,6 +189,17 @@ about being deprecated will be removed in the final 3.0 release.
`OIIO_MAYBE_UNUSED` as deprecated as well, now that C++17 is the minimum,
there's no reason not to directly use the C++ attribute `[[maybe_unused]]`.

## simd.h

* The old (OIIO 1.x) type names float3, float4, float8, int4, int8, mask4,
bool4, bool8 have been removed. Use the new vbool4, vint4, vfloat4, etc.
* The old rotl32 functions have been removed. They had been deprecated since
OIIO 2.1. Please use `rotl()` intead.
* The old floori functions have been removed. They had been deprecated since
OIIO 1.8. Please use ifloor() instead.
* The old OIIO_SIMD_HAS_FLOAT8 macro has been removed. It was deprecated since
OIIO 1.8.

## strutil.h

* Added deprecation warnings to all the old (printf-convention) string
Expand Down Expand Up @@ -211,7 +239,7 @@ about being deprecated will be removed in the final 3.0 release.
## ustring.h

* Removed old `ustringHash` (which was just an alias for `std::hash<ustring>`,
which should be used instead.
which should be used instead).

## varyingref.h

Expand All @@ -225,4 +253,18 @@ about being deprecated will be removed in the final 3.0 release.
Python bindings. Python scripts that wish to capture images from live
cameras should use OpenCV or other capture APIs of choice and then
pass the results to OIIO to construct an ImageBuf.

* Static type names within the `TypeDesc` class (such as `TypeDesc.TypeFloat`)
have been removed after being considered deprecated since OIIO 1.8. Use the
names in the overall OpenImageIO namespace instead.
* Older versions of `ImageBufAlgo.fit()` have been removed. Use the newer
function signatures.
* Older versions of `ImageInput::read_native_deep_scanlines()` and
`read_native_deep_tiles()` have been removed. They had been deprecated
since OIIO 2.0.

## maketx

* The `--noresize` option has been removed. It was deprecated since OIIO 2.0,
when it became the default behavior.
* The `--stats` option has been removed. It was deprecated since OIIO 1.6,
when it was renamed `--runstats`.
7 changes: 6 additions & 1 deletion src/include/OpenImageIO/argparse.h
Original file line number Diff line number Diff line change
Expand Up @@ -760,20 +760,25 @@ class OIIO_UTIL_API ArgParse {
// The format string is followed by a list of pointers to the argument
// variables, just like scanf. A NULL terminates the list. Multiple
// calls to options() will append additional options.
OIIO_DEPRECATED_EXTERNAL("(2.2)")
int options(const char* intro, ...);

// old name
// DEPRECATED(2.2)
OIIO_DEPRECATED_EXTERNAL("(2.2)")
int parse(int argc, const char** argv) { return parse_args(argc, argv); }

// Type for a callback that writes something to the output stream.
OIIO_DEPRECATED_EXTERNAL("(2.2)")
typedef std::function<void(const ArgParse& ap, std::ostream&)> callback_t;
// Set callbacks to run that will print any matter you want as part
// of the verbose usage, before and after the options are detailed.
OIIO_DEPRECATED_EXTERNAL("(2.2)")
void set_preoption_help(callback_t callback);
OIIO_DEPRECATED_EXTERNAL("(2.2)")
void set_postoption_help(callback_t callback);

// DEPRECATED(2.2) synonym for `print_help()`.
OIIO_DEPRECATED_EXTERNAL("(2.2)")
void usage() const { print_help(); }
};

Expand Down
58 changes: 0 additions & 58 deletions src/include/OpenImageIO/dassert.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,64 +60,6 @@
#endif


/// ASSERT and ASSERT_MSG (and, ugh, ASSERTMSG) are deprecated assertion
/// macros. They are deprecated for two reasons: (1) terrible names pollute
/// the global namespace and might conflict with other packages; and (2)
/// the fully unconditional nature of aborting even for release builds is
/// unkind to applications. Consider these all to be deprecated and avoid
/// using these macros.
///
/// DASSERT and DASSERT_MSG also are considered deprecated for the namespace
/// reasons.
#ifndef ASSERT
# define ASSERT(x) \
(OIIO_LIKELY(x) \
? ((void)0) \
: (std::fprintf(stderr, "%s:%u: %s: Assertion '%s' failed.\n", \
__FILE__, __LINE__, OIIO_PRETTY_FUNCTION, #x), \
abort()))
#endif

#ifndef ASSERT_MSG
# define ASSERT_MSG(x, msg, ...) \
(OIIO_LIKELY(x) \
? ((void)0) \
: (std::fprintf(stderr, \
"%s:%u: %s: Assertion '%s' failed: " msg "\n", \
__FILE__, __LINE__, OIIO_PRETTY_FUNCTION, #x, \
__VA_ARGS__), \
abort()))
#endif

#ifndef ASSERTMSG
# define ASSERTMSG ASSERT_MSG
#endif


/// DASSERT(condition) is just an alias for the usual assert() macro.
/// It does nothing when in a non-DEBUG (optimized, shipping) build.
#ifndef NDEBUG
# define DASSERT(x) assert(x)
#else
/* DASSERT does nothing when not debugging; sizeof trick prevents warnings */
# define DASSERT(x) ((void)sizeof(x)) /*NOLINT*/
#endif

/// DASSERT_MSG(condition,msg,...) is just like ASSERT_MSG, except that it
/// only is functional in DEBUG mode, but does nothing when in a
/// non-DEBUG (optimized, shipping) build.
#ifndef NDEBUG
# define DASSERT_MSG ASSERT_MSG
#else
/* does nothing when not debugging */
# define DASSERT_MSG(x, ...) ((void)sizeof(x)) /*NOLINT*/
#endif

#ifndef DASSERTMSG
# define DASSERTMSG DASSERT_MSG
#endif


/// Define OIIO_STATIC_ASSERT(cond) as a wrapper around static_assert(cond),
/// with appropriate fallbacks for older C++ standards.
#if (__cplusplus >= 201700L) /* FIXME - guess the token, fix when C++17 */
Expand Down
Loading

0 comments on commit e5c9781

Please sign in to comment.