diff --git a/panda/src/pnmimage/config_pnmimage.cxx b/panda/src/pnmimage/config_pnmimage.cxx index c5bf782fe9..f2c14ae49f 100644 --- a/panda/src/pnmimage/config_pnmimage.cxx +++ b/panda/src/pnmimage/config_pnmimage.cxx @@ -37,12 +37,19 @@ ConfigVariableBool pfm_reverse_dimensions "on input. Does not affect output, which is always written width height.")); ConfigVariableBool pfm_resize_gaussian -("pfm-resize-gaussian", true, +("pfm-resize-gaussian", false, PRC_DESC("Specify true to implement PfmFile::resize() with a higher-quality " "Gaussian filter, or false to implement it with a faster box " "filter. This just controls the behavior of resize(); you can " "always call box_filter() or gaussian_filter() explicitly.")); +ConfigVariableBool pfm_resize_quick +("pfm-resize-quick", true, + PRC_DESC("If pfm-resize-gaussian is false, set this true to allow the " + "so-called \"quick\" filter when the pfm is being downscaled. This " + "is even faster than the normal box filter. In some cases it " + "may also be more precise, though it may be more aliased.")); + ConfigVariableDouble pfm_resize_radius ("pfm-resize-radius", 1.0, PRC_DESC("Specify the default filter radius for PfmFile::resize(). " diff --git a/panda/src/pnmimage/config_pnmimage.h b/panda/src/pnmimage/config_pnmimage.h index d9badbf2b4..2f9860959b 100644 --- a/panda/src/pnmimage/config_pnmimage.h +++ b/panda/src/pnmimage/config_pnmimage.h @@ -25,6 +25,7 @@ NotifyCategoryDecl(pnmimage, EXPCL_PANDA_PNMIMAGE, EXPTP_PANDA_PNMIMAGE); extern ConfigVariableBool pfm_force_littleendian; extern ConfigVariableBool pfm_reverse_dimensions; extern ConfigVariableBool pfm_resize_gaussian; +extern ConfigVariableBool pfm_resize_quick; extern ConfigVariableDouble pfm_resize_radius; extern EXPCL_PANDA_PNMIMAGE void init_libpnmimage(); diff --git a/panda/src/pnmimage/pfmFile.cxx b/panda/src/pnmimage/pfmFile.cxx index a9e9642824..cf541b3f89 100644 --- a/panda/src/pnmimage/pfmFile.cxx +++ b/panda/src/pnmimage/pfmFile.cxx @@ -992,7 +992,7 @@ resize(int new_x_size, int new_y_size) { if (pfm_resize_gaussian) { result.gaussian_filter_from(pfm_resize_radius, *this); } else { - if (new_x_size <= _x_size && new_y_size <= _y_size) { + if (pfm_resize_quick && new_x_size <= _x_size && new_y_size <= _y_size) { // If we're downscaling, we can use quick_filter, which is faster. result.quick_filter_from(*this);