]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix wxIMAGE_QUALITY_HIGH definition.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 29 Jun 2013 12:51:47 +0000 (12:51 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 29 Jun 2013 12:51:47 +0000 (12:51 +0000)
Embarrassingly, wxIMAGE_QUALITY_HIGH was never used as it had the same value
as wxIMAGE_QUALITY_BILINEAR due to the changes to these constants in r67203.

After fixing its value in the enum, also change the switch on this enum
elements to avoid g++ warnings about unhandled enum values.

See #12845, #15281.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74309 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/image.h
src/common/image.cpp

index 4ca8379f805b9806d80789d630e0ae8b4fc3e9e9..575b96b362f7b6bf7b112547308a41755d995cdc 100644 (file)
@@ -71,7 +71,7 @@ enum wxImageResizeQuality
     wxIMAGE_QUALITY_NORMAL = wxIMAGE_QUALITY_NEAREST,
 
     // highest (but best) quality
     wxIMAGE_QUALITY_NORMAL = wxIMAGE_QUALITY_NEAREST,
 
     // highest (but best) quality
-    wxIMAGE_QUALITY_HIGH
+    wxIMAGE_QUALITY_HIGH = 4
 };
 
 // alpha channel values: fully transparent, default threshold separating
 };
 
 // alpha channel values: fully transparent, default threshold separating
index 66caa0817407120ca1f428cfc2bbf756c31d11b9..5131342a3651f2a0715dad30ffc8a5215eda8250 100644 (file)
@@ -443,13 +443,6 @@ wxImage::Scale( int width, int height, wxImageResizeQuality quality ) const
     if ( old_width == width && old_height == height )
         return *this;
 
     if ( old_width == width && old_height == height )
         return *this;
 
-    if (quality == wxIMAGE_QUALITY_HIGH)
-    {
-        quality = (width < old_width && height < old_height)
-            ? wxIMAGE_QUALITY_BOX_AVERAGE
-            : wxIMAGE_QUALITY_BICUBIC;
-    }
-
     // Resample the image using the method as specified.
     switch ( quality )
     {
     // Resample the image using the method as specified.
     switch ( quality )
     {
@@ -474,6 +467,12 @@ wxImage::Scale( int width, int height, wxImageResizeQuality quality ) const
         case wxIMAGE_QUALITY_BOX_AVERAGE:
             image = ResampleBox(width, height);
             break;
         case wxIMAGE_QUALITY_BOX_AVERAGE:
             image = ResampleBox(width, height);
             break;
+
+        case wxIMAGE_QUALITY_HIGH:
+            image = width < old_width && height < old_height
+                        ? ResampleBox(width, height)
+                        : ResampleBicubic(width, height);
+            break;
     }
 
     // If the original image has a mask, apply the mask to the new image
     }
 
     // If the original image has a mask, apply the mask to the new image