Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
Signed-off-by: Kimball Thurston <[email protected]>
  • Loading branch information
kdt3rd committed Mar 17, 2024
1 parent 915cb81 commit 84f58b8
Show file tree
Hide file tree
Showing 165 changed files with 3,719 additions and 3,624 deletions.
45 changes: 9 additions & 36 deletions Contrib/DtexToExr/DtexToExr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ ConvertDtexFile (
PXDU_THROW (
"error (" << dtexOpenError << " opening file: " << i_fileName);
}
else
{
PXDU_THROW ("missing file: " << i_fileName);
}
else { PXDU_THROW ("missing file: " << i_fileName); }
}

// Just handling the first image in the Dtex file for now.
Expand Down Expand Up @@ -438,34 +435,13 @@ ParseArguments (
}
o_exrFileName = arg;
}
else if (arg == "--deepOpacity")
{
o_params.deepOpacity = true;
}
else if (arg == "--deepAlpha")
{
o_params.deepOpacity = false;
}
else if (arg == "--discrete")
{
o_params.discrete = true;
}
else if (arg == "--continuous")
{
o_params.discrete = false;
}
else if (arg == "--full")
{
o_full = true;
}
else if (arg == "--half")
{
o_full = false;
}
else if (arg == "--multRgb")
{
o_params.multiplyColorByAlpha = true;
}
else if (arg == "--deepOpacity") { o_params.deepOpacity = true; }
else if (arg == "--deepAlpha") { o_params.deepOpacity = false; }
else if (arg == "--discrete") { o_params.discrete = true; }
else if (arg == "--continuous") { o_params.discrete = false; }
else if (arg == "--full") { o_full = true; }
else if (arg == "--half") { o_full = false; }
else if (arg == "--multRgb") { o_params.multiplyColorByAlpha = true; }
else if (arg == "--sideways")
{
if (argi <= argc - 1)
Expand Down Expand Up @@ -493,10 +469,7 @@ ParseArguments (
"Invalid parameter for --sideways: " << argv[argi + 1]);
}
}
else
{
o_params.sideways = true;
}
else { o_params.sideways = true; }
}
else if (arg == "--compressionError")
{
Expand Down
10 changes: 2 additions & 8 deletions Contrib/DtexToExr/PxBaseDeepHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,8 @@ struct Span
bool operator< (const Span& i_other) const
{
if (in < i_other.in) { return true; }
else if (in == i_other.in)
{
return index < i_other.index;
}
else
{
return false;
}
else if (in == i_other.in) { return index < i_other.index; }
else { return false; }
}
};

Expand Down
20 changes: 4 additions & 16 deletions Contrib/DtexToExr/PxDeepUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ DensityFromVizDz (double i_viz, double i_dz)
{
double d = -log (i_viz) / i_dz;
if (!isfinite (d)) { return PXDU_DENSITY_OF_VIZ_0; }
else
{
return d;
}
else { return d; }
}
}

Expand Down Expand Up @@ -77,10 +74,7 @@ DensityTimesDzFromViz (double i_viz)
{
double d = -log (i_viz);
if (!isfinite (d)) { return PXDU_DENSITY_OF_VIZ_0 * PXDU_DZ_OF_VIZ_0; }
else
{
return d;
}
else { return d; }
}
}

Expand Down Expand Up @@ -115,19 +109,13 @@ DzFromVizDensity (double i_viz, double i_density)
// This whole part is hacky at best.
double dz = -log (i_viz) / PXDU_MIN_NON_ZERO_DENSITY;
if (!isfinite (dz)) { return PXDU_MAX_DZ; }
else
{
return dz;
}
else { return dz; }
}
else
{
double dz = -log (i_viz) / i_density;
if (!isfinite (dz)) { return PXDU_MAX_DZ; }
else
{
return dz;
}
else { return dz; }
}
}

Expand Down
5 changes: 1 addition & 4 deletions Contrib/DtexToExr/PxDeepUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,10 +287,7 @@ inline T
ZeroNAN (T i_f)
{
if (!isfinite (i_f)) { return (T) 0; }
else
{
return i_f;
}
else { return i_f; }
}

//-*****************************************************************************
Expand Down
61 changes: 31 additions & 30 deletions src/bin/exr2aces/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,34 @@ usageMessage (ostream& stream, const char* program_name, bool verbose = false)
stream << "Usage: " << program_name << " [options] infile outfile" << endl;

if (verbose)
stream << "\n"
"Read an OpenEXR file from infile and save the contents\n"
"in ACES image file outfile.\n"
"\n"
"The ACES image file format is a subset of the OpenEXR file\n"
"format. ACES image files are restricted as follows:\n"
"\n"
" * Images are stored as scanlines; tiles are not allowed.\n"
" * Images contain three color channels, either:\n"
" R, G, B (red, green, blue)\n"
" or:\n"
" Y, RY, BY (luminance, sub-sampled chroma)\n"
" * Images may optionally contain an alpha channel.\n"
" * Only three compression types are allowed:\n"
" NO_COMPRESSION (file is not compressed)\n"
" PIZ_COMPRESSION (lossless)\n"
" B44A_COMPRESSION (lossy)\n"
" * The \"chromaticities\" header attribute must specify\n"
" the ACES RGB primaries and white point.\n"
"\n"
"Options:\n"
" -v, --verbose verbose mode\n"
" -h, --help print this message\n"
" --version print version information\n"
"\n"
"Report bugs via https://github.com/AcademySoftwareFoundation/openexr/issues or email [email protected]\n"
"";
stream
<< "\n"
"Read an OpenEXR file from infile and save the contents\n"
"in ACES image file outfile.\n"
"\n"
"The ACES image file format is a subset of the OpenEXR file\n"
"format. ACES image files are restricted as follows:\n"
"\n"
" * Images are stored as scanlines; tiles are not allowed.\n"
" * Images contain three color channels, either:\n"
" R, G, B (red, green, blue)\n"
" or:\n"
" Y, RY, BY (luminance, sub-sampled chroma)\n"
" * Images may optionally contain an alpha channel.\n"
" * Only three compression types are allowed:\n"
" NO_COMPRESSION (file is not compressed)\n"
" PIZ_COMPRESSION (lossless)\n"
" B44A_COMPRESSION (lossy)\n"
" * The \"chromaticities\" header attribute must specify\n"
" the ACES RGB primaries and white point.\n"
"\n"
"Options:\n"
" -v, --verbose verbose mode\n"
" -h, --help print this message\n"
" --version print version information\n"
"\n"
"Report bugs via https://github.com/AcademySoftwareFoundation/openexr/issues or email [email protected]\n"
"";
}

void
Expand Down Expand Up @@ -154,10 +155,10 @@ main (int argc, char** argv)
}
else if (!strcmp (argv[i], "--version"))
{
const char* libraryVersion = getLibraryVersion();
const char* libraryVersion = getLibraryVersion ();

cout << "exr2aces (OpenEXR) " << OPENEXR_VERSION_STRING;
if (strcmp(libraryVersion, OPENEXR_VERSION_STRING))
if (strcmp (libraryVersion, OPENEXR_VERSION_STRING))
cout << "(OpenEXR version " << libraryVersion << ")";
cout << " https://openexr.com" << endl;
cout << "Copyright (c) Contributors to the OpenEXR Project" << endl;
Expand Down
57 changes: 23 additions & 34 deletions src/bin/exrcheck/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,24 @@ using namespace std;
void
usageMessage (ostream& stream, const char* program_name, bool verbose = false)
{
stream << "Usage: " << program_name << " [options] imagefile [imagefile ...]\n";
stream << "Usage: " << program_name
<< " [options] imagefile [imagefile ...]\n";

if (verbose)
stream << "\n"
"Read exr files to validate their contents and the correct behavior of the software.\n"
"\n"
"Options:\n"
" -m avoid excessive memory allocation (some files will not be fully checked)\n"
" -t avoid spending excessive time (some files will not be fully checked)\n"
" -s use stream API instead of file API\n"
" -c add core library checks\n"
" -h, --help print this message\n"
" --version print version information\n"
"\n"
"Report bugs via https://github.com/AcademySoftwareFoundation/openexr/issues or email [email protected]\n"
"";
stream
<< "\n"
"Read exr files to validate their contents and the correct behavior of the software.\n"
"\n"
"Options:\n"
" -m avoid excessive memory allocation (some files will not be fully checked)\n"
" -t avoid spending excessive time (some files will not be fully checked)\n"
" -s use stream API instead of file API\n"
" -c add core library checks\n"
" -h, --help print this message\n"
" --version print version information\n"
"\n"
"Report bugs via https://github.com/AcademySoftwareFoundation/openexr/issues or email [email protected]\n"
"";
}

bool
Expand Down Expand Up @@ -126,26 +128,16 @@ main (int argc, char** argv)
// Header::setMaxTileSize();

reduceMemory = true;

}
else if (!strcmp (argv[i], "-t"))
{
reduceTime = true;
}
else if (!strcmp (argv[i], "-s"))
{
useStream = true;
}
else if (!strcmp (argv[i], "-c"))
{
enableCoreCheck = true;
}
else if (!strcmp (argv[i], "-t")) { reduceTime = true; }
else if (!strcmp (argv[i], "-s")) { useStream = true; }
else if (!strcmp (argv[i], "-c")) { enableCoreCheck = true; }
else if (!strcmp (argv[i], "--version"))
{
const char* libraryVersion = getLibraryVersion();
const char* libraryVersion = getLibraryVersion ();

cout << "exrcheck (OpenEXR) " << OPENEXR_VERSION_STRING;
if (strcmp(libraryVersion, OPENEXR_VERSION_STRING))
if (strcmp (libraryVersion, OPENEXR_VERSION_STRING))
cout << "(OpenEXR version " << libraryVersion << ")";
cout << " https://openexr.com" << endl;
cout << "Copyright (c) Contributors to the OpenEXR Project" << endl;
Expand Down Expand Up @@ -176,10 +168,7 @@ main (int argc, char** argv)
cout << "bad\n";
badFileFound = true;
}
else
{
cout << "OK\n";
}
else { cout << "OK\n"; }
}
}

Expand Down
Loading

0 comments on commit 84f58b8

Please sign in to comment.