bugfix for a pixel traversal issue reported by Marios

metadata
Wenzel Jakob 2011-04-28 18:14:21 +02:00
parent b9d3d53f7c
commit ebd70aede4
2 changed files with 6 additions and 3 deletions

View File

@ -51,8 +51,9 @@ public:
m_points.clear();
m_points.reserve(m_size.x*m_size.y);
m_size = size; m_pos = PointType(0);
const Float invLog2 = (Float) 1 / std::log((Float) 2);
generate(
log2i((uint32_t) std::max(m_size.x, m_size.y)),
(int) std::ceil(invLog2 * std::log((Float) std::max(m_size.x, m_size.y))),
ENorth, EEast, ESouth, EWest);
}

View File

@ -188,7 +188,8 @@ public:
for (int x=0; x<m_cropSize.x; x++) {
Pixel &pixel = m_pixels[pos];
if (m_exportSpectra) {
Spectrum spec(pixel.spec / pixel.weight);
Float invWeight = pixel.weight > 0 ? 1/pixel.weight : 1;
Spectrum spec = invWeight*pixel.spec;
for (int i=0; i<SPECTRUM_SAMPLES; ++i) {
if (!m_hasVariances)
fprintf(f, "%f", spec[i]);
@ -200,7 +201,8 @@ public:
if (x + 1 < m_cropSize.x)
fprintf(f, ", ");
} else {
Float luminance = (pixel.spec / pixel.weight).getLuminance();
Float invWeight = pixel.weight > 0 ? 1/pixel.weight : 1;
Float luminance = invWeight*pixel.spec.getLuminance();
if (!m_hasVariances)
fprintf(f, "%f", luminance);
else