Normalize line endings and whitespace
This commit is contained in:

committed by
Andrey Kamaev

parent
0442bca235
commit
81f826db2b
62
3rdparty/openexr/Half/halfFunction.h
vendored
62
3rdparty/openexr/Half/halfFunction.h
vendored
@@ -2,9 +2,9 @@
|
||||
//
|
||||
// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
|
||||
// Digital Ltd. LLC
|
||||
//
|
||||
//
|
||||
// All rights reserved.
|
||||
//
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without
|
||||
// modification, are permitted provided that the following conditions are
|
||||
// met:
|
||||
@@ -16,8 +16,8 @@
|
||||
// distribution.
|
||||
// * Neither the name of Industrial Light & Magic nor the names of
|
||||
// its contributors may be used to endorse or promote products derived
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// from this software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
@@ -86,9 +86,9 @@
|
||||
#include "half.h"
|
||||
|
||||
#include <IlmBaseConfig.h>
|
||||
#ifndef ILMBASE_HAVE_LARGE_STACK
|
||||
#ifndef ILMBASE_HAVE_LARGE_STACK
|
||||
#include <string.h> // need this for memset
|
||||
#else
|
||||
#else
|
||||
#endif
|
||||
|
||||
#include <float.h>
|
||||
@@ -105,17 +105,17 @@ class halfFunction
|
||||
|
||||
template <class Function>
|
||||
halfFunction (Function f,
|
||||
half domainMin = -HALF_MAX,
|
||||
half domainMax = HALF_MAX,
|
||||
T defaultValue = 0,
|
||||
T posInfValue = 0,
|
||||
T negInfValue = 0,
|
||||
T nanValue = 0);
|
||||
half domainMin = -HALF_MAX,
|
||||
half domainMax = HALF_MAX,
|
||||
T defaultValue = 0,
|
||||
T posInfValue = 0,
|
||||
T negInfValue = 0,
|
||||
T nanValue = 0);
|
||||
|
||||
#ifndef ILMBASE_HAVE_LARGE_STACK
|
||||
~halfFunction () { delete [] _lut; }
|
||||
~halfFunction () { delete [] _lut; }
|
||||
#endif
|
||||
|
||||
|
||||
//-----------
|
||||
// Evaluation
|
||||
//-----------
|
||||
@@ -138,31 +138,31 @@ class halfFunction
|
||||
template <class T>
|
||||
template <class Function>
|
||||
halfFunction<T>::halfFunction (Function f,
|
||||
half domainMin,
|
||||
half domainMax,
|
||||
T defaultValue,
|
||||
T posInfValue,
|
||||
T negInfValue,
|
||||
T nanValue)
|
||||
half domainMin,
|
||||
half domainMax,
|
||||
T defaultValue,
|
||||
T posInfValue,
|
||||
T negInfValue,
|
||||
T nanValue)
|
||||
{
|
||||
#ifndef ILMBASE_HAVE_LARGE_STACK
|
||||
_lut = new T[1<<16];
|
||||
memset (_lut, 0 , (1<<16) * sizeof(T));
|
||||
#endif
|
||||
|
||||
|
||||
for (int i = 0; i < (1 << 16); i++)
|
||||
{
|
||||
half x;
|
||||
x.setBits (i);
|
||||
half x;
|
||||
x.setBits (i);
|
||||
|
||||
if (x.isNan())
|
||||
_lut[i] = nanValue;
|
||||
else if (x.isInfinity())
|
||||
_lut[i] = x.isNegative()? negInfValue: posInfValue;
|
||||
else if (x < domainMin || x > domainMax)
|
||||
_lut[i] = defaultValue;
|
||||
else
|
||||
_lut[i] = f (x);
|
||||
if (x.isNan())
|
||||
_lut[i] = nanValue;
|
||||
else if (x.isInfinity())
|
||||
_lut[i] = x.isNegative()? negInfValue: posInfValue;
|
||||
else if (x < domainMin || x > domainMax)
|
||||
_lut[i] = defaultValue;
|
||||
else
|
||||
_lut[i] = f (x);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user