further fix to pfmFile.resize()

This commit is contained in:
David Rose 2019-10-18 12:50:52 -07:00
parent 210780f021
commit 41fa3c52e3

View File

@ -69,7 +69,6 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source,
filter, filter_width, actual_width);
for (a = 0; a < dest.ASIZE(); a++) {
nassertv(!isnan(temp_dest[a]) && !isnan(temp_dest_weight[a]));
matrix[a][b] = temp_dest[a];
matrix_weight[a][b] = temp_dest_weight[a];
}
@ -95,10 +94,10 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source,
filter, filter_width, actual_width);
for (b = 0; b < dest.BSIZE(); b++) {
nassertv(!isnan(temp_dest[b]) && !isnan(temp_dest_weight[b]));
if (temp_dest_weight[b] != 0) {
dest.SETVAL(a, b, channel, (float)temp_dest[b]/(float)temp_dest_weight[b]);
nassertv(!isnan(dest.GETVAL(a, b, channel)));
// The temp_dest array has already been scaled by
// temp_dest_weight; we don't scale it again here.
dest.SETVAL(a, b, channel, (float)temp_dest[b]/(float)source_max);
}
}
}