Skip to content

Commit 41fa3c5

Browse files
committed
further fix to pfmFile.resize()
1 parent 210780f commit 41fa3c5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

panda/src/pnmimage/pnm-image-filter-sparse-core.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source,
6969
filter, filter_width, actual_width);
7070

7171
for (a = 0; a < dest.ASIZE(); a++) {
72-
nassertv(!isnan(temp_dest[a]) && !isnan(temp_dest_weight[a]));
7372
matrix[a][b] = temp_dest[a];
7473
matrix_weight[a][b] = temp_dest_weight[a];
7574
}
@@ -95,10 +94,10 @@ FUNCTION_NAME(IMAGETYPE &dest, const IMAGETYPE &source,
9594
filter, filter_width, actual_width);
9695

9796
for (b = 0; b < dest.BSIZE(); b++) {
98-
nassertv(!isnan(temp_dest[b]) && !isnan(temp_dest_weight[b]));
9997
if (temp_dest_weight[b] != 0) {
100-
dest.SETVAL(a, b, channel, (float)temp_dest[b]/(float)temp_dest_weight[b]);
101-
nassertv(!isnan(dest.GETVAL(a, b, channel)));
98+
// The temp_dest array has already been scaled by
99+
// temp_dest_weight; we don't scale it again here.
100+
dest.SETVAL(a, b, channel, (float)temp_dest[b]/(float)source_max);
102101
}
103102
}
104103
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy