diff options
author | B Stack <bgstack15@gmail.com> | 2018-08-10 11:29:21 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2018-08-10 11:29:21 -0400 |
commit | a9255194193b04d599b9f0a64cde6b831dd7d916 (patch) | |
tree | 8b975393f5b0f7b4403da85f5095ad57581178e5 /wx+/image_tools.h | |
parent | 10.2 (diff) | |
download | FreeFileSync-a9255194193b04d599b9f0a64cde6b831dd7d916.tar.gz FreeFileSync-a9255194193b04d599b9f0a64cde6b831dd7d916.tar.bz2 FreeFileSync-a9255194193b04d599b9f0a64cde6b831dd7d916.zip |
10.310.3
Diffstat (limited to 'wx+/image_tools.h')
-rwxr-xr-x | wx+/image_tools.h | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/wx+/image_tools.h b/wx+/image_tools.h index 6dd9b26b..ca82a031 100755 --- a/wx+/image_tools.h +++ b/wx+/image_tools.h @@ -22,7 +22,7 @@ enum class ImageStackLayout VERTICAL }; -enum class ImageStackAlignment +enum class ImageStackAlignment //one-dimensional unlike wxAlignment { CENTER, LEFT, @@ -34,7 +34,7 @@ wxImage stackImages(const wxImage& img1, const wxImage& img2, ImageStackLayout d wxImage createImageFromText(const wxString& text, const wxFont& font, const wxColor& col, ImageStackAlignment textAlign = ImageStackAlignment::LEFT); //CENTER/LEFT/RIGHT -wxBitmap layOver(const wxBitmap& background, const wxBitmap& foreground); //merge +wxBitmap layOver(const wxBitmap& background, const wxBitmap& foreground, int alignment = wxALIGN_CENTER); wxImage greyScale(const wxImage& img); //greyscale + brightness adaption wxBitmap greyScale(const wxBitmap& bmp); // @@ -147,23 +147,6 @@ void adjustBrightness(wxImage& img, int targetLevel) inline -wxBitmap layOver(const wxBitmap& background, const wxBitmap& foreground) -{ - assert(foreground.HasAlpha() == background.HasAlpha()); //we don't support mixed-mode brittleness! - - wxBitmap output(background.ConvertToImage()); //attention: wxBitmap/wxImage use ref-counting without copy on write! - { - wxMemoryDC dc(output); - - const int offsetX = (background.GetWidth () - foreground.GetWidth ()) / 2; - const int offsetY = (background.GetHeight() - foreground.GetHeight()) / 2; - dc.DrawBitmap(foreground, offsetX, offsetY); - } - return output; -} - - -inline bool isEqual(const wxBitmap& lhs, const wxBitmap& rhs) { if (lhs.IsOk() != rhs.IsOk()) |