summaryrefslogtreecommitdiff
path: root/include/vcl/bitmapex.hxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2014-04-18 20:46:34 +0200
committerLuboš Luňák <l.lunak@collabora.com>2014-04-18 20:53:01 +0200
commit1139d618b8bc6ab823a96184bd0f0257980aad24 (patch)
tree763931577dbadbc3e6853950a3df099b1f69a4f4 /include/vcl/bitmapex.hxx
parent8afabd394214bb7c772c88b08ec3cadb56771cce (diff)
handle strange brightness+contrast adjustment from msoffice (fdo#38410)
LO uses basically the formula "newpixel=(oldpixel-128)*contrast+128+brightness", i.e. contrast is applied first. It looks like there's no "oficial" formula for this, so a formula that applies brightness first would be ok too. MSO for some weird reason apparently uses a formula that applies half of brightness before contrast and half afterwards (insert funny political correctness or compromise joke here). While the result is the same like with the LO formula if only either brightness or contrast is adjusted, the result is different if both are involved. Just modify the image using the MSO algorithm if this is the case. Change-Id: I55fe8f395832685b90f024cf2f58b0797c1ba588
Diffstat (limited to 'include/vcl/bitmapex.hxx')
-rw-r--r--include/vcl/bitmapex.hxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/vcl/bitmapex.hxx b/include/vcl/bitmapex.hxx
index 5fa7c81e7f3b..5571ee41ca5f 100644
--- a/include/vcl/bitmapex.hxx
+++ b/include/vcl/bitmapex.hxx
@@ -348,6 +348,9 @@ public:
@param bInvert
If true, invert the channel values with the logical 'not' operator
+ @param msoFormula
+ Use the same formula for brightness as used by MSOffice.
+
@return true, if the operation was completed successfully.
*/
bool Adjust( short nLuminancePercent = 0,
@@ -356,7 +359,8 @@ public:
short nChannelGPercent = 0,
short nChannelBPercent = 0,
double fGamma = 1.0,
- bool bInvert = false );
+ bool bInvert = false,
+ bool msoBrightness = false );
/** Apply specified filter to the bitmap