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/LibJXR/jxrgluelib/JXRGluePFC.c view on Meta::CPAN
}
static U16 Convert_Float_To_Half(float f)
{
// 1s5e10m -> 1s8e23m
const U32 iFloat = *(U32*)&f; // Convert float to U32
if (f != f)
{
return (U16)(iFloat | HLF_QNaN_BITZS); // +QNaN, -QNaN
}
else if (f < -HLF_MAX)
{
return HLF_MAX_BITS_NEG;
}
else if (HLF_MAX < f)
{
return HLF_MAX_BITS;
}
else if (-HLF_MIN < f && f < HLF_MIN)
src/Source/OpenEXR/Copyrights/openexr/ChangeLog view on Meta::CPAN
(Florian Kainz)
Version 1.6.0:
* Bumped DSO version number to 6.0
(Florian Kainz)
* Added new standard attributes related to color rendering with
CTL (Color Transformation Language): renderingTransform,
lookModTransform and adoptedNeutral.
(Florian Kainz)
* Bug fix: for pixels with luminance near HALF_MIN, conversion
from RGB to luminance/chroma produces NaNs and infinities
(Florian Kainz)
* Bug fix: excessive desaturation of small details with certain
colors after repeatedly loading and saving luminance/chroma
encoded images with B44 compression.
(Florian Kainz)
* Added B44A compression, a minor variation of B44: in most cases,
the compression ratio is 2.28:1, the same as with B44, but in
uniform image areas where all pixels have the same value, the
compression ratio increases to 10.66:1. Uniform areas occur, for
example, in an image's alpha channel, which typically contains
src/Source/OpenEXR/Copyrights/openexr/ChangeLog view on Meta::CPAN
images with subsampled chroma channels. When an image
is written with the RGBA convenience interface, selecting
WRITE_YCA instead of WRITE_RGBA causes the library to
convert the pixels to YCA format. If WRITE_Y is selected,
only luminance is stored in the file (for black and white
images). When an image file is read with the RGBA convenience
interface, YCA data are automatically converted back to RGBA.
(Florian Kainz)
* IlmImf: speed up reading tiled files as scan lines.
(Florian Kainz)
* Half: Fixed subtle bug in Half where signaling float NaNs
were being converted to inf in half. (Florian Kainz)
* gcc 3.3 compiler warning cleanups. (various)
* Imath: ImathEuler.h fixes for gcc 3.4. (Garrick Meeker)
Version 1.1.0:
* Added new targets to Visual C++ .NET 2003 project
for exrmaketiled, exrenvmap, exrmakepreview, and exrstdattr.
(Drew Hess)
* A few assorted Win32 fixes for Imath. (Drew Hess)
* GNU autoconf builds now produce versioned libraries.
src/Source/OpenEXR/Copyrights/openexr/ChangeLog view on Meta::CPAN
(Francesco Callari)
* Imath: major quaternions cleanup. (Cary Phillips)
* Imath: added GLBegin, GLPushAttrib, GLPushMatrix objects
for automatic cleanup on exceptions. (Cary Phillips)
* Imath: removed implicit scalar->vector promotions and vector
comparisons. (Nick Rasmussen)
Version 1.0.7:
* Fixed a typo in one of the IlmImfTest tests. (Paul Schneider)
* Fixed a bug in exrdisplay that causes the image to display
as all black if there's a NaN or infinity in an OpenEXR
image. (Florian Kainz)
* Updated exrheader per recent changes to IlmImf library.
(Florian Kainz)
* Changed an errant float to a T in ImathFrame.h nextFrame().
(Cary Phillips)
* Support for new "optional standard" attributes
(chromaticities, luminance, comments, etc.).
(Florian Kainz, Greg Ward, Joseph Goldstone)
* Fixed a buffer overrun in ImfOpaqueAttribute. (Paul Schneider)
* Added new function, isImfMagic (). (Florian Kainz)
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/ImfB44Compressor.cpp view on Meta::CPAN
//
//
// Integers s[0] ... s[15] represent floating-point numbers
// in what is essentially a sign-magnitude format. Convert
// s[0] .. s[15] into a new set of integers, t[0] ... t[15],
// such that if t[i] is greater than t[j], the floating-point
// number that corresponds to s[i] is always greater than
// the floating-point number that corresponds to s[j].
//
// Also, replace any bit patterns that represent NaNs or
// infinities with bit patterns that represent floating-point
// zeroes.
//
// bit pattern floating-point bit pattern
// in s[i] value in t[i]
//
// 0x7fff NAN 0x8000
// 0x7ffe NAN 0x8000
// ... ...
// 0x7c01 NAN 0x8000
src/Source/OpenEXR/IlmImf/ImfConvert.h view on Meta::CPAN
// Conversion from half or float to unsigned int:
//
// input result
// ---------------------------------------------------
//
// finite, >= 0 input, cast to unsigned int
// (rounds towards zero)
//
// finite, < 0 0
//
// NaN 0
//
// +infinity UINT_MAX
//
// -infinity 0
//
//---------------------------------------------------------
IMF_EXPORT unsigned int halfToUint (half h);
IMF_EXPORT unsigned int floatToUint (float f);
src/Source/OpenEXR/IlmImf/ImfConvert.h view on Meta::CPAN
// input result
// ---------------------------------------------------
//
// finite, closest possible half
// magnitude <= HALF_MAX
//
// finite, > HALF_MAX +infinity
//
// finite, < -HALF_MAX -infinity
//
// NaN NaN
//
// +infinity +infinity
//
// -infinity -infinity
//
//---------------------------------------------------------
IMF_EXPORT half uintToHalf (unsigned int ui);
IMF_EXPORT half floatToHalf (float f);
src/Source/OpenEXR/IlmImf/ImfDwaCompressor.cpp view on Meta::CPAN
}
//
// RLE the zig-zag of the AC components + copy over
// into another tmp buffer
//
// Try to do a simple RLE scheme to reduce run's of 0's. This
// differs from the jpeg EOB case, since EOB just indicates that
// the rest of the block is zero. In our case, we have lots of
// NaN symbols, which shouldn't be allowed to occur in DCT
// coefficents - so we'll use them for encoding runs.
//
// If the high byte is 0xff, then we have a run of 0's, of length
// given by the low byte. For example, 0xff03 would be a run
// of 3 0's, starting at the current location.
//
// block is our block of 64 coefficients
// acPtr a pointer to back the RLE'd values into.
//
// This will advance the counter, _numAcComp.
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);
src/Source/OpenEXR/IlmImf/dwaLookups.cpp view on Meta::CPAN
float logBase = pow(2.7182818, 2.2);
usXdr = i;
{
const char *tmp = (char *)(&usXdr);
Xdr::read<CharPtrIO>(tmp, usNative);
}
// map NaN and inf to 0
if ((usNative & 0x7c00) == 0x7c00) {
toNonlinear[i] = 0;
continue;
}
//
// toNonlinear - assume i is XDR
//
h.setBits(usNative);
sign = 1;
src/Source/OpenEXR/Imath/ImathFun.h view on Meta::CPAN
//
//----------------------------------------------------------
IMATH_EXPORT float succf (float f);
IMATH_EXPORT float predf (float f);
IMATH_EXPORT double succd (double d);
IMATH_EXPORT double predd (double d);
//
// Return true if the number is not a NaN or Infinity.
//
inline bool
finitef (float f)
{
union {float f; int i;} u;
u.f = f;
return (u.i & 0x7f800000) != 0x7f800000;
}