X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8faef7ccbc4b4e192da06de7e1a2a7f1dff7ec91..178c77606f3186250b42685ca752d0bc34cd02e9:/interface/wx/image.h?ds=sidebyside diff --git a/interface/wx/image.h b/interface/wx/image.h index 92cd47e917..1b44387d2a 100644 --- a/interface/wx/image.h +++ b/interface/wx/image.h @@ -23,6 +23,29 @@ enum wxImageResolution wxIMAGE_RESOLUTION_CM = 2 }; +/** + Image resize algorithm. + + This is used with wxImage::Scale() and wxImage::Rescale(). + */ +enum wxImageResizeQuality +{ + /// Simplest and fastest algorithm. + wxIMAGE_QUALITY_NEAREST, + + /// Compromise between wxIMAGE_QUALITY_NEAREST and wxIMAGE_QUALITY_BICUBIC. + wxIMAGE_QUALITY_BILINEAR, + + /// Highest quality but slowest execution time. + wxIMAGE_QUALITY_BICUBIC, + + /// Default image resizing algorithm used by wxImage::Scale(). + wxIMAGE_QUALITY_NORMAL, + + /// Best image resizing algorithm, currently same as wxIMAGE_QUALITY_BICUBIC. + wxIMAGE_QUALITY_HIGH +}; + /** Possible values for PNG image type option. @@ -276,10 +299,10 @@ const unsigned char wxIMAGE_ALPHA_OPAQUE = 0xff; The constants ::wxIMAGE_ALPHA_TRANSPARENT and ::wxIMAGE_ALPHA_OPAQUE can be used to indicate those values in a more readable form. - Unlike RGB data, not all images have an alpha channel and before using - wxImage::GetAlpha you should check if this image contains an alpha channel - with wxImage::HasAlpha. Note that currently only the PNG format has full - alpha channel support so only the images loaded from PNG files can have + While all images have RGB data, not all images have an alpha channel. Before + using wxImage::GetAlpha you should check if this image contains an alpha + channel with wxImage::HasAlpha. Note that currently only the PNG format has + full alpha channel support so only the images loaded from PNG files can have alpha and, if you initialize the image alpha channel yourself using wxImage::SetAlpha, you should save it in PNG format to avoid losing it. @@ -661,7 +684,7 @@ public: @see Scale() */ wxImage& Rescale(int width, int height, - int quality = wxIMAGE_QUALITY_NORMAL); + wxImageResizeQuality quality = wxIMAGE_QUALITY_NORMAL); /** Changes the size of the image in-place without scaling it by adding either a @@ -714,12 +737,8 @@ public: This is also useful for scaling bitmaps in general as the only other way to scale bitmaps is to blit a wxMemoryDC into another wxMemoryDC. - The parameter @a quality determines what method to use for resampling the image. - Can be one of the following: - - wxIMAGE_QUALITY_NORMAL: Uses the normal default scaling method of pixel - replication - - wxIMAGE_QUALITY_HIGH: Uses bicubic and box averaging resampling methods - for upsampling and downsampling respectively + The parameter @a quality determines what method to use for resampling + the image, see wxImageResizeQuality documentation. It should be noted that although using @c wxIMAGE_QUALITY_HIGH produces much nicer looking results it is a slower method. Downsampling will use the box averaging @@ -753,7 +772,7 @@ public: @see Rescale() */ wxImage Scale(int width, int height, - int quality = wxIMAGE_QUALITY_NORMAL) const; + wxImageResizeQuality quality = wxIMAGE_QUALITY_NORMAL) const; /** Returns a resized version of this image without scaling it by adding either a