Alien-FreeImage
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
src/Source/LibJXR/jxrgluelib/JXRGluePFC.c view on Meta::CPAN
//================================================================
#define HLF_MIN 0.00006103515625f
#define HLF_MAX 65504.0f
#define HLF_MIN_BITS 0x0400
#define HLF_MAX_BITS 0x7bff
#define HLF_MIN_BITS_NEG (HLF_MIN_BITS | 0x8000)
#define HLF_MAX_BITS_NEG (HLF_MAX_BITS | 0x8000)
#define HLF_QNaN_BITZS 0x7fff
// simple and slow implementation of half <-> float conversion
static U32 Convert_Half_To_Float(U16 u16)
{
// 1s5e10m -> 1s8e23m
const U32 s = (u16 >> 15) & 0x0001;
const U32 e = (u16 >> 10) & 0x001f;
const U32 m = (u16 >> 0) & 0x03ff;
if (0 == e) // 0, denorm
src/Source/OpenEXR/Half/halfLimits.h view on Meta::CPAN
static const int radix = HALF_RADIX;
static half epsilon () throw () {return HALF_EPSILON;}
static half round_error () throw () {return HALF_EPSILON / 2;}
static const int min_exponent = HALF_MIN_EXP;
static const int min_exponent10 = HALF_MIN_10_EXP;
static const int max_exponent = HALF_MAX_EXP;
static const int max_exponent10 = HALF_MAX_10_EXP;
static const bool has_infinity = true;
static const bool has_quiet_NaN = true;
static const bool has_signaling_NaN = true;
static const float_denorm_style has_denorm = denorm_present;
static const bool has_denorm_loss = false;
static half infinity () throw () {return half::posInf();}
static half quiet_NaN () throw () {return half::qNan();}
static half signaling_NaN () throw () {return half::sNan();}
static half denorm_min () throw () {return HALF_MIN;}
static const bool is_iec559 = false;
static const bool is_bounded = false;
static const bool is_modulo = false;
static const bool traps = true;
static const bool tinyness_before = false;
static const float_round_style round_style = round_to_nearest;
};
src/Source/OpenEXR/IexMath/IexMathFloatExc.h view on Meta::CPAN
}
~MathExcOn ()
{
if (_changed)
mathExcOn (_saved);
}
// It is possible for functions to set the exception registers
// yet not trigger a SIGFPE. Specifically, the implementation
// of pow(x, y) we're using can generates a NaN from a negative x
// and fractional y but a SIGFPE is not generated.
// This function examimes the exception registers and calls the
// fpHandler if those registers modulo the exception mask are set.
// It should be called wherever this class is commonly used where it has
// been found that certain floating point exceptions are not being thrown.
void handleOutstandingExceptions();
private:
src/Source/OpenEXR/IlmImf/ImfB44Compressor.cpp view on Meta::CPAN
//
// means that r[8] is the difference between t[5] and t[6].
//
// - optionally, a 4-by-4 pixel block where all pixels have the
// same value can be treated as a special case, where the
// compressed block contains only 3 instead of 14 bytes:
// t[0], followed by an "impossible" 6-bit shift value and
// two padding bits.
//
// This compressor can handle positive and negative pixel values.
// NaNs and infinities are replaced with zeroes before compression.
//
//-----------------------------------------------------------------------------
#include "ImfB44Compressor.h"
#include "ImfHeader.h"
#include "ImfChannelList.h"
#include "ImfMisc.h"
#include "ImfCheckedArithmetic.h"
#include <ImathFun.h>
#include <ImathBox.h>
src/Source/OpenEXR/IlmImf/ImfRational.cpp view on Meta::CPAN
{
sign = 1; // positive
}
else if (x < 0)
{
sign = -1; // negative
x = -x;
}
else
{
n = 0; // NaN
d = 0;
return;
}
if (x >= (1U << 31) - 0.5)
{
n = sign; // infinity
d = 0;
return;
}
src/Source/OpenEXR/IlmImf/ImfRational.h view on Meta::CPAN
//-----------------------------------------------------------------------------
//
// Rational numbers
//
// A rational number is represented as pair of integers, n and d.
// The value of of the rational number is
//
// n/d for d > 0
// positive infinity for n > 0, d == 0
// negative infinity for n < 0, d == 0
// not a number (NaN) for n == 0, d == 0
//
//-----------------------------------------------------------------------------
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
class IMF_EXPORT Rational
{
public:
src/Source/OpenEXR/IlmImf/dwaLookups.cpp view on Meta::CPAN
{
unsigned short toLinear[65536];
toLinear[0] = 0;
for (int i=1; i<65536; ++i) {
half h;
float sign = 1;
float logBase = pow(2.7182818, 2.2);
// map NaN and inf to 0
if ((i & 0x7c00) == 0x7c00) {
toLinear[i] = 0;
continue;
}
//
// _toLinear - assume i is NATIVE, but our output needs
// to get flipped to XDR
//
h.setBits(i);
view all matches for this distributionview release on metacpan - search on metacpan
( run in 0.552 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )