Skip to content

Commit

Permalink
fix clang -Wnan-infinity-disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkautarch committed Jul 7, 2024
1 parent 2aa5e5a commit 5e5671d
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/color_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <fstream>
#include <string>
#include <vector>
#include <limits>

#include <glm/vec2.hpp>
#include <glm/vec3.hpp>
Expand Down Expand Up @@ -356,14 +357,6 @@ struct lut3d_t

bool LoadCubeLut( lut3d_t * lut3d, const char * filename );

using transformerFunc_t =
void (*)(lut1d_t *, int,
lut3d_t *,
const displaycolorimetry_t &, EOTF,
const displaycolorimetry_t &, EOTF,
const glm::vec2 &, EChromaticAdaptationMethod,
const colormapping_t &, const nightmode_t &, const tonemapping_t &,
const lut3d_t *, float);
// Build colorimetry and a gamut mapping for the given SDR configuration
// Note: the output colorimetry will use the native display's white point
// Only the color gamut will change
Expand Down Expand Up @@ -669,7 +662,11 @@ inline void lerp_rgb(float* out, const float* a, const float* b, const float* c,

inline float ClampAndSanitize( float a, float min, float max )
{
#ifndef __FAST_MATH__
return std::isfinite( a ) ? std::min(std::max(min, a), max) : min;
#else
return std::min(std::max(min, a), max);
#endif
}

// Adapted from:
Expand Down

0 comments on commit 5e5671d

Please sign in to comment.