diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2020-02-23 22:12:27 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2020-02-23 22:12:27 +0000 |
commit | 450f803dd75f831f8ee14072fe0eb664bbe518df (patch) | |
tree | b3e831d44df50348a20f3541b6062f7fbab6ff3d /wx+/image_tools.h | |
parent | Merge branch '10.19' into 'master' (diff) | |
parent | remove upstream deleted files (diff) | |
download | FreeFileSync-10.20.tar.gz FreeFileSync-10.20.tar.bz2 FreeFileSync-10.20.zip |
Merge branch '10.20' into 'master'10.20
add upstream 10.20
See merge request opensource-tracking/FreeFileSync!17
Diffstat (limited to 'wx+/image_tools.h')
-rw-r--r-- | wx+/image_tools.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/wx+/image_tools.h b/wx+/image_tools.h index e2d42fb0..3e401f73 100644 --- a/wx+/image_tools.h +++ b/wx+/image_tools.h @@ -38,6 +38,8 @@ wxImage layOver(const wxImage& back, const wxImage& front, int alignment = wxALI wxImage greyScale(const wxImage& img); //greyscale + brightness adaption wxBitmap greyScale(const wxBitmap& bmp); // +wxBitmap greyScaleIfDisabled(const wxBitmap& bmp, bool enabled); + //void moveImage(wxImage& img, int right, int up); void adjustBrightness(wxImage& img, int targetLevel); @@ -99,6 +101,16 @@ wxBitmap greyScale(const wxBitmap& bmp) inline +wxBitmap greyScaleIfDisabled(const wxBitmap& bmp, bool enabled) +{ + if (enabled) //avoid ternary WTF + return bmp; + else + return greyScale(bmp); +} + + +inline double getAvgBrightness(const wxImage& img) { const int pixelCount = img.GetWidth() * img.GetHeight(); |