summaryrefslogtreecommitdiff
path: root/wx+/image_tools.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-02-15 11:50:31 -0500
committerB Stack <bgstack15@gmail.com>2020-02-15 11:50:31 -0500
commit791b90b9898cc41869538f1dfc303588436682b7 (patch)
tree02cc7f817d95ce3f21207cbaba130e3d537fc1eb /wx+/image_tools.h
parentMerge branch '10.19' into 'master' (diff)
downloadFreeFileSync-791b90b9898cc41869538f1dfc303588436682b7.tar.gz
FreeFileSync-791b90b9898cc41869538f1dfc303588436682b7.tar.bz2
FreeFileSync-791b90b9898cc41869538f1dfc303588436682b7.zip
add upstream 10.20
It is worth noting that the send email feature is not present in the GPL release.
Diffstat (limited to 'wx+/image_tools.h')
-rw-r--r--wx+/image_tools.h12
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();
bgstack15