From 249996bef2b955486bc78c1f10d384183cfa25ba Mon Sep 17 00:00:00 2001 From: Cary Phillips Date: Thu, 7 Nov 2024 11:18:01 -0800 Subject: [PATCH] Add missing namespace macros To properly support custom namespaces, all namespace references should use the appropriate macros, not hard-coded literals. Signed-off-by: Cary Phillips --- src/bin/exrmanifest/main.cpp | 2 +- src/bin/exrmetrics/exrmetrics.cpp | 6 +++--- src/bin/exrmetrics/exrmetrics.h | 2 +- src/lib/OpenEXR/ImfInputFile.cpp | 2 +- website/src/previewImageExamples.cpp | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bin/exrmanifest/main.cpp b/src/bin/exrmanifest/main.cpp index a0661c49db..384be5bc56 100644 --- a/src/bin/exrmanifest/main.cpp +++ b/src/bin/exrmanifest/main.cpp @@ -135,7 +135,7 @@ printManifest (const char fileName[]) if (in.parts () > 1) { cout << fileName << " part " << part << ":\n"; } if (hasIDManifest (in.header (part))) { - const Imf::CompressedIDManifest& mfst = + const OPENEXR_IMF_NAMESPACE::CompressedIDManifest& mfst = idManifest (in.header (part)); size_t size = dumpManifest (mfst); cout << "raw text size : " << size << endl; diff --git a/src/bin/exrmetrics/exrmetrics.cpp b/src/bin/exrmetrics/exrmetrics.cpp index 702875ea2d..d3985272bb 100644 --- a/src/bin/exrmetrics/exrmetrics.cpp +++ b/src/bin/exrmetrics/exrmetrics.cpp @@ -30,8 +30,8 @@ #include #include -using namespace Imf; -using Imath::Box2i; +using namespace OPENEXR_IMF_NAMESPACE; +using IMATH_NAMESPACE::Box2i; using std::cerr; using namespace std::chrono; @@ -462,7 +462,7 @@ exrmetrics ( const char inFileName[], const char outFileName[], int part, - Imf::Compression compression, + OPENEXR_IMF_NAMESPACE::Compression compression, float level, int halfMode) { diff --git a/src/bin/exrmetrics/exrmetrics.h b/src/bin/exrmetrics/exrmetrics.h index 8a97085ddc..fac98ee932 100644 --- a/src/bin/exrmetrics/exrmetrics.h +++ b/src/bin/exrmetrics/exrmetrics.h @@ -14,7 +14,7 @@ void exrmetrics ( const char inFileName[], const char outFileName[], int part, - Imf::Compression compression, + OPENEXR_IMF_NAMESPACE::Compression compression, float level, int halfMode); #endif diff --git a/src/lib/OpenEXR/ImfInputFile.cpp b/src/lib/OpenEXR/ImfInputFile.cpp index f643ea920c..bbf98d962b 100644 --- a/src/lib/OpenEXR/ImfInputFile.cpp +++ b/src/lib/OpenEXR/ImfInputFile.cpp @@ -69,7 +69,7 @@ struct InputFile::Data else { THROW ( - Iex::ArgExc, + IEX_NAMESPACE::ArgExc, "Invalid out of bounds part number " << part << ", only " << pc << " parts in " << _ctxt->fileName ()); diff --git a/website/src/previewImageExamples.cpp b/website/src/previewImageExamples.cpp index 125cd22213..a0e575239d 100644 --- a/website/src/previewImageExamples.cpp +++ b/website/src/previewImageExamples.cpp @@ -28,7 +28,7 @@ unsigned char gamma (float x) { x = pow (5.5555f * max (0.f, x), 0.4545f) * 84.66f; - return (unsigned char) Imath::clamp (x, 0.f, 255.f); + return (unsigned char) IMATH_NAMESPACE::clamp (x, 0.f, 255.f); } // [end gamma] @@ -60,7 +60,7 @@ makePreviewImage ( outPixel.r = gamma (inPixel.r); outPixel.g = gamma (inPixel.g); outPixel.b = gamma (inPixel.b); - outPixel.a = static_cast (Imath::clamp (inPixel.a * 255.f, 0.f, 255.f) + 0.5f); + outPixel.a = static_cast (IMATH_NAMESPACE::clamp (inPixel.a * 255.f, 0.f, 255.f) + 0.5f); } } }