No changes, just refactor common code in wxImage cloning functions.

Extract code common to several wxImage methods creating new images based on an
existing one in a new MakeEmptyClone() method.

Closes #12682.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-11-16 22:37:59 +00:00
parent e4f54cce1e
commit 496dbbe76e
2 changed files with 90 additions and 114 deletions

View File

@@ -591,6 +591,24 @@ protected:
private:
friend class WXDLLIMPEXP_FWD_CORE wxImageHandler;
// Possible values for MakeEmptyClone() flags.
enum
{
// Create an image with the same orientation as this one. This is the
// default and only exists for symmetry with SwapOrientation.
Clone_SameOrientation = 0,
// Create an image with the same height as this image width and the
// same width as this image height.
Clone_SwapOrientation = 1
};
// Returns a new blank image with the same dimensions (or with width and
// height swapped if Clone_SwapOrientation flag is given), alpha, and mask
// as this image itself. This is used by several functions creating
// modified versions of this image.
wxImage MakeEmptyClone(int flags = Clone_SameOrientation) const;
#if wxUSE_STREAMS
// read the image from the specified stream updating image type if
// successful