summaryrefslogtreecommitdiff
path: root/wx+/image_tools.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2016-03-16 21:34:59 +0100
committerDaniel Wilhelm <daniel@wili.li>2016-03-16 21:34:59 +0100
commit339ed7f63798fb5ccab05fa7fb9d0d95743c9c89 (patch)
tree214819f601b69bfd32507ca59047dd4d68ed5632 /wx+/image_tools.h
parent7.9 (diff)
downloadFreeFileSync-339ed7f63798fb5ccab05fa7fb9d0d95743c9c89.tar.gz
FreeFileSync-339ed7f63798fb5ccab05fa7fb9d0d95743c9c89.tar.bz2
FreeFileSync-339ed7f63798fb5ccab05fa7fb9d0d95743c9c89.zip
8.0
Diffstat (limited to 'wx+/image_tools.h')
-rw-r--r--wx+/image_tools.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/wx+/image_tools.h b/wx+/image_tools.h
index 554e7b49..c8077aa4 100644
--- a/wx+/image_tools.h
+++ b/wx+/image_tools.h
@@ -127,10 +127,9 @@ double getAvgBrightness(const wxImage& img)
inline
void brighten(wxImage& img, int level)
{
- const int pixelCount = img.GetWidth() * img.GetHeight();
- auto pixBegin = img.GetData();
- if (pixBegin)
+ if (auto pixBegin = img.GetData())
{
+ const int pixelCount = img.GetWidth() * img.GetHeight();
auto pixEnd = pixBegin + 3 * pixelCount; //RGB
if (level > 0)
std::for_each(pixBegin, pixEnd, [&](unsigned char& c) { c = static_cast<unsigned char>(std::min(255, c + level)); });
bgstack15