From e5c9781ade685ab8f47f48be054c9bb53b68d1a7 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sun, 6 Oct 2024 16:11:21 -0700 Subject: [PATCH] api: Remove deprecations 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 --- .github/workflows/analysis.yml | 1 - CMakeLists.txt | 4 - docs/Deprecations-3.0.md | 46 ++- src/include/OpenImageIO/argparse.h | 7 +- src/include/OpenImageIO/dassert.h | 58 ---- src/include/OpenImageIO/imagebufalgo.h | 199 +------------ src/include/OpenImageIO/imagecache.h | 14 +- src/include/OpenImageIO/imageio.h | 113 +------- src/include/OpenImageIO/platform.h | 8 + src/include/OpenImageIO/simd.h | 50 ---- src/include/OpenImageIO/string_view.h | 5 - src/include/OpenImageIO/texture.h | 4 +- src/include/OpenImageIO/ustring.h | 10 - src/libOpenImageIO/imageinput.cpp | 74 ----- src/libtexture/texturesys.cpp | 2 +- src/libutil/strutil.cpp | 11 - src/maketx/maketx.cpp | 4 - src/oiiotool/printinfo.cpp | 2 +- src/psd.imageio/psdinput.cpp | 4 +- src/python/py_imagebufalgo.cpp | 39 --- src/python/py_imageinput.cpp | 23 -- src/python/py_typedesc.cpp | 30 +- src/targa.imageio/targaoutput.cpp | 17 -- testsuite/oiiotool-deep/run.py | 2 +- testsuite/python-deep/src/test_deep.py | 12 +- .../python-imagebuf/src/test_imagebuf.py | 2 +- .../ref/out-python2-alt.txt | 224 --------------- .../python-imagespec/src/test_imagespec.py | 12 +- testsuite/python-typedesc/ref/out-python2.txt | 264 ------------------ testsuite/python-typedesc/ref/out.txt | 41 --- .../python-typedesc/src/test_typedesc.py | 23 -- 31 files changed, 101 insertions(+), 1204 deletions(-) delete mode 100644 testsuite/python-imagebufalgo/ref/out-python2-alt.txt delete mode 100644 testsuite/python-typedesc/ref/out-python2.txt diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml index 2ecbfaef8c..8184bbd689 100644 --- a/.github/workflows/analysis.yml +++ b/.github/workflows/analysis.yml @@ -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: diff --git a/CMakeLists.txt b/CMakeLists.txt index 2cf4872a25..3224657673 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/docs/Deprecations-3.0.md b/docs/Deprecations-3.0.md index 8253519f16..4822096fb4 100644 --- a/docs/Deprecations-3.0.md +++ b/docs/Deprecations-3.0.md @@ -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 @@ -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 @@ -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 @@ -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`, - which should be used instead. + which should be used instead). ## varyingref.h @@ -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`. diff --git a/src/include/OpenImageIO/argparse.h b/src/include/OpenImageIO/argparse.h index 1ed924f832..47afc3e5c8 100644 --- a/src/include/OpenImageIO/argparse.h +++ b/src/include/OpenImageIO/argparse.h @@ -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 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(); } }; diff --git a/src/include/OpenImageIO/dassert.h b/src/include/OpenImageIO/dassert.h index d7b7cd028b..db7cf65976 100644 --- a/src/include/OpenImageIO/dassert.h +++ b/src/include/OpenImageIO/dassert.h @@ -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 */ diff --git a/src/include/OpenImageIO/imagebufalgo.h b/src/include/OpenImageIO/imagebufalgo.h index ac99c08fb3..685ea7946d 100644 --- a/src/include/OpenImageIO/imagebufalgo.h +++ b/src/include/OpenImageIO/imagebufalgo.h @@ -2481,164 +2481,6 @@ bool OIIO_API deep_holdout (ImageBuf &dst, const ImageBuf &src, #ifndef DOXYGEN_SHOULD_SKIP_THIS -// DEPRECATED(1.9): These are all functions that take raw pointers, -// which we are deprecating as of 1.9, replaced by new versions that -// take span<> for length safety. - -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool fill (ImageBuf &dst, const float *values, - ROI roi={}, int nthreads=0) { - int nc (roi.defined() ? roi.nchannels() : dst.nchannels()); - return fill (dst, {values, span_size_t(nc)}, roi, nthreads); -} -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool fill (ImageBuf &dst, const float *top, const float *bottom, - ROI roi={}, int nthreads=0) { - int nc (roi.defined() ? roi.nchannels() : dst.nchannels()); - return fill (dst, {top, span_size_t(nc)}, {bottom, span_size_t(nc)}, roi, nthreads); -} -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool fill (ImageBuf &dst, const float *topleft, const float *topright, - const float *bottomleft, const float *bottomright, - ROI roi={}, int nthreads=0) { - int nc (roi.defined() ? roi.nchannels() : dst.nchannels()); - return fill (dst, {topleft, span_size_t(nc)}, {topright, span_size_t(nc)}, {bottomleft, span_size_t(nc)}, - {bottomright, span_size_t(nc)}, roi, nthreads); -} - -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool checker (ImageBuf &dst, int width, int height, int depth, - const float *color1, const float *color2, - int xoffset=0, int yoffset=0, int zoffset=0, - ROI roi={}, int nthreads=0) { - int nc (roi.defined() ? roi.nchannels() : dst.nchannels()); - return checker (dst, width, height, depth, - {color1,span_size_t(nc)}, {color2,span_size_t(nc)}, - xoffset, yoffset, zoffset, roi, nthreads); -} - -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool add (ImageBuf &dst, const ImageBuf &A, const float *B, - ROI roi={}, int nthreads=0) { - return add (dst, A, {B,A.nchannels()}, roi, nthreads); -} -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool sub (ImageBuf &dst, const ImageBuf &A, const float *B, - ROI roi={}, int nthreads=0) { - return sub (dst, A, {B,A.nchannels()}, roi, nthreads); -} -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool absdiff (ImageBuf &dst, const ImageBuf &A, const float *B, - ROI roi={}, int nthreads=0) { - return absdiff (dst, A, cspan(B,span_size_t(A.nchannels())), roi, nthreads); -} -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool mul (ImageBuf &dst, const ImageBuf &A, const float *B, - ROI roi={}, int nthreads=0) { - return mul (dst, A, {B, int(A.nchannels())}, roi, nthreads); -} -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool div (ImageBuf &dst, const ImageBuf &A, const float *B, - ROI roi={}, int nthreads=0) { - return div (dst, A, {B, int(A.nchannels())}, roi, nthreads); -} -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool mad (ImageBuf &dst, const ImageBuf &A, const float *B, - const ImageBuf &C, ROI roi={}, int nthreads=0) { - return mad (dst, A, {B, int(A.nchannels())}, C, roi, nthreads); -} -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool mad (ImageBuf &dst, const ImageBuf &A, const ImageBuf &B, - const float *C, ROI roi={}, int nthreads=0) { - return mad (dst, A, {C, int(A.nchannels())}, B, roi, nthreads); -} -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool mad (ImageBuf &dst, const ImageBuf &A, const float *B, - const float *C, ROI roi={}, int nthreads=0) { - return mad (dst, A, {B, int(A.nchannels())}, {C, int(A.nchannels())}, roi, nthreads); -} - -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool pow (ImageBuf &dst, const ImageBuf &A, const float *B, - ROI roi={}, int nthreads=0) { - return pow (dst, A, {B, span_size_t(A.nchannels())}, roi, nthreads); -} - -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool channel_sum (ImageBuf &dst, const ImageBuf &src, - const float *weights=nullptr, ROI roi={}, - int nthreads=0) { - return channel_sum (dst, src, {weights, span_size_t(src.nchannels())}, - roi, nthreads); -} - -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool channels (ImageBuf &dst, const ImageBuf &src, - int nchannels, const int *channelorder, - const float *channelvalues=nullptr, - const std::string *newchannelnames=nullptr, - bool shuffle_channel_names=false, int nthreads=0) { - return channels (dst, src, nchannels, - { channelorder, span_size_t(channelorder?nchannels:0) }, - { channelvalues, span_size_t(channelvalues?nchannels:0) }, - { newchannelnames, span_size_t(newchannelnames?nchannels:0) }, - shuffle_channel_names, nthreads); -} - -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool clamp (ImageBuf &dst, const ImageBuf &src, - const float *min=nullptr, const float *max=nullptr, - bool clampalpha01 = false, - ROI roi={}, int nthreads=0) { - return clamp (dst, src, { min, span_size_t(min ? src.nchannels() : 0) }, - { max, span_size_t(max ? src.nchannels() : 0) }, clampalpha01, - roi, nthreads); -} - -OIIO_DEPRECATED("use version that takes span<> instead of raw pointer (2.0)") -inline bool isConstantColor (const ImageBuf &src, float *color, - ROI roi={}, int nthreads=0) { - int nc = roi.defined() ? std::min(roi.chend,src.nchannels()) : src.nchannels(); - return isConstantColor (src, 0.0f, {color, span_size_t(color ? nc : 0) }, - roi, nthreads); -} - -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool color_count (const ImageBuf &src, imagesize_t *count, - int ncolors, const float *color, - const float *eps=nullptr, - ROI roi={}, int nthreads=0) { - return color_count (src, count, ncolors, - { color, span_size_t(ncolors*src.nchannels()) }, - eps ? cspan(eps,span_size_t(src.nchannels())) : cspan(), - roi, nthreads); -} - -OIIO_DEPRECATED("use version that takes span<> instead of raw pointer (2.0)") -inline bool color_range_check (const ImageBuf &src, imagesize_t *lowcount, - imagesize_t *highcount, imagesize_t *inrangecount, - const float *low, const float *high, - ROI roi={}, int nthreads=0) { - return color_range_check (src, lowcount, highcount, inrangecount, - {low,span_size_t(src.nchannels())}, {high,span_size_t(src.nchannels())}, - roi, nthreads); -} - -OIIO_DEPRECATED("use version that takes cspan<> instead of raw pointer (2.0)") -inline bool render_text (ImageBuf &dst, int x, int y, string_view text, - int fontsize, string_view fontname, - const float *textcolor) { - return render_text (dst, x, y, text, fontsize, fontname, - {textcolor, textcolor?span_size_t(dst.nchannels()):0}); -} - -OIIO_DEPRECATED("Use the that takes a span. [2.1]") -inline bool colorconvert (float *color, int nchannels, - const ColorProcessor *processor, bool unpremult) { - return colorconvert ({color,span_size_t(nchannels)}, processor, unpremult); -} - - OIIO_DEPRECATED("prefer the kind that takes an `inverse` parameter (2.5)") inline ImageBuf ociodisplay (const ImageBuf &src, string_view display, string_view view, @@ -2686,7 +2528,7 @@ bool OIIO_API warp (ImageBuf &dst, const ImageBuf &src, M33fParam M, const Filter2D *filter, bool recompute_roi = false, ImageBuf::WrapMode wrap = ImageBuf::WrapDefault, ROI roi = {}, int nthreads=0); -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.6)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline ImageBuf resize(const ImageBuf &src, string_view filtername, float filterwidth=0.0f, ROI roi={}, int nthreads=0) { @@ -2694,12 +2536,12 @@ inline ImageBuf resize(const ImageBuf &src, { "filterwidth", filterwidth } }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.6)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline ImageBuf resize(const ImageBuf &src, Filter2D *filter, ROI roi={}, int nthreads=0) { return resize(src, { make_pv("filterptr", filter) }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.6)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline bool resize (ImageBuf &dst, const ImageBuf &src, string_view filtername, float filterwidth, ROI roi={}, int nthreads=0) { @@ -2707,13 +2549,13 @@ inline bool resize (ImageBuf &dst, const ImageBuf &src, { "filterwidth", filterwidth } }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.6)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline bool resize(ImageBuf &dst, const ImageBuf &src, Filter2D *filter, ROI roi={}, int nthreads=0) { return resize(dst, src, { make_pv("filterptr", filter) }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.6)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline ImageBuf fit(const ImageBuf &src, string_view filtername = "", float filterwidth=0.0f, string_view fillmode="letterbox", bool exact=false, @@ -2723,7 +2565,7 @@ inline ImageBuf fit(const ImageBuf &src, { "fillmode", fillmode }, { "exact", int(exact) } }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.6)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline ImageBuf fit(const ImageBuf &src, Filter2D *filter, string_view fillmode="letterbox", bool exact=false, ROI roi={}, int nthreads=0) { @@ -2731,7 +2573,7 @@ inline ImageBuf fit(const ImageBuf &src, Filter2D *filter, { "exact", int(exact) } }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.6)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline bool fit(ImageBuf &dst, const ImageBuf &src, string_view filtername = "", float filterwidth=0.0f, string_view fillmode="letterbox", bool exact=false, @@ -2741,7 +2583,7 @@ inline bool fit(ImageBuf &dst, const ImageBuf &src, { "fillmode", fillmode }, { "exact", int(exact) } }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.6)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline bool fit(ImageBuf &dst, const ImageBuf &src, Filter2D *filter, string_view fillmode="letterbox", bool exact=false, ROI roi={}, int nthreads=0) { @@ -2751,7 +2593,7 @@ inline bool fit(ImageBuf &dst, const ImageBuf &src, Filter2D *filter, } // DEPRECATED(2.3): old versions lacking the "fillmode" parameter -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.6)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline ImageBuf fit(const ImageBuf &src, string_view filtername, float filterwidth, bool exact, ROI roi={}, int nthreads=0) @@ -2761,14 +2603,14 @@ inline ImageBuf fit(const ImageBuf &src, { "fillmode", "letterbox" }, { "exact", int(exact) } }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.3)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline ImageBuf fit(const ImageBuf &src, Filter2D *filter, bool exact, ROI roi={}, int nthreads=0) { return fit(src, { make_pv("filterptr", filter), { "fillmode", "letterbox" }, { "exact", int(exact) } }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.3)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline bool fit(ImageBuf &dst, const ImageBuf &src, string_view filtername, float filterwidth, bool exact, ROI roi={}, int nthreads=0) { @@ -2777,7 +2619,7 @@ inline bool fit(ImageBuf &dst, const ImageBuf &src, { "fillmode", "letterbox" }, { "exact", int(exact) } }, roi, nthreads); } -OIIO_DEPRECATED("prefer the kind that takes keyword args (2.3)") +OIIO_DEPRECATED("prefer the kind that takes keyword args (3.0)") inline bool fit(ImageBuf &dst, const ImageBuf &src, Filter2D *filter, bool exact, ROI roi={}, int nthreads=0) { return fit(dst, src, @@ -2786,23 +2628,6 @@ inline bool fit(ImageBuf &dst, const ImageBuf &src, Filter2D *filter, roi, nthreads); } -OIIO_DEPRECATED("Use isConstantColor with span color") -inline bool isConstantColor (const ImageBuf &src, span color, - ROI roi={}, int nthreads=0) { - return isConstantColor (src, 0.0f, color, roi, nthreads); -} - -OIIO_DEPRECATED("Use isConstantChannel with the threshold parameter") -inline bool isConstantChannel (const ImageBuf &src, int channel, float val, - ROI roi, int nthreads=0) { - return isConstantChannel (src, channel, val, 0.0f, roi, nthreads); -} - -OIIO_DEPRECATED("Use isMonochrome with the threshold dparameter") -inline bool isMonochrome (const ImageBuf &src, ROI roi, int nthreads=0) { - return isMonochrome (src, 0.0f, roi, nthreads); -} - #endif // DOXYGEN_SHOULD_SKIP_THIS /////////////////////////////////////////////////////////////////////// diff --git a/src/include/OpenImageIO/imagecache.h b/src/include/OpenImageIO/imagecache.h index a816a22116..fbe7f9bfbe 100644 --- a/src/include/OpenImageIO/imagecache.h +++ b/src/include/OpenImageIO/imagecache.h @@ -752,14 +752,15 @@ class OIIO_API ImageCache { bool get_imagespec(ImageHandle* file, Perthread* thread_info, ImageSpec& spec, int subimage = 0); - /// DEPRECATED old API. Note that the miplevel and native parameters are ignored: - /// it will always get the native spec of miplevel 0. We recommend switching to - /// the new API. + /// DEPRECATED(3.0) old API. Note that the miplevel and native parameters + /// are ignored: it will always get the native spec of miplevel 0. We + /// recommend switching to the new API. bool get_imagespec(ustring filename, ImageSpec& spec, int subimage, int miplevel, bool native = false) { return get_imagespec(filename, spec, subimage); } + /// DEPRECATED(3.0) old API. bool get_imagespec(ImageHandle* file, Perthread* thread_info, ImageSpec& spec, int subimage, int miplevel, bool native = false) @@ -801,14 +802,15 @@ class OIIO_API ImageCache { const ImageSpec* imagespec(ImageHandle* file, Perthread* thread_info, int subimage = 0); - /// DEPRECATED old API. Note that the miplevel and native parameters are ignored: - /// it will always get the native spec of miplevel 0. We recommend switching to - /// the new API. + /// DEPRECATED(3.0) old API. Note that the miplevel and native parameters + /// are ignored: it will always get the native spec of miplevel 0. We + /// recommend switching to the new API. const ImageSpec* imagespec(ustring filename, int subimage, int miplevel, bool native = false) { return imagespec(filename, subimage); } + /// DEPRECATED(3.0) old API. const ImageSpec* imagespec(ImageHandle* file, Perthread* thread_info, int subimage, int miplevel, bool native = false) { diff --git a/src/include/OpenImageIO/imageio.h b/src/include/OpenImageIO/imageio.h index dc0c823927..c06e46e4d8 100644 --- a/src/include/OpenImageIO/imageio.h +++ b/src/include/OpenImageIO/imageio.h @@ -1317,10 +1317,7 @@ class OIIO_API ImageInput { /// @returns `true` upon success, or `false` upon failure. /// /// @note This call was changed for OpenImageIO 2.0 to include the - /// explicit subimage and miplevel parameters. The previous - /// versions, which lacked subimage and miplevel parameters (thus - /// were dependent on a prior call to `seek_subimage`) are - /// considered deprecated. + /// explicit subimage and miplevel parameters. virtual bool read_scanlines (int subimage, int miplevel, int ybegin, int yend, int z, int chbegin, int chend, @@ -1328,33 +1325,6 @@ class OIIO_API ImageInput { stride_t xstride=AutoStride, stride_t ystride=AutoStride); -#if OIIO_DISABLE_DEPRECATED < OIIO_MAKE_VERSION(2,0,0) \ - && !defined(OIIO_DOXYGEN) && !defined(OIIO_INTERNAL) - // DEPRECATED versions of read_scanlines (pre-1.9 OIIO). These will - // eventually be removed. Try to replace these calls with ones to the - // new variety of read_scanlines that takes an explicit subimage and - // miplevel. These old versions are NOT THREAD-SAFE. - OIIO_DEPRECATED("replace with version that takes subimage & miplevel parameters (2.0)") - bool read_scanlines (int ybegin, int yend, int z, - TypeDesc format, void *data, - stride_t xstride=AutoStride, - stride_t ystride=AutoStride) { - lock_guard lock(*this); - return read_scanlines(current_subimage(), current_miplevel(), ybegin, yend, - z, 0, m_spec.nchannels, format, data, xstride, ystride); - } - OIIO_DEPRECATED("replace with version that takes subimage & miplevel parameters (2.0)") - bool read_scanlines (int ybegin, int yend, int z, - int chbegin, int chend, - TypeDesc format, void *data, - stride_t xstride=AutoStride, - stride_t ystride=AutoStride) { - lock_guard lock(*this); - return read_scanlines(current_subimage(), current_miplevel(), ybegin, yend, - z, chbegin, chend, format, data, xstride, ystride); - } -#endif - /// Read the tile whose upper-left origin is (x,y,z) into `data[]`, /// converting if necessary from the native data format of the file into /// the `format` specified. The stride values give the data spacing of @@ -1444,23 +1414,6 @@ class OIIO_API ImageInput { stride_t xstride=AutoStride, stride_t ystride=AutoStride, stride_t zstride=AutoStride); -#if OIIO_DISABLE_DEPRECATED < OIIO_MAKE_VERSION(2,0,0) && !defined(OIIO_DOXYGEN) - // DEPRECATED versions of read_tiles (pre-1.9 OIIO). These will - // eventually be removed. Try to replace these calls with ones to the - // new variety of read_tiles that takes an explicit subimage and - // miplevel. These old versions are NOT THREAD-SAFE. - OIIO_DEPRECATED("replace with version that takes subimage & miplevel parameters (2.0)") - bool read_tiles (int xbegin, int xend, int ybegin, int yend, - int zbegin, int zend, TypeDesc format, void *data, - stride_t xstride=AutoStride, stride_t ystride=AutoStride, - stride_t zstride=AutoStride); - OIIO_DEPRECATED("replace with version that takes subimage & miplevel parameters (2.0)") - bool read_tiles (int xbegin, int xend, int ybegin, int yend, - int zbegin, int zend, int chbegin, int chend, - TypeDesc format, void *data, stride_t xstride=AutoStride, - stride_t ystride=AutoStride, stride_t zstride=AutoStride); -#endif - /// Read the entire image of `spec.width x spec.height x spec.depth` /// pixels into a buffer with the given strides and in the desired /// data format. @@ -1505,33 +1458,6 @@ class OIIO_API ImageInput { ProgressCallback progress_callback=NULL, void *progress_callback_data=NULL); -#if !defined(OIIO_DOXYGEN) - // DEPRECATED versions of read_image (pre-1.9 OIIO). These will - // eventually be removed. Try to replace these calls with ones to the - // new variety of read_image that takes an explicit subimage and - // miplevel. These old versions are NOT THREAD-SAFE. - OIIO_DEPRECATED("replace with version that takes subimage & miplevel parameters (2.0)") - virtual bool read_image (TypeDesc format, void *data, - stride_t xstride=AutoStride, - stride_t ystride=AutoStride, - stride_t zstride=AutoStride, - ProgressCallback progress_callback=NULL, - void *progress_callback_data=NULL); - OIIO_DEPRECATED("replace with version that takes subimage & miplevel parameters (2.0)") - virtual bool read_image (int chbegin, int chend, - TypeDesc format, void *data, - stride_t xstride=AutoStride, - stride_t ystride=AutoStride, - stride_t zstride=AutoStride, - ProgressCallback progress_callback=NULL, - void *progress_callback_data=NULL); - OIIO_DEPRECATED("replace with version that takes subimage & miplevel parameters (2.0)") - bool read_image (float *data) { - return read_image (current_subimage(), current_miplevel(), - 0, -1, TypeFloat, data); - } -#endif - /// Read deep scanlines containing pixels (*,y,z), for all y in the /// range [ybegin,yend) into `deepdata`. This will fail if it is not a /// deep file. @@ -3470,43 +3396,6 @@ OIIO_API void _ImageIO_force_link (); // #if !defined(OIIO_INTERNAL) && !defined(OIIO_DOXYGEN) -#if OIIO_DISABLE_DEPRECATED < OIIO_MAKE_VERSION(1,9,0) && !defined(OIIO_INTERNAL) -// Deprecated typedefs. Just use ParamValue and ParamValueList directly. -OIIO_DEPRECATED("Use ParamValue instead") typedef ParamValue ImageIOParameter; -OIIO_DEPRECATED("Use ParamValueList instead") typedef ParamValueList ImageIOParameterList; -#endif - -#if OIIO_DISABLE_DEPRECATED < OIIO_MAKE_VERSION(2, 0, 0) -// DEPRECATED(2.0) -- the alpha_channel, z_channel were never used -OIIO_DEPRECATED("Deprecated version (2.0)") -inline bool convert_image(int nchannels, int width, int height, int depth, - const void *src, TypeDesc src_type, - stride_t src_xstride, stride_t src_ystride, stride_t src_zstride, - void *dst, TypeDesc dst_type, - stride_t dst_xstride, stride_t dst_ystride, stride_t dst_zstride, - int /*alpha_channel*/, int /*z_channel*/ = -1) -{ - return convert_image(nchannels, width, height, depth, src, src_type, - src_xstride, src_ystride, src_zstride, dst, dst_type, - dst_xstride, dst_ystride, dst_zstride); -} - -// DEPRECATED(2.0) -- the alpha_channel, z_channel were never used -OIIO_DEPRECATED("Deprecated version (2.0)") -inline bool parallel_convert_image( - int nchannels, int width, int height, int depth, - const void *src, TypeDesc src_type, - stride_t src_xstride, stride_t src_ystride, stride_t src_zstride, - void *dst, TypeDesc dst_type, - stride_t dst_xstride, stride_t dst_ystride, stride_t dst_zstride, - int /*alpha_channel*/, int /*z_channel*/, int nthreads=0) -{ - return parallel_convert_image (nchannels, width, height, depth, - src, src_type, src_xstride, src_ystride, src_zstride, - dst, dst_type, dst_xstride, dst_ystride, dst_zstride, nthreads); -} -#endif - #if OIIO_DISABLE_DEPRECATED < OIIO_MAKE_VERSION(2, 1, 0) // DEPRECATED(2.1): old name OIIO_DEPRECATED("use convert_pixel_values instead (2.1)") diff --git a/src/include/OpenImageIO/platform.h b/src/include/OpenImageIO/platform.h index f5f1101786..6de87c505e 100644 --- a/src/include/OpenImageIO/platform.h +++ b/src/include/OpenImageIO/platform.h @@ -433,6 +433,14 @@ // [[deprecated(msg)]] instead. #define OIIO_DEPRECATED(msg) [[deprecated(msg)]] +// OIIO_DEPRECATED_EXTERNAL marks things deprecated for downstream apps, but +// still is allowed for internal use. Generally, this is used when we want to +// deprecate for users but can't quite extract it internally yet. +#ifndef OIIO_INTERNAL +# define OIIO_DEPRECATED_EXTERNAL(msg) [[deprecated(msg)]] +#else +# define OIIO_DEPRECATED_EXTERNAL(msg) +#endif // OIIO_FALLTHROUGH at the end of a `case` label's statements documents that // the switch statement case is intentionally falling through to the code diff --git a/src/include/OpenImageIO/simd.h b/src/include/OpenImageIO/simd.h index 7c69117ad0..f72b7a59cf 100644 --- a/src/include/OpenImageIO/simd.h +++ b/src/include/OpenImageIO/simd.h @@ -268,7 +268,6 @@ // the vfloat8 class (and friends) are in this version of simd.h, but that's // different from OIIO_SIMD >= 8, which means it's supported in hardware. #define OIIO_SIMD_HAS_MATRIX4 1 /* matrix44 defined */ -#define OIIO_SIMD_HAS_FLOAT8 1 /* DEPRECATED(1.8) */ #define OIIO_SIMD_HAS_SIMD8 1 /* vfloat8, vint8, vbool8 defined */ #define OIIO_SIMD_HAS_SIMD16 1 /* vfloat16, vint16, vbool16 defined */ @@ -301,21 +300,6 @@ class vbool16; class vint16; class vfloat16; -#if OIIO_DISABLE_DEPRECATED < OIIO_MAKE_VERSION(1,9,0) && !defined(OIIO_INTERNAL) -// Deprecated names -- remove these in 1.9 -// These are removed from visibility for the OIIO codebase itself, or for any -// downstream project that defines OIIO_DISABLE_DEPRECATED to exclude -// declarations deprecated as of version 1.9 or later. -OIIO_DEPRECATED("use vbool4") typedef vbool4 mask4; // old name -OIIO_DEPRECATED("use vbool4") typedef vbool4 bool4; -OIIO_DEPRECATED("use vbool8") typedef vbool8 bool8; -OIIO_DEPRECATED("use vint4") typedef vint4 int4; -OIIO_DEPRECATED("use vint8") typedef vint8 int8; -OIIO_DEPRECATED("use vfloat3") typedef vfloat3 float3; -OIIO_DEPRECATED("use vfloat4") typedef vfloat4 float4; -OIIO_DEPRECATED("use vfloat8") typedef vfloat8 float8; -#endif - } // namespace simd @@ -1220,9 +1204,6 @@ vint4 max (const vint4& a, const vint4& b); /// Circular bit rotate by s bits, for N values at once. vint4 rotl (const vint4& x, const int s); -// DEPRECATED(2.1) -OIIO_DEPRECATED("Use rotl instead") -vint4 rotl32 (const vint4& x, const unsigned int k); /// andnot(a,b) returns ((~a) & b) vint4 andnot (const vint4& a, const vint4& b); @@ -1526,9 +1507,6 @@ vint8 max (const vint8& a, const vint8& b); /// Circular bit rotate by s bits, for N values at once. vint8 rotl (const vint8& x, const int s); -// DEPRECATED(2.1) -OIIO_DEPRECATED("Use rotl instead") -vint8 rotl32 (const vint8& x, const unsigned int k); /// andnot(a,b) returns ((~a) & b) vint8 andnot (const vint8& a, const vint8& b); @@ -1839,9 +1817,6 @@ vint16 max (const vint16& a, const vint16& b); /// Circular bit rotate by s bits, for N values at once. vint16 rotl (const vint16& x, const int s); -// DEPRECATED(2.1) -OIIO_DEPRECATED("Use rotl instead") -vint16 rotl32 (const vint16& x, const unsigned int k); /// andnot(a,b) returns ((~a) & b) vint16 andnot (const vint16& a, const vint16& b); @@ -2190,8 +2165,6 @@ vfloat4 sign (const vfloat4& a); ///< 1.0 when value >= 0, -1 when negative vfloat4 ceil (const vfloat4& a); vfloat4 floor (const vfloat4& a); vint4 ifloor (const vfloat4& a); ///< (int)floor -OIIO_DEPRECATED("use ifloor (1.8)") -inline vint4 floori (const vfloat4& a) { return ifloor(a); } // DEPRECATED(1.8) alias /// Per-element round to nearest integer. /// CAVEAT: the rounding when mid-way between integers may differ depending @@ -2806,8 +2779,6 @@ vfloat8 sign (const vfloat8& a); ///< 1.0 when value >= 0, -1 when negative vfloat8 ceil (const vfloat8& a); vfloat8 floor (const vfloat8& a); vint8 ifloor (const vfloat8& a); ///< (int)floor -OIIO_DEPRECATED("Use ifloor instead") -inline vint8 floori (const vfloat8& a) { return ifloor(a); } // DEPRECATED(1.8) alias /// Per-element round to nearest integer. /// CAVEAT: the rounding when mid-way between integers may differ depending @@ -3125,8 +3096,6 @@ vfloat16 sign (const vfloat16& a); ///< 1.0 when value >= 0, -1 when negative vfloat16 ceil (const vfloat16& a); vfloat16 floor (const vfloat16& a); vint16 ifloor (const vfloat16& a); ///< (int)floor -OIIO_DEPRECATED("use ifloor (1.8)") -inline vint16 floori (const vfloat16& a) { return ifloor(a); } // DEPRECATED(1.8) alias /// Per-element round to nearest integer. /// CAVEAT: the rounding when mid-way between integers may differ depending @@ -4979,13 +4948,6 @@ OIIO_FORCEINLINE vint4 rotl(const vint4& x, int s) { #endif } -// DEPRECATED (2.1) -OIIO_DEPRECATED("Use rotl instead") -OIIO_FORCEINLINE vint4 rotl32 (const vint4& x, const unsigned int k) { - return rotl(x, k); -} - - OIIO_FORCEINLINE vint4 andnot (const vint4& a, const vint4& b) { #if OIIO_SIMD_SSE return _mm_andnot_si128 (a.simd(), b.simd()); @@ -5808,12 +5770,6 @@ OIIO_FORCEINLINE vint8 rotl(const vint8& x, int s) { #endif } -// DEPRECATED (2.1) -OIIO_DEPRECATED("Use rotl instead") -OIIO_FORCEINLINE vint8 rotl32 (const vint8& x, const unsigned int k) { - return rotl(x, k); -} - OIIO_FORCEINLINE vint8 andnot (const vint8& a, const vint8& b) { #if OIIO_SIMD_AVX >= 2 @@ -6616,12 +6572,6 @@ OIIO_FORCEINLINE vint16 rotl(const vint16& x, int s) { #endif } -// DEPRECATED (2.1) -OIIO_DEPRECATED("Use rotl instead") -OIIO_FORCEINLINE vint16 rotl32 (const vint16& x, const unsigned int k) { - return rotl(x, k); -} - OIIO_FORCEINLINE vint16 andnot (const vint16& a, const vint16& b) { #if OIIO_SIMD_AVX >= 512 diff --git a/src/include/OpenImageIO/string_view.h b/src/include/OpenImageIO/string_view.h index 533b04d0d4..83a4bf1e2d 100644 --- a/src/include/OpenImageIO/string_view.h +++ b/src/include/OpenImageIO/string_view.h @@ -510,11 +510,6 @@ using wstring_view = basic_string_view; -// DEPRECATED name equivalence -OIIO_DEPRECATED("Use string_view (2.3)") -typedef string_view string_ref; - - /// Return a safe pointer to a null-terminated C string with the contents of /// the string_view. /// diff --git a/src/include/OpenImageIO/texture.h b/src/include/OpenImageIO/texture.h index b123afc9a6..9bd60cd1c4 100644 --- a/src/include/OpenImageIO/texture.h +++ b/src/include/OpenImageIO/texture.h @@ -1423,8 +1423,8 @@ class OIIO_API TextureSystem { bool get_imagespec(TextureHandle* texture_handle, Perthread* thread_info, ImageSpec& spec, int subimage = 0); - /// DEPRECATED old API. Note that the spec and subimage parameters are - /// inverted. We recommend switching to the new API. + /// DEPRECATED(3.0) old API. Note that the spec and subimage parameters + /// are inverted. We recommend switching to the new API. bool get_imagespec(ustring filename, int subimage, ImageSpec& spec) { return get_imagespec(filename, spec, subimage); diff --git a/src/include/OpenImageIO/ustring.h b/src/include/OpenImageIO/ustring.h index fb45c075d5..2d82d6bd10 100644 --- a/src/include/OpenImageIO/ustring.h +++ b/src/include/OpenImageIO/ustring.h @@ -669,16 +669,6 @@ class OIIO_UTIL_API ustring { return ustring(Strutil::fmt::format(fmt, args...)); } - /// NOTE: Semi-DEPRECATED! This will someday switch to behave like - /// fmt::format (or future std::format) but for now, it is back - /// compatible and equivalent to sprintf. - template - OIIO_FORMAT_DEPRECATED static ustring format(const char* fmt, - const Args&... args) - { - return ustring(Strutil::format(fmt, args...)); - } - /// Concatenate two strings, returning a ustring, implemented carefully /// to not perform any redundant copies or allocations. static ustring concat(string_view s, string_view t); diff --git a/src/libOpenImageIO/imageinput.cpp b/src/libOpenImageIO/imageinput.cpp index c4aa28cdf0..fea1f914c7 100644 --- a/src/libOpenImageIO/imageinput.cpp +++ b/src/libOpenImageIO/imageinput.cpp @@ -549,43 +549,6 @@ ImageInput::read_tile(int x, int y, int z, TypeDesc format, void* data, -bool -ImageInput::read_tiles(int xbegin, int xend, int ybegin, int yend, int zbegin, - int zend, TypeDesc format, void* data, stride_t xstride, - stride_t ystride, stride_t zstride) -{ - int subimage, miplevel, chend; - { - lock_guard lock(*this); - subimage = current_subimage(); - miplevel = current_miplevel(); - chend = spec().nchannels; - } - return read_tiles(subimage, miplevel, xbegin, xend, ybegin, yend, zbegin, - zend, 0, chend, format, data, xstride, ystride, zstride); -} - - - -bool -ImageInput::read_tiles(int xbegin, int xend, int ybegin, int yend, int zbegin, - int zend, int chbegin, int chend, TypeDesc format, - void* data, stride_t xstride, stride_t ystride, - stride_t zstride) -{ - int subimage, miplevel; - { - lock_guard lock(*this); - subimage = current_subimage(); - miplevel = current_miplevel(); - } - return read_tiles(subimage, miplevel, xbegin, xend, ybegin, yend, zbegin, - zend, chbegin, chend, format, data, xstride, ystride, - zstride); -} - - - bool ImageInput::read_tiles(int subimage, int miplevel, int xbegin, int xend, int ybegin, int yend, int zbegin, int zend, int chbegin, @@ -875,43 +838,6 @@ ImageInput::read_native_tiles(int subimage, int miplevel, int xbegin, int xend, -bool -ImageInput::read_image(TypeDesc format, void* data, stride_t xstride, - stride_t ystride, stride_t zstride, - ProgressCallback progress_callback, - void* progress_callback_data) -{ - int subimage, miplevel; - { - lock_guard lock(*this); - subimage = current_subimage(); - miplevel = current_miplevel(); - } - return read_image(subimage, miplevel, 0, -1, format, data, xstride, ystride, - zstride, progress_callback, progress_callback_data); -} - - - -bool -ImageInput::read_image(int chbegin, int chend, TypeDesc format, void* data, - stride_t xstride, stride_t ystride, stride_t zstride, - ProgressCallback progress_callback, - void* progress_callback_data) -{ - int subimage, miplevel; - { - lock_guard lock(*this); - subimage = current_subimage(); - miplevel = current_miplevel(); - } - return read_image(subimage, miplevel, chbegin, chend, format, data, xstride, - ystride, zstride, progress_callback, - progress_callback_data); -} - - - bool ImageInput::read_image(int subimage, int miplevel, int chbegin, int chend, TypeDesc format, void* data, stride_t xstride, diff --git a/src/libtexture/texturesys.cpp b/src/libtexture/texturesys.cpp index 772c5b4515..305394d467 100644 --- a/src/libtexture/texturesys.cpp +++ b/src/libtexture/texturesys.cpp @@ -3101,7 +3101,7 @@ TextureSystemImpl::sample_bicubic( bool ok = find_tile(id, thread_info, sample == 0); if (!ok) error("{}", m_imagecache->geterror()); - DASSERT(thread_info->tile->id() == id); + OIIO_DASSERT(thread_info->tile->id() == id); if (!thread_info->tile->valid()) return false; } diff --git a/src/libutil/strutil.cpp b/src/libutil/strutil.cpp index 54e1aece7a..e240b24ce9 100644 --- a/src/libutil/strutil.cpp +++ b/src/libutil/strutil.cpp @@ -974,17 +974,6 @@ Strutil::utf8_to_utf16wstring(string_view str) noexcept -#if OPENIMAGEIO_VERSION < 30000 -// DEPRECATED(2.5) and slated for removal in 3.0. -std::wstring -Strutil::utf8_to_utf16(string_view str) noexcept -{ - return utf8_to_utf16wstring(str); -} -#endif - - - std::string Strutil::utf16_to_utf8(const std::wstring& str) noexcept { diff --git a/src/maketx/maketx.cpp b/src/maketx/maketx.cpp index 4900f41eb1..04a4b77fe2 100644 --- a/src/maketx/maketx.cpp +++ b/src/maketx/maketx.cpp @@ -244,8 +244,6 @@ getargs(int argc, char* argv[], ImageSpec& configspec) .help("Specific t wrap mode separately"); ap.arg("--resize", &doresize) .help("Resize textures to power of 2 (default: no)"); - ap.arg("--noresize %!", &doresize) - .help("Do not resize textures to power of 2 (deprecated)"); ap.arg("--filter %s:FILTERNAME", &filtername) .help(filter_help_string()); ap.arg("--hicomp", &do_highlight_compensation) @@ -302,8 +300,6 @@ getargs(int argc, char* argv[], ImageSpec& configspec) .help("Ignore unassociated alpha tags in input (don't autoconvert)"); ap.arg("--runstats", &runstats) .help("Print runtime statistics"); - ap.arg("--stats", &runstats) - .hidden(); // DEPRECATED 1.6 ap.arg("--mipimage %L:FILENAME", &mipimages) .help("Specify an individual MIP level"); ap.arg("--cdf", &cdf) diff --git a/src/oiiotool/printinfo.cpp b/src/oiiotool/printinfo.cpp index 3d5ddef48d..90f5a4eacd 100644 --- a/src/oiiotool/printinfo.cpp +++ b/src/oiiotool/printinfo.cpp @@ -528,7 +528,7 @@ OiioTool::print_info(std::ostream& out, Oiiotool& ot, ImageRec* img, for (int s = 0, nsubimages = img->subimages(); s < nsubimages; ++s) { const ImageSpec* spec = opt.native ? img->nativespec(s) : img->spec(s); - DASSERT(spec != nullptr); + OIIO_DASSERT(spec != nullptr); print_info_subimage(out, ot, s, nsubimages, img->miplevels(s), *spec, img, nullptr, "", opt, field_re, field_exclude_re, serformat, verbose); diff --git a/src/psd.imageio/psdinput.cpp b/src/psd.imageio/psdinput.cpp index 5200ba98fd..de171fed7b 100644 --- a/src/psd.imageio/psdinput.cpp +++ b/src/psd.imageio/psdinput.cpp @@ -382,8 +382,8 @@ class PSDInput final : public ImageInput { static void cmyk_to_rgb(int n, cspan cmyk, size_t cmyk_stride, span rgb, size_t rgb_stride) { - DASSERT(size_t(n) * cmyk_stride <= std::size(cmyk)); - DASSERT(size_t(n) * rgb_stride <= std::size(rgb)); + OIIO_DASSERT(size_t(n) * cmyk_stride <= std::size(cmyk)); + OIIO_DASSERT(size_t(n) * rgb_stride <= std::size(rgb)); for (int i = 0; i < n; ++i) { float C = convert_type(cmyk[i * cmyk_stride + 0]); float M = convert_type(cmyk[i * cmyk_stride + 1]); diff --git a/src/python/py_imagebufalgo.cpp b/src/python/py_imagebufalgo.cpp index a0b9a2e256..71e8862849 100644 --- a/src/python/py_imagebufalgo.cpp +++ b/src/python/py_imagebufalgo.cpp @@ -1495,38 +1495,6 @@ IBA_fit_ret(const ImageBuf& src, const std::string& filtername = "", -// DEPRECATED(2.3) -bool -IBA_fit_old(ImageBuf& dst, const ImageBuf& src, - const std::string& filtername = "", float filterwidth = 0.0f, - bool exact = false, ROI roi = ROI::All(), int nthreads = 0) -{ - py::gil_scoped_release gil; - return ImageBufAlgo::fit(dst, src, - { { "filtername", filtername }, - { "filterwidth", filterwidth }, - { "fillmode", "letterbox" }, - { "exact", int(exact) } }, - roi, nthreads); -} - -// DEPRECATED(2.3) -ImageBuf -IBA_fit_ret_old(const ImageBuf& src, const std::string& filtername = "", - float filterwidth = 0.0f, bool exact = false, - ROI roi = ROI::All(), int nthreads = 0) -{ - py::gil_scoped_release gil; - return ImageBufAlgo::fit(src, - { { "filtername", filtername }, - { "filterwidth", filterwidth }, - { "fillmode", "letterbox" }, - { "exact", int(exact) } }, - roi, nthreads); -} - - - bool IBA_make_kernel(ImageBuf& dst, const std::string& name, float width, float height, float depth, bool normalize) @@ -3013,13 +2981,6 @@ declare_imagebufalgo(py::module& m) .def_static("fit", &IBA_fit_ret, "src"_a, "filtername"_a = "", "filterwidth"_a = 0.0f, "fillmode"_a = "letterbox", "exact"_a = false, "roi"_a = ROI::All(), "nthreads"_a = 0) - // DEPRECATED(2.3) versions - .def_static("fit", &IBA_fit_old, "dst"_a, "src"_a, "filtername"_a = "", - "filterwidth"_a = 0.0f, "exact"_a = false, - "roi"_a = ROI::All(), "nthreads"_a = 0) - .def_static("fit", &IBA_fit_ret_old, "src"_a, "filtername"_a = "", - "filterwidth"_a = 0.0f, "exact"_a = false, - "roi"_a = ROI::All(), "nthreads"_a = 0) .def_static("make_kernel", &IBA_make_kernel, "dst"_a, "name"_a, "width"_a, "height"_a, "depth"_a = 1.0f, diff --git a/src/python/py_imageinput.cpp b/src/python/py_imageinput.cpp index 795a8ea69b..68c31e2a1a 100644 --- a/src/python/py_imageinput.cpp +++ b/src/python/py_imageinput.cpp @@ -321,32 +321,9 @@ declare_imageinput(py::module& m) .def("read_native_deep_scanlines", &ImageInput_read_native_deep_scanlines, "subimage"_a, "miplevel"_a, "ybegin"_a, "yend"_a, "z"_a, "chbegin"_a, "chend"_a) - .def( - "read_native_deep_scanlines", // DEPRECATED(1.9), keep for back compatibility - [](ImageInput& self, int ybegin, int yend, int z, int chbegin, - int chend) { - int subimage = self.current_subimage(); - int miplevel = self.current_miplevel(); - return ImageInput_read_native_deep_scanlines(self, subimage, - miplevel, ybegin, - yend, z, chbegin, - chend); - }, - "ybegin"_a, "yend"_a, "z"_a, "chbegin"_a, "chend"_a) .def("read_native_deep_tiles", &ImageInput_read_native_deep_tiles, "subimage"_a, "miplevel"_a, "xbegin"_a, "xend"_a, "ybegin"_a, "yend"_a, "zbegin"_a, "zend"_a, "chbegin"_a, "chend"_a) - .def( - "read_native_deep_tiles", // DEPRECATED(1.9), keep for back compatibility - [](ImageInput& self, int xbegin, int xend, int ybegin, int yend, - int zbegin, int zend, int chbegin, int chend) { - return ImageInput_read_native_deep_tiles(self, 0, 0, xbegin, - xend, ybegin, yend, - zbegin, zend, chbegin, - chend); - }, - "xbegin"_a, "xend"_a, "ybegin"_a, "yend"_a, "zbegin"_a, "zend"_a, - "chbegin"_a, "chend"_a) .def("read_native_deep_image", &ImageInput_read_native_deep_image, "subimage"_a = 0, "miplevel"_a = 0) .def( diff --git a/src/python/py_typedesc.cpp b/src/python/py_typedesc.cpp index f671c30419..21c1d635d1 100644 --- a/src/python/py_typedesc.cpp +++ b/src/python/py_typedesc.cpp @@ -126,33 +126,9 @@ declare_typedesc(py::module& m) // Conversion to string .def("__str__", [](TypeDesc t) { return PY_STR(t.c_str()); }) - .def("__repr__", - [](TypeDesc t) { - return PY_STR(""); - }) - - // Static members of pre-constructed types - // DEPRECATED(1.8) - .def_readonly_static("TypeFloat", &TypeFloat) - .def_readonly_static("TypeColor", &TypeColor) - .def_readonly_static("TypeString", &TypeString) - .def_readonly_static("TypeInt", &TypeInt) - .def_readonly_static("TypeHalf", &TypeHalf) - .def_readonly_static("TypePoint", &TypePoint) - .def_readonly_static("TypeVector", &TypeVector) - .def_readonly_static("TypeNormal", &TypeNormal) - .def_readonly_static("TypeMatrix", &TypeMatrix) - .def_readonly_static("TypeMatrix33", &TypeMatrix33) - .def_readonly_static("TypeMatrix44", &TypeMatrix44) - .def_readonly_static("TypeTimeCode", &TypeTimeCode) - .def_readonly_static("TypeKeyCode", &TypeKeyCode) - .def_readonly_static("TypeRational", &TypeRational) - .def_readonly_static("TypeFloat2", &TypeFloat2) - .def_readonly_static("TypeVector2", &TypeVector2) - .def_readonly_static("TypeVector2i", &TypeVector2i) - .def_readonly_static("TypeVector3i", &TypeVector3i) - .def_readonly_static("TypeFloat4", &TypeFloat4) - .def_readonly_static("TypeVector4", &TypeVector4); + .def("__repr__", [](TypeDesc t) { + return PY_STR(""); + }); // Declare that a BASETYPE is implicitly convertible to a TypeDesc. // This keeps us from having to separately declare func(TypeDesc) diff --git a/src/targa.imageio/targaoutput.cpp b/src/targa.imageio/targaoutput.cpp index 0d7be1ccf6..b580da9907 100644 --- a/src/targa.imageio/targaoutput.cpp +++ b/src/targa.imageio/targaoutput.cpp @@ -273,23 +273,6 @@ TGAOutput::write_tga20_data_fields() if (!write(tw) || !write(th) || !write(m_thumb.localpixels(), m_thumb.spec().image_bytes())) return false; - } else { - // Old API -- honor it for a while - // DEPRECATED(2.3) - unsigned char tw = m_spec.get_int_attribute("thumbnail_width", 0); - unsigned char th = m_spec.get_int_attribute("thumbnail_width", 0); - int tc = m_spec.get_int_attribute("thumbnail_nchannels", 0); - if (tw && th && tc == m_spec.nchannels) { - ParamValue* p = m_spec.find_attribute("thumbnail_image"); - if (p) { - ofs_thumb = (uint32_t)iotell(); - // dump thumbnail size - if (!write(tw) || !write(th) - || !write(p->data(), p->datasize())) { - return false; - } - } - } } // prepare the footer diff --git a/testsuite/oiiotool-deep/run.py b/testsuite/oiiotool-deep/run.py index 26953d0938..6008f9bd57 100755 --- a/testsuite/oiiotool-deep/run.py +++ b/testsuite/oiiotool-deep/run.py @@ -65,7 +65,7 @@ command += oiiotool ("--fail 100 src/deep-nosamples.exr src/deep-onesample.exr --diff") command += oiiotool ("--fail 100 src/deep-onesample.exr src/deep-nosamples.exr --diff") # Recipe for creating the files: - # spec = oiio.ImageSpec (1, 1, 1, oiio.TypeDesc.TypeFloat) + # spec = oiio.ImageSpec (1, 1, 1, oiio.TypeFloat) # spec.channelnames = ("Z") # spec.deep = True # buf = oiio.ImageBuf (spec) diff --git a/testsuite/python-deep/src/test_deep.py b/testsuite/python-deep/src/test_deep.py index 7e17f86f4d..be472b4b77 100755 --- a/testsuite/python-deep/src/test_deep.py +++ b/testsuite/python-deep/src/test_deep.py @@ -10,9 +10,8 @@ test_xres = 3 test_yres = 3 test_nchannels = 6 -test_chantypes = (oiio.TypeDesc.TypeHalf, oiio.TypeDesc.TypeHalf, - oiio.TypeDesc.TypeHalf, oiio.TypeDesc.TypeHalf, - oiio.TypeDesc.TypeFloat, oiio.TypeDesc.TypeFloat) +test_chantypes = (oiio.TypeHalf, oiio.TypeHalf, oiio.TypeHalf, oiio.TypeHalf, + oiio.TypeFloat, oiio.TypeFloat) test_channames = ("R", "G", "B", "A", "Z", "Zback") print ("test_chantypes ", str(test_chantypes[0]), str(test_chantypes[1]), str(test_chantypes[2]), str(test_chantypes[3]), str(test_chantypes[4]), str(test_chantypes[5])) @@ -256,9 +255,8 @@ def test_iba_deep_holdout () : print ("\nTesting ImageBufAlgo.deep_holdout...") spec = oiio.ImageSpec (6, 1, 6, oiio.FLOAT) spec.deep = True - spec.channelformats = (oiio.TypeDesc.TypeHalf, oiio.TypeDesc.TypeHalf, - oiio.TypeDesc.TypeHalf, oiio.TypeDesc.TypeHalf, - oiio.TypeDesc.TypeFloat, oiio.TypeDesc.TypeFloat) + spec.channelformats = (oiio.TypeHalf, oiio.TypeHalf, oiio.TypeHalf, + oiio.TypeHalf, oiio.TypeFloat, oiio.TypeFloat) spec.channelnames = ("R", "G", "B", "A", "Z", "Zback") src = oiio.ImageBuf (spec) # Set up source image @@ -298,7 +296,7 @@ def test_iba_deep_holdout () : # Try to write the test image to an exr file print ("\nWriting image...") - spec = oiio.ImageSpec (test_xres, test_yres, test_nchannels, oiio.TypeDesc.TypeFloat) + spec = oiio.ImageSpec (test_xres, test_yres, test_nchannels, oiio.TypeFloat) spec.channelnames = test_channames spec.channelformats = test_chantypes spec.deep = True diff --git a/testsuite/python-imagebuf/src/test_imagebuf.py b/testsuite/python-imagebuf/src/test_imagebuf.py index dbb5eab0a3..40e4b918d6 100755 --- a/testsuite/python-imagebuf/src/test_imagebuf.py +++ b/testsuite/python-imagebuf/src/test_imagebuf.py @@ -233,7 +233,7 @@ def ftupstr(tup) : print ("Interpolating NDC 0.25,0.5 ->", ftupstr(b.interppixel_NDC(0.25,0.5))) print ("Interpolating bicubic 0.25,0.5 ->", ftupstr(b.interppixel_bicubic(1.0,0.5))) print ("Interpolating NDC bicubic 0.25,0.5 ->", ftupstr(b.interppixel_bicubic_NDC(0.25,0.5))) - print ("The whole image is: ", b.get_pixels(oiio.TypeDesc.TypeFloat)) + print ("The whole image is: ", b.get_pixels(oiio.TypeFloat)) print ("") print ("Saving file...") b.write ("out.tif") diff --git a/testsuite/python-imagebufalgo/ref/out-python2-alt.txt b/testsuite/python-imagebufalgo/ref/out-python2-alt.txt deleted file mode 100644 index 75f9959485..0000000000 --- a/testsuite/python-imagebufalgo/ref/out-python2-alt.txt +++ /dev/null @@ -1,224 +0,0 @@ - -Testing color conversions: -linear src=[0.000 0.000 0.000 1.000 ] [0.250 0.250 0.250 1.000 ] -[0.500 0.500 0.500 1.000 ] [1.000 1.000 1.000 1.000 ] -to srgb =[0.000 0.000 0.000 1.000 ] [0.537 0.537 0.537 1.000 ] -[0.735 0.735 0.735 1.000 ] [1.000 1.000 1.000 1.000 ] -back to linear =[0.000 0.000 0.000 1.000 ] [0.250 0.250 0.250 1.000 ] -[0.500 0.500 0.500 1.000 ] [1.000 1.000 1.000 1.000 ] -after *M =[0.000 0.000 0.100 1.000 ] [0.125 0.500 0.350 1.000 ] -[0.250 1.000 0.600 1.000 ] [0.500 2.000 1.100 1.000 ] -Stats for tahoe-small.tif: - min = [0.0, 0.003921568859368563, 0.007843137718737125] - max = [0.8784314393997192, 1.0, 1.0] - avg = [0.10193096846342087, 0.21669696271419525, 0.4254732131958008] - stddev = [0.13176830112934113, 0.23792722821235657, 0.3826749324798584] - nancount = [0, 0, 0] - infcount = [0, 0, 0] - finitecount = [196608, 196608, 196608] -Comparison: of flip.tif and flop.tif - mean = 0.0068759 - rms = 0.051175 - PSNR = 25.819 - max = 0.45098 - max @ (214, 88, 0, 0) - warns 2034 fails 2034 -Relative comparison: of flip.tif and flop.tif - warns 1946 fails 1896 -isConstantColor on pink image is (1 0.50196 0.50196) -isConstantColor on checker is None -Is cmul1.exr monochrome? True -Is cmul2.exr monochrome? False -color range counts = (4L, 8L, 4L) -Nonzero region is: 100 180 100 180 0 1 0 3 -SHA-1 of bsplinekernel.exr is: D5826B66A5313F9A32D42C5CF49C90EC4E7F84BF -R hist: (10000L, 0L, 0L, 0L) -G hist: (10000L, 0L, 0L, 0L) -B hist: (0L, 10000L, 0L, 0L) -Done. -Comparing "black.tif" and "ref/black.tif" -PASS -Comparing "filled.tif" and "../../../testsuite/oiiotool/ref/filled.tif" -PASS -Comparing "checker.tif" and "ref/checker.tif" -PASS -Comparing "noise-uniform3.tif" and "../../../testsuite/oiiotool-pattern/ref/noise-uniform3.tif" -PASS -Comparing "noise-gauss.tif" and "../../../testsuite/oiiotool-pattern/ref/noise-gauss.tif" -PASS -Comparing "noise-salt.tif" and "../../../testsuite/oiiotool-pattern/ref/noise-salt.tif" -PASS -Comparing "noise-blue3.tif" and "ref/noise-blue3.tif" -PASS -Comparing "bluenoise_image3.tif" and "ref/bluenoise_image3.tif" -PASS -Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool-copy/ref/chanshuffle.tif" -PASS -Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool-copy/ref/ch-rgba.exr" -PASS -Comparing "ch-z.exr" and "../../../testsuite/oiiotool-copy/ref/ch-z.exr" -PASS -Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool-copy/ref/chappend-rgbaz.exr" -PASS -Comparing "flat.exr" and "../../../testsuite/oiiotool-deep/ref/flat.exr" -PASS -Comparing "deepen.exr" and "../../../testsuite/oiiotool-deep/ref/deepen.exr" -PASS -Comparing "crop.tif" and "../../../testsuite/oiiotool-copy/ref/crop.tif" -PASS -Comparing "cut.tif" and "../../../testsuite/oiiotool-copy/ref/cut.tif" -PASS -Comparing "pasted.tif" and "../../../testsuite/oiiotool-copy/ref/pasted.tif" -PASS -Comparing "rotate90.tif" and "../../../testsuite/oiiotool-xform/ref/rotate90.tif" -PASS -Comparing "rotate180.tif" and "../../../testsuite/oiiotool/ref/rotate180.tif" -PASS -Comparing "rotate270.tif" and "../../../testsuite/oiiotool-xform/ref/rotate270.tif" -PASS -Comparing "rotated.tif" and "../../../testsuite/oiiotool-xform/ref/rotated.tif" -PASS -Comparing "rotated-offcenter.tif" and "../../../testsuite/oiiotool-xform/ref/rotated-offcenter.tif" -PASS -Comparing "warped.tif" and "../../../testsuite/oiiotool-xform/ref/warped.tif" -PASS -Comparing "flip.tif" and "../../../testsuite/oiiotool-xform/ref/flip.tif" -PASS -Comparing "flop.tif" and "../../../testsuite/oiiotool-xform/ref/flop.tif" -PASS -Comparing "reorient1.tif" and "../../../testsuite/oiiotool-xform/ref/reorient1.tif" -PASS -Comparing "transpose.tif" and "../../../testsuite/oiiotool-xform/ref/transpose.tif" -PASS -Comparing "cshift.tif" and "../../../testsuite/oiiotool-xform/ref/cshift.tif" -PASS -Comparing "cadd1.exr" and "../../../testsuite/oiiotool/ref/cadd1.exr" -PASS -Comparing "cadd2.exr" and "../../../testsuite/oiiotool/ref/cadd2.exr" -PASS -Comparing "add.exr" and "../../../testsuite/oiiotool/ref/add.exr" -PASS -Comparing "sub.exr" and "../../../testsuite/oiiotool/ref/sub.exr" -PASS -Comparing "csub2.exr" and "ref/csub2.exr" -PASS -Comparing "abs.exr" and "../../../testsuite/oiiotool/ref/abs.exr" -PASS -Comparing "absdiff.exr" and "../../../testsuite/oiiotool/ref/absdiff.exr" -PASS -Comparing "mul.exr" and "../../../testsuite/oiiotool/ref/mul.exr" -PASS -Comparing "cmul1.exr" and "../../../testsuite/oiiotool/ref/cmul1.exr" -PASS -Comparing "cmul2.exr" and "../../../testsuite/oiiotool/ref/cmul2.exr" -PASS -Comparing "mad.exr" and "../../../testsuite/oiiotool/ref/mad.exr" -PASS -Comparing "mad2.exr" and "ref/mad2.exr" -PASS -Comparing "mad3.exr" and "ref/mad3.exr" -PASS -Comparing "cpow1.exr" and "../../../testsuite/oiiotool/ref/cpow1.exr" -PASS -Comparing "cpow2.exr" and "../../../testsuite/oiiotool/ref/cpow2.exr" -PASS -Comparing "div.exr" and "../../../testsuite/oiiotool/ref/div.exr" -PASS -Comparing "divc1.exr" and "../../../testsuite/oiiotool/ref/divc1.exr" -PASS -Comparing "divc2.exr" and "../../../testsuite/oiiotool/ref/divc2.exr" -PASS -Comparing "invert.tif" and "../../../testsuite/oiiotool/ref/invert.tif" -PASS -Comparing "maximg.tif" and "ref/maximg.tif" -PASS -Comparing "maxval.tif" and "ref/maxval.tif" -PASS -Comparing "minimg.tif" and "ref/minimg.tif" -PASS -Comparing "minval.tif" and "ref/minval.tif" -PASS -Comparing "minchan.tif" and "ref/minchan.tif" -PASS -Comparing "maxchan.tif" and "ref/maxchan.tif" -PASS -Comparing "chsum.tif" and "../../../testsuite/oiiotool/ref/chsum.tif" -PASS -Comparing "colormap-inferno.tif" and "../../../testsuite/oiiotool-color/ref/colormap-inferno.tif" -PASS -Comparing "colormap-custom.tif" and "../../../testsuite/oiiotool-color/ref/colormap-custom.tif" -PASS -Comparing "grid-clamped.tif" and "../../../testsuite/oiiotool/ref/grid-clamped.tif" -PASS -Comparing "clamped-with-float.exr" and "ref/clamped-with-float.exr" -PASS -Comparing "rangecompress.tif" and "../../../testsuite/oiiotool/ref/rangecompress.tif" -PASS -Comparing "rangeexpand.tif" and "../../../testsuite/oiiotool/ref/rangeexpand.tif" -PASS -Comparing "contrast-stretch.tif" and "../../../testsuite/oiiotool-color/ref/contrast-stretch.tif" -PASS -Comparing "contrast-shrink.tif" and "../../../testsuite/oiiotool-color/ref/contrast-shrink.tif" -PASS -Comparing "contrast-sigmoid5.tif" and "../../../testsuite/oiiotool-color/ref/contrast-sigmoid5.tif" -PASS -Comparing "saturate-0.tif" and "ref/saturate-0.tif" -PASS -Comparing "saturate-2.tif" and "ref/saturate-2.tif" -PASS -Comparing "resize.tif" and "../../../testsuite/oiiotool-xform/ref/resize.tif" -PASS -Comparing "resample.tif" and "../../../testsuite/oiiotool-xform/ref/resample.tif" -PASS -Comparing "fit.tif" and "../../../testsuite/oiiotool-xform/ref/fit.tif" -PASS -Comparing "norm.exr" and "ref/norm.exr" -PASS -Comparing "normoffset.exr" and "ref/normoffset.exr" -PASS -Comparing "normalize.exr" and "ref/normalize.exr" -PASS -Comparing "normalize_scale.exr" and "ref/normalize_scale.exr" -PASS -Comparing "normalize_offsetin.exr" and "ref/normalize_offsetin.exr" -PASS -Comparing "normalize_offsetscaleout.exr" and "ref/normalize_offsetscaleout.exr" -PASS -Comparing "normalize_offsetscale.exr" and "ref/normalize_offsetscale.exr" -PASS -Comparing "bsplinekernel.exr" and "../../../testsuite/oiiotool/ref/bsplinekernel.exr" -PASS -Comparing "bspline-blur.tif" and "../../../testsuite/oiiotool/ref/bspline-blur.tif" -PASS -Comparing "tahoe-median.tif" and "../../../testsuite/oiiotool/ref/tahoe-median.tif" -PASS -Comparing "dilate.tif" and "../../../testsuite/oiiotool/ref/dilate.tif" -PASS -Comparing "erode.tif" and "../../../testsuite/oiiotool/ref/erode.tif" -PASS -Comparing "unsharp.tif" and "../../../testsuite/oiiotool/ref/unsharp.tif" -PASS -Comparing "unsharp-median.tif" and "../../../testsuite/oiiotool/ref/unsharp-median.tif" -PASS -Comparing "tahoe-laplacian.tif" and "../../../testsuite/oiiotool/ref/tahoe-laplacian.tif" -PASS -Comparing "fft.exr" and "../../../testsuite/oiiotool/ref/fft.exr" -PASS -Comparing "ifft.exr" and "../../../testsuite/oiiotool/ref/ifft.exr" -PASS -Comparing "polar.exr" and "../../../testsuite/oiiotool/ref/polar.exr" -PASS -Comparing "unpolar.exr" and "../../../testsuite/oiiotool/ref/unpolar.exr" -PASS -Comparing "tahoe-filled.tif" and "../../../testsuite/oiiotool/ref/tahoe-filled.tif" -PASS -Comparing "box3.exr" and "../../../testsuite/oiiotool-fixnan/ref/box3.exr" -PASS -Comparing "a_over_b.exr" and "../../../testsuite/oiiotool-composite/ref/a_over_b.exr" -PASS -Comparing "tahoe-small.tx" and "ref/tahoe-small.tx" -PASS -Comparing "text.tif" and "../../../testsuite/oiiotool-text/ref/text-freetype2.7.tif" -PASS -Comparing "textcentered.tif" and "ref/textcentered.tif" -PASS diff --git a/testsuite/python-imagespec/src/test_imagespec.py b/testsuite/python-imagespec/src/test_imagespec.py index f6623125e2..63714b8360 100755 --- a/testsuite/python-imagespec/src/test_imagespec.py +++ b/testsuite/python-imagespec/src/test_imagespec.py @@ -91,10 +91,10 @@ def print_imagespec (spec, msg="") : s.attribute ("foo_str", "blah") s.attribute ("foo_int", 14) s.attribute ("foo_float", 3.14) - s.attribute ("foo_vector", oiio.TypeDesc.TypeVector, (1, 0, 11)) - s.attribute ("foo_matrix", oiio.TypeDesc.TypeMatrix, + s.attribute ("foo_vector", oiio.TypeVector, (1, 0, 11)) + s.attribute ("foo_matrix", oiio.TypeMatrix, (1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 1, 2, 3, 1)) - s.attribute ("smpte:TimeCode", oiio.TypeDesc.TypeTimeCode, (18356486, 4294967295)) + s.attribute ("smpte:TimeCode", oiio.TypeTimeCode, (18356486, 4294967295)) s.attribute ("ucarr", "uint8[10]", numpy.array([49, 50, 51, 0, 0, 97, 98, 99, 1, 88], dtype='B')) s["delfoo_str"] = "egg" s["delfoo_int"] = 29 @@ -175,9 +175,9 @@ def print_imagespec (spec, msg="") : oiio.attribute ("plugin_searchpath", "perfect") print ("get_string_attribute plugin_searchpath : ", oiio.get_string_attribute ("plugin_searchpath", "bad")) print ("get_int_attribute plugin_searchpath : ", oiio.get_int_attribute ("plugin_searchpath", 0)) - print ("getattribute TypeString plugin_searchpath : ", oiio.getattribute ("plugin_searchpath", oiio.TypeDesc.TypeString)) - print ("getattribute TypeFloat plugin_searchpath : ", oiio.getattribute ("plugin_searchpath", oiio.TypeDesc.TypeFloat)) - print ("getattribute TypeString blahblah : ", oiio.getattribute ("blahblah", oiio.TypeDesc.TypeString)) + print ("getattribute TypeString plugin_searchpath : ", oiio.getattribute ("plugin_searchpath", oiio.TypeString)) + print ("getattribute TypeFloat plugin_searchpath : ", oiio.getattribute ("plugin_searchpath", oiio.TypeFloat)) + print ("getattribute TypeString blahblah : ", oiio.getattribute ("blahblah", oiio.TypeString)) print ("Done.") except Exception as detail: diff --git a/testsuite/python-typedesc/ref/out-python2.txt b/testsuite/python-typedesc/ref/out-python2.txt deleted file mode 100644 index 14a42cd961..0000000000 --- a/testsuite/python-typedesc/ref/out-python2.txt +++ /dev/null @@ -1,264 +0,0 @@ -Passed BASETYPE -Passed AGGREGATE -Passed VECSEMANTICS - -type '(default)' - c_str "unknown" - basetype BASETYPE.UNKNOWN - aggregate AGGREGATE.SCALAR - vecsemantics VECSEMANTICS.NOXFORM - arraylen 0 - str(t) = "unknown" - size = 0 - elementtype = unknown - numelements = 1 - basevalues = 1 - elementsize = 0 - basesize = 0 -type 'UINT8' - c_str "uint8" - basetype BASETYPE.UCHAR - aggregate AGGREGATE.SCALAR - vecsemantics VECSEMANTICS.NOXFORM - arraylen 0 - str(t) = "uint8" - size = 1 - elementtype = uint8 - numelements = 1 - basevalues = 1 - elementsize = 1 - basesize = 1 -type 'HALF, VEC3, COLOR' - c_str "colorh" - basetype BASETYPE.HALF - aggregate AGGREGATE.VEC3 - vecsemantics VECSEMANTICS.COLOR - arraylen 0 - str(t) = "colorh" - size = 6 - elementtype = colorh - numelements = 1 - basevalues = 3 - elementsize = 6 - basesize = 2 -type 'FLOAT, SCALAR, NOXFORM, array of 6' - c_str "float[6]" - basetype BASETYPE.FLOAT - aggregate AGGREGATE.SCALAR - vecsemantics VECSEMANTICS.NOXFORM - arraylen 6 - str(t) = "float[6]" - size = 24 - elementtype = float - numelements = 6 - basevalues = 6 - elementsize = 4 - basesize = 4 -type 'FLOAT, VEC3, POINT, array of 2' - c_str "point[2]" - basetype BASETYPE.FLOAT - aggregate AGGREGATE.VEC3 - vecsemantics VECSEMANTICS.POINT - arraylen 2 - str(t) = "point[2]" - size = 24 - elementtype = point - numelements = 2 - basevalues = 6 - elementsize = 12 - basesize = 4 -type 'INT, VEC2, BOX, array of 2' - c_str "box2i" - basetype BASETYPE.INT32 - aggregate AGGREGATE.VEC2 - vecsemantics VECSEMANTICS.BOX - arraylen 2 - str(t) = "box2i" - size = 16 - elementtype = box2i - numelements = 2 - basevalues = 4 - elementsize = 8 - basesize = 4 -type 'FLOAT, VEC3, BOX, array of 2' - c_str "box3" - basetype BASETYPE.FLOAT - aggregate AGGREGATE.VEC3 - vecsemantics VECSEMANTICS.BOX - arraylen 2 - str(t) = "box3" - size = 24 - elementtype = box3 - numelements = 2 - basevalues = 6 - elementsize = 12 - basesize = 4 - -type 'float[2]' - c_str "float[2]" - basetype BASETYPE.FLOAT - aggregate AGGREGATE.SCALAR - vecsemantics VECSEMANTICS.NOXFORM - arraylen 2 - str(t) = "float[2]" - size = 8 - elementtype = float - numelements = 2 - basevalues = 2 - elementsize = 4 - basesize = 4 -type 'normal' - c_str "normal" - basetype BASETYPE.FLOAT - aggregate AGGREGATE.VEC3 - vecsemantics VECSEMANTICS.NORMAL - arraylen 0 - str(t) = "normal" - size = 12 - elementtype = normal - numelements = 1 - basevalues = 3 - elementsize = 12 - basesize = 4 -type 'uint16' - c_str "uint16" - basetype BASETYPE.UINT16 - aggregate AGGREGATE.SCALAR - vecsemantics VECSEMANTICS.NOXFORM - arraylen 0 - str(t) = "uint16" - size = 2 - elementtype = uint16 - numelements = 1 - basevalues = 1 - elementsize = 2 - basesize = 2 -type 'box3' - c_str "box3" - basetype BASETYPE.FLOAT - aggregate AGGREGATE.VEC3 - vecsemantics VECSEMANTICS.BOX - arraylen 2 - str(t) = "box3" - size = 24 - elementtype = box3 - numelements = 2 - basevalues = 6 - elementsize = 12 - basesize = 4 - -uint8 == uint8? True -uint8 == uint8? True -uint8 == uint16 False -uint8 != uint8? False -uint8 != uint8? False -uint8 != uint16 True -vector == color False -vector.equivalent(color) True -equivalent(vector,color) True -vector.equivalent(float) False -equivalent(vector,float) False - -type 'TypeFloat' - c_str "float" -type 'TypeColor' - c_str "color" -type 'TypeString' - c_str "string" -type 'TypeInt' - c_str "int" -type 'TypePoint' - c_str "point" -type 'TypeVector' - c_str "vector" -type 'TypeNormal' - c_str "normal" -type 'TypeMatrix' - c_str "matrix" -type 'TypeMatrix33' - c_str "matrix33" -type 'TypeMatrix44' - c_str "matrix" -type 'TypeTimeCode' - c_str "timecode" -type 'TypeKeyCode' - c_str "keycode" -type 'TypeRational' - c_str "rational2i" -type 'TypeFloat2' - c_str "float2" -type 'TypeVector2' - c_str "vector2" -type 'TypeFloat4' - c_str "float4" -type 'TypeVector4' - c_str "float4" -type 'TypeVector2i' - c_str "int2" -type 'TypeVector3i' - c_str "int3" -type 'TypeHalf' - c_str "half" - -type 'TypeFloat' - c_str "float" -type 'TypeColor' - c_str "color" -type 'TypeString' - c_str "string" -type 'TypeInt' - c_str "int" -type 'TypeUInt' - c_str "uint" -type 'TypeInt64' - c_str "int64" -type 'TypeUInt64' - c_str "uint64" -type 'TypeInt32' - c_str "int" -type 'TypeUInt32' - c_str "uint" -type 'TypeInt16' - c_str "int16" -type 'TypeUInt16' - c_str "uint16" -type 'TypeInt8' - c_str "int8" -type 'TypeUInt8' - c_str "uint8" -type 'TypePoint' - c_str "point" -type 'TypeVector' - c_str "vector" -type 'TypeNormal' - c_str "normal" -type 'TypeMatrix' - c_str "matrix" -type 'TypeMatrix33' - c_str "matrix33" -type 'TypeMatrix44' - c_str "matrix" -type 'TypeTimeCode' - c_str "timecode" -type 'TypeKeyCode' - c_str "keycode" -type 'TypeFloat2' - c_str "float2" -type 'TypeVector2' - c_str "vector2" -type 'TypeFloat4' - c_str "float4" -type 'TypeVector4' - c_str "float4" -type 'TypeVector2i' - c_str "vector2i" -type 'TypeVector3i' - c_str "vector3i" -type 'TypeHalf' - c_str "half" -type 'TypeRational' - c_str "rational2i" -type 'TypeUInt' - c_str "uint" - -Done. diff --git a/testsuite/python-typedesc/ref/out.txt b/testsuite/python-typedesc/ref/out.txt index ad3e858f99..fdebc0829d 100644 --- a/testsuite/python-typedesc/ref/out.txt +++ b/testsuite/python-typedesc/ref/out.txt @@ -159,47 +159,6 @@ equivalent(vector,color) True vector.equivalent(float) False equivalent(vector,float) False -type 'TypeFloat' - c_str "float" -type 'TypeColor' - c_str "color" -type 'TypeString' - c_str "string" -type 'TypeInt' - c_str "int" -type 'TypePoint' - c_str "point" -type 'TypeVector' - c_str "vector" -type 'TypeNormal' - c_str "normal" -type 'TypeMatrix' - c_str "matrix" -type 'TypeMatrix33' - c_str "matrix33" -type 'TypeMatrix44' - c_str "matrix" -type 'TypeTimeCode' - c_str "timecode" -type 'TypeKeyCode' - c_str "keycode" -type 'TypeRational' - c_str "rational2i" -type 'TypeFloat2' - c_str "float2" -type 'TypeVector2' - c_str "vector2" -type 'TypeFloat4' - c_str "float4" -type 'TypeVector4' - c_str "float4" -type 'TypeVector2i' - c_str "vector2i" -type 'TypeVector3i' - c_str "vector3i" -type 'TypeHalf' - c_str "half" - type 'TypeFloat' c_str "float" type 'TypeColor' diff --git a/testsuite/python-typedesc/src/test_typedesc.py b/testsuite/python-typedesc/src/test_typedesc.py index 8a788efb1b..45693e6700 100755 --- a/testsuite/python-typedesc/src/test_typedesc.py +++ b/testsuite/python-typedesc/src/test_typedesc.py @@ -140,29 +140,6 @@ def breakdown_test(t, name="", verbose=True): print ("equivalent(vector,float)", oiio.TypeDesc.equivalent(oiio.TypeDesc("vector"), oiio.TypeDesc("float"))) print ("") - # DEPRECATED(1.8): Test the static data member types of pre-constructed types - breakdown_test (oiio.TypeDesc.TypeFloat, "TypeFloat", verbose=False) - breakdown_test (oiio.TypeDesc.TypeColor, "TypeColor", verbose=False) - breakdown_test (oiio.TypeDesc.TypeString, "TypeString", verbose=False) - breakdown_test (oiio.TypeDesc.TypeInt, "TypeInt", verbose=False) - breakdown_test (oiio.TypeDesc.TypePoint, "TypePoint", verbose=False) - breakdown_test (oiio.TypeDesc.TypeVector, "TypeVector", verbose=False) - breakdown_test (oiio.TypeDesc.TypeNormal, "TypeNormal", verbose=False) - breakdown_test (oiio.TypeDesc.TypeMatrix, "TypeMatrix", verbose=False) - breakdown_test (oiio.TypeDesc.TypeMatrix33, "TypeMatrix33", verbose=False) - breakdown_test (oiio.TypeDesc.TypeMatrix44, "TypeMatrix44", verbose=False) - breakdown_test (oiio.TypeDesc.TypeTimeCode, "TypeTimeCode", verbose=False) - breakdown_test (oiio.TypeDesc.TypeKeyCode, "TypeKeyCode", verbose=False) - breakdown_test (oiio.TypeDesc.TypeRational, "TypeRational", verbose=False) - breakdown_test (oiio.TypeDesc.TypeFloat2, "TypeFloat2", verbose=False) - breakdown_test (oiio.TypeDesc.TypeVector2, "TypeVector2", verbose=False) - breakdown_test (oiio.TypeDesc.TypeFloat4, "TypeFloat4", verbose=False) - breakdown_test (oiio.TypeDesc.TypeVector4, "TypeVector4", verbose=False) - breakdown_test (oiio.TypeDesc.TypeVector2i, "TypeVector2i", verbose=False) - breakdown_test (oiio.TypeDesc.TypeVector3i, "TypeVector3i", verbose=False) - breakdown_test (oiio.TypeDesc.TypeHalf, "TypeHalf", verbose=False) - print ("") - # Test the pre-constructed types breakdown_test (oiio.TypeFloat, "TypeFloat", verbose=False) breakdown_test (oiio.TypeColor, "TypeColor", verbose=False)