summaryrefslogtreecommitdiff
path: root/wx+/image_tools.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2018-08-10 11:29:21 -0400
committerB Stack <bgstack15@gmail.com>2018-08-10 11:29:21 -0400
commita9255194193b04d599b9f0a64cde6b831dd7d916 (patch)
tree8b975393f5b0f7b4403da85f5095ad57581178e5 /wx+/image_tools.h
parent10.2 (diff)
downloadFreeFileSync-a9255194193b04d599b9f0a64cde6b831dd7d916.tar.gz
FreeFileSync-a9255194193b04d599b9f0a64cde6b831dd7d916.tar.bz2
FreeFileSync-a9255194193b04d599b9f0a64cde6b831dd7d916.zip
10.310.3
Diffstat (limited to 'wx+/image_tools.h')
-rwxr-xr-xwx+/image_tools.h21
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())
bgstack15