merged improvements by Edgar
commit
915a672da1
|
@ -52,6 +52,17 @@
|
|||
#include <math.h>
|
||||
#pragma intrinsic(memset, memcmp, memcpy, strlen, strcmp, strcpy, _strset, strcat, fabs, abs)
|
||||
#endif
|
||||
|
||||
#if _MSC_VER >= 1600
|
||||
#ifdef SINGLE_PRECISION
|
||||
#pragma detect_mismatch( "MTS_FLOAT_PRECISION", "SINGLE")
|
||||
#elif DOUBLE_PRECISION
|
||||
#pragma detect_mismatch( "MTS_FLOAT_PRECISION", "DOUBLE")
|
||||
#endif
|
||||
#define MTS_STRINGIFY(s) #s
|
||||
#define MTS_XSTRINGIFY(s) MTS_STRINGIFY(s)
|
||||
#pragma detect_mismatch("MTS_SPECTRUM_SAMPLES", MTS_XSTRINGIFY(SPECTRUM_SAMPLES))
|
||||
#endif
|
||||
#elif defined(__APPLE__)
|
||||
#define __OSX__
|
||||
#elif defined(__linux)
|
||||
|
|
|
@ -348,7 +348,7 @@ public:
|
|||
m_storage = new ImageBlock(Bitmap::ESpectrumAlphaWeight, m_cropSize);
|
||||
} else {
|
||||
m_storage = new ImageBlock(Bitmap::EMultiSpectrumAlphaWeight, m_cropSize,
|
||||
NULL, SPECTRUM_SAMPLES * m_pixelFormats.size() + 2);
|
||||
NULL, (int) (SPECTRUM_SAMPLES * m_pixelFormats.size() + 2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ public:
|
|||
|
||||
proc->setPixelFormat(
|
||||
m_integrators.size() > 1 ? Bitmap::EMultiSpectrumAlphaWeight : Bitmap::ESpectrumAlphaWeight,
|
||||
m_integrators.size() * SPECTRUM_SAMPLES + 2, false);
|
||||
(int) (m_integrators.size() * SPECTRUM_SAMPLES + 2), false);
|
||||
|
||||
int integratorResID = sched->registerResource(this);
|
||||
proc->bindResource("integrator", integratorResID);
|
||||
|
|
|
@ -1399,7 +1399,10 @@ ref<Bitmap> Bitmap::convert(EPixelFormat pixelFormat,
|
|||
|
||||
ref<Bitmap> Bitmap::convertMultiSpectrumAlphaWeight(const std::vector<EPixelFormat> &pixelFormats,
|
||||
EComponentFormat componentFormat, const std::vector<std::string> &channelNames) const {
|
||||
ref<Bitmap> bitmap = new Bitmap(Bitmap::EMultiChannel, componentFormat, m_size, channelNames.size());
|
||||
if (channelNames.size() > std::numeric_limits<uint8_t>::max())
|
||||
Log(EError, "convertMultiSpectrumAlphaWeight(): excessive number of channels!");
|
||||
ref<Bitmap> bitmap = new Bitmap(Bitmap::EMultiChannel, componentFormat,
|
||||
m_size, (uint8_t) channelNames.size());
|
||||
bitmap->setChannelNames(channelNames);
|
||||
convertMultiSpectrumAlphaWeight(this, getUInt8Data(), bitmap,
|
||||
bitmap->getUInt8Data(), pixelFormats, componentFormat,
|
||||
|
|
|
@ -69,7 +69,6 @@ static InterpolatedSpectrum CIE_D65_interp(CIE_wavelengths, CIE_D65_entries, CIE
|
|||
Spectrum Spectrum::CIE_X;
|
||||
Spectrum Spectrum::CIE_Y;
|
||||
Spectrum Spectrum::CIE_Z;
|
||||
Spectrum Spectrum::CIE_D65;
|
||||
Float Spectrum::CIE_normalization;
|
||||
/// @}
|
||||
|
||||
|
|
|
@ -276,7 +276,9 @@ static bp::tuple Matrix4x4_lu(Matrix4x4 *matrix) {
|
|||
static Vector4 Matrix4x4_cholSolve(Matrix4x4 *matrix, Vector B) {
|
||||
typedef Matrix<4, 1, Float> Matrix4x1;
|
||||
Vector4 X;
|
||||
matrix->cholSolve<1>((Matrix4x1 &) B, (Matrix4x1 &) X);
|
||||
Matrix4x1 & aliasedB MTS_MAY_ALIAS = reinterpret_cast<Matrix4x1 &>(B);
|
||||
Matrix4x1 & aliasedX MTS_MAY_ALIAS = reinterpret_cast<Matrix4x1 &>(X);
|
||||
matrix->cholSolve<1>(aliasedB, aliasedX);
|
||||
return X;
|
||||
}
|
||||
|
||||
|
@ -290,7 +292,9 @@ static Vector4 Matrix4x4_luSolve(Matrix4x4 *matrix, Vector B, bp::list pivList)
|
|||
for (int i=0; i<4; ++i)
|
||||
piv[i] = bp::extract<Float>(pivList[i]);
|
||||
|
||||
matrix->luSolve<1>((Matrix4x1 &) B, (Matrix4x1 &) X, piv);
|
||||
Matrix4x1 & aliasedB MTS_MAY_ALIAS = reinterpret_cast<Matrix4x1 &>(B);
|
||||
Matrix4x1 & aliasedX MTS_MAY_ALIAS = reinterpret_cast<Matrix4x1 &>(X);
|
||||
matrix->luSolve<1>(aliasedB, aliasedX, piv);
|
||||
return X;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue