Skip to content

Commit

Permalink
Add missing namespace macros
Browse files Browse the repository at this point in the history
To properly support custom namespaces, all namespace references should
use the appropriate macros, not hard-coded literals.

Signed-off-by: Cary Phillips <[email protected]>
  • Loading branch information
cary-ilm committed Nov 7, 2024
1 parent 1a5f8da commit 249996b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/bin/exrmanifest/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/bin/exrmetrics/exrmetrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
#include <vector>
#include <sys/stat.h>

using namespace Imf;
using Imath::Box2i;
using namespace OPENEXR_IMF_NAMESPACE;
using IMATH_NAMESPACE::Box2i;

using std::cerr;
using namespace std::chrono;
Expand Down Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/bin/exrmetrics/exrmetrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/lib/OpenEXR/ImfInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ());
Expand Down
4 changes: 2 additions & 2 deletions website/src/previewImageExamples.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -60,7 +60,7 @@ makePreviewImage (
outPixel.r = gamma (inPixel.r);
outPixel.g = gamma (inPixel.g);
outPixel.b = gamma (inPixel.b);
outPixel.a = static_cast<int> (Imath::clamp (inPixel.a * 255.f, 0.f, 255.f) + 0.5f);
outPixel.a = static_cast<int> (IMATH_NAMESPACE::clamp (inPixel.a * 255.f, 0.f, 255.f) + 0.5f);
}
}
}
Expand Down

0 comments on commit 249996b

Please sign in to comment.