pfm-resize-quick, and let pfm-resize-gaussian default to false

This commit is contained in:
David Rose 2013-05-28 23:49:19 +00:00
parent 8019297cea
commit 842f4d82a0
3 changed files with 10 additions and 2 deletions

View File

@ -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(). "

View File

@ -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();

View File

@ -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);