[Libreoffice-commits] core.git: 3 commits - basegfx/source drawinglayer/source include/basegfx include/drawinglayer sd/AllLangResTarget_sd.mk sd/source sd/uiconfig sd/UIConfig_simpress.mk svgio/source svx/source sw/source vcl/source

Caolán McNamara caolanm at redhat.com
Wed Nov 6 12:46:28 CET 2013


 basegfx/source/color/bcolormodifier.cxx                       |  334 +++++++-
 drawinglayer/source/primitive2d/graphicprimitive2d.cxx        |  202 +++--
 drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx  |  135 +++
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx       |    4 
 drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx  |   14 
 drawinglayer/source/primitive2d/shadowprimitive2d.cxx         |    9 
 drawinglayer/source/primitive2d/texteffectprimitive2d.cxx     |   49 -
 drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx  |   14 
 drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx   |    9 
 drawinglayer/source/processor2d/vclprocessor2d.cxx            |    9 
 drawinglayer/source/tools/converters.cxx                      |    8 
 include/basegfx/color/bcolor.hxx                              |    6 
 include/basegfx/color/bcolormodifier.hxx                      |  393 ++++++++--
 include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx |   17 
 include/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx |   10 
 include/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx |    6 
 sd/AllLangResTarget_sd.mk                                     |    1 
 sd/UIConfig_simpress.mk                                       |    1 
 sd/source/ui/dlg/ins_paste.cxx                                |   34 
 sd/source/ui/dlg/ins_paste.src                                |   75 -
 sd/source/ui/inc/ins_paste.hrc                                |   30 
 sd/source/ui/inc/ins_paste.hxx                                |   16 
 sd/source/ui/view/Outliner.cxx                                |    7 
 sd/uiconfig/simpress/ui/insertslides.ui                       |  157 +++
 svgio/source/svgreader/svgmasknode.cxx                        |    6 
 svx/source/sdr/contact/viewobjectcontact.cxx                  |   11 
 svx/source/sdr/contact/viewobjectcontactofe3d.cxx             |   11 
 svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx        |   10 
 sw/source/ui/docvw/HeaderFooterWin.cxx                        |    6 
 sw/source/ui/docvw/PageBreakWin.cxx                           |    6 
 vcl/source/gdi/bitmapex.cxx                                   |  128 ++-
 31 files changed, 1330 insertions(+), 388 deletions(-)

New commits:
commit fbdc77fea91e6003e2c3438e326e454afd5c0f92
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 6 10:38:41 2013 +0000

    convert insert slides dialog to .ui
    
    Change-Id: I4285ccfb9609305b2e92fec6c3f79b5277016f8b

diff --git a/sd/AllLangResTarget_sd.mk b/sd/AllLangResTarget_sd.mk
index d2f85ad..2e311ef 100644
--- a/sd/AllLangResTarget_sd.mk
+++ b/sd/AllLangResTarget_sd.mk
@@ -47,7 +47,6 @@ $(eval $(call gb_SrsTarget_add_files,sd/res,\
     sd/source/ui/dlg/dlgfield.src \
     sd/source/ui/dlg/dlgolbul.src \
     sd/source/ui/dlg/inspagob.src \
-    sd/source/ui/dlg/ins_paste.src \
     sd/source/ui/dlg/LayerDialog.src \
     sd/source/ui/dlg/morphdlg.src \
     sd/source/ui/dlg/navigatr.src \
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index e13f035..f6a12f8 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -82,6 +82,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
 	sd/uiconfig/simpress/ui/dlgfield \
 	sd/uiconfig/simpress/ui/headerfooterdialog \
 	sd/uiconfig/simpress/ui/headerfootertab \
+	sd/uiconfig/simpress/ui/insertslides \
 	sd/uiconfig/simpress/ui/masterlayoutdlg \
 	sd/uiconfig/simpress/ui/optimpressgeneralpage \
 	sd/uiconfig/simpress/ui/photoalbum \
diff --git a/sd/source/ui/dlg/ins_paste.cxx b/sd/source/ui/dlg/ins_paste.cxx
index f99322d..109fb75 100644
--- a/sd/source/ui/dlg/ins_paste.cxx
+++ b/sd/source/ui/dlg/ins_paste.cxx
@@ -17,38 +17,20 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-
-#include "ins_paste.hrc"
 #include "ins_paste.hxx"
 
-// --------------------
-// - SdInsertPasteDlg -
-// --------------------
-
-SdInsertPasteDlg::SdInsertPasteDlg( Window* pWindow ) :
-    ModalDialog( pWindow, SdResId( DLG_INSERT_PASTE ) ),
-    aFlPosition( this, SdResId( FL_POSITION ) ),
-    aRbBefore( this, SdResId( RB_BEFORE ) ),
-    aRbAfter( this, SdResId( RB_AFTER ) ),
-    aBtnOK( this, SdResId( BTN_OK ) ),
-    aBtnCancel( this, SdResId( BTN_CANCEL ) ),
-    aBtnHelp( this, SdResId( BTN_HELP ) )
+SdInsertPasteDlg::SdInsertPasteDlg(Window* pWindow)
+    : ModalDialog( pWindow, "InsertSlidesDialog",
+        "modules/simpress/ui/insertslides.ui")
 {
-    FreeResource();
-    aRbAfter.Check( sal_True );
+    get(m_pRbBefore, "before");
+    get(m_pRbAfter, "after");
+    m_pRbAfter->Check( sal_True );
 }
 
-// -----------------------------------------------------------------------------
-
-SdInsertPasteDlg::~SdInsertPasteDlg()
-{
-}
-
-// -----------------------------------------------------------------------------
-
-sal_Bool SdInsertPasteDlg::IsInsertBefore() const
+bool SdInsertPasteDlg::IsInsertBefore() const
 {
-    return( aRbBefore.IsChecked() );
+    return( m_pRbBefore->IsChecked() );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/ins_paste.src b/sd/source/ui/dlg/ins_paste.src
deleted file mode 100644
index 0e03e51..0000000
--- a/sd/source/ui/dlg/ins_paste.src
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "ins_paste.hrc"
-
-ModalDialog DLG_INSERT_PASTE
-{
-    HelpID = "sd:ModalDialog:DLG_INSERT_PASTE";
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT ( 148 , 90 ) ;
-    Moveable = TRUE ;
-    OKButton BTN_OK
-    {
-        Pos = MAP_APPFONT ( 92 , 6 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-        DefButton = TRUE ;
-    };
-    CancelButton BTN_CANCEL
-    {
-        Pos = MAP_APPFONT ( 92 , 23 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-    HelpButton BTN_HELP
-    {
-        Pos = MAP_APPFONT ( 92 , 43 ) ;
-        Size = MAP_APPFONT ( 50 , 14 ) ;
-        TabStop = TRUE ;
-    };
-
-    FixedLine FL_POSITION
-    {
-        Pos = MAP_APPFONT ( 6 , 3 ) ;
-        Size = MAP_APPFONT ( 80 , 8 ) ;
-        Text [ en-US ] = "Position";
-    };
-    RadioButton RB_BEFORE
-    {
-        HelpID = "sd:RadioButton:DLG_INSERT_PASTE:RB_BEFORE";
-        Pos = MAP_APPFONT ( 12 , 14 ) ;
-        Size = MAP_APPFONT ( 80, 10 ) ;
-        Text [ en-US ] = "~Before" ;
-        TabStop = TRUE ;
-    };
-    RadioButton RB_AFTER
-    {
-        HelpID = "sd:RadioButton:DLG_INSERT_PASTE:RB_AFTER";
-        Pos = MAP_APPFONT ( 12, 27 ) ;
-        Size = MAP_APPFONT ( 80, 10 ) ;
-        Text [ en-US ] = "A~fter" ;
-        TabStop = TRUE ;
-        Check = TRUE ;
-    };
-    Text [ en-US ] = "Insert Slides";
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/ins_paste.hrc b/sd/source/ui/inc/ins_paste.hrc
deleted file mode 100644
index 94ef7df..0000000
--- a/sd/source/ui/inc/ins_paste.hrc
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#define DLG_INSERT_PASTE    678
-
-#define BTN_OK      1
-#define BTN_CANCEL  1
-#define BTN_HELP    1
-
-#define FL_POSITION 1
-#define RB_BEFORE   1
-#define RB_AFTER    2
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/inc/ins_paste.hxx b/sd/source/ui/inc/ins_paste.hxx
index d504e27..bfbc62d 100644
--- a/sd/source/ui/inc/ins_paste.hxx
+++ b/sd/source/ui/inc/ins_paste.hxx
@@ -34,20 +34,12 @@
 class SD_DLLPUBLIC SdInsertPasteDlg : public ModalDialog
 {
 private:
-
-    FixedLine       aFlPosition;
-    RadioButton     aRbBefore;
-    RadioButton     aRbAfter;
-    OKButton        aBtnOK;
-    CancelButton    aBtnCancel;
-    HelpButton      aBtnHelp;
+    RadioButton* m_pRbBefore;
+    RadioButton* m_pRbAfter;
 
 public:
-
-                    SdInsertPasteDlg( Window* pWindow );
-                    ~SdInsertPasteDlg();
-
-    sal_Bool            IsInsertBefore() const;
+    SdInsertPasteDlg( Window* pWindow );
+    bool IsInsertBefore() const;
 };
 
 #endif // INCLUDED_SD_SOURCE_UI_INC_INS_PASTE_HXX
diff --git a/sd/uiconfig/simpress/ui/insertslides.ui b/sd/uiconfig/simpress/ui/insertslides.ui
new file mode 100644
index 0000000..439718f
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/insertslides.ui
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.0 -->
+  <object class="GtkDialog" id="InsertSlidesDialog">
+    <property name="can_focus">False</property>
+    <property name="border_width">6</property>
+    <property name="title" translatable="yes">Insert Slides</property>
+    <property name="type_hint">dialog</property>
+    <child internal-child="vbox">
+      <object class="GtkBox" id="dialog-vbox1">
+        <property name="can_focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">12</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox" id="dialog-action_area1">
+            <property name="can_focus">False</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="ok">
+                <property name="label">gtk-ok</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="has_default">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="cancel">
+                <property name="label">gtk-cancel</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkButton" id="help">
+                <property name="label">gtk-help</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkFrame" id="action">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="label_xalign">0</property>
+            <property name="shadow_type">none</property>
+            <child>
+              <object class="GtkAlignment" id="alignment1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="top_padding">6</property>
+                <property name="left_padding">12</property>
+                <child>
+                  <object class="GtkBox" id="box1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="orientation">vertical</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <object class="GtkRadioButton" id="before">
+                        <property name="label" translatable="yes">_Before</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="hexpand">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                        <property name="group">after</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkRadioButton" id="after">
+                        <property name="label" translatable="yes">A_fter</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="hexpand">True</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                        <property name="group">before</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </object>
+                </child>
+              </object>
+            </child>
+            <child type="label">
+              <object class="GtkLabel" id="label1">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="yalign">0.55000001192092896</property>
+                <property name="xpad">1</property>
+                <property name="label" translatable="yes">Position</property>
+                <property name="justify">center</property>
+                <attributes>
+                  <attribute name="weight" value="bold"/>
+                </attributes>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="0">ok</action-widget>
+      <action-widget response="0">cancel</action-widget>
+      <action-widget response="0">help</action-widget>
+    </action-widgets>
+  </object>
+</interface>
commit 9b6b03542df7f6b0feecf60a13bab7e885ef3587
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 6 09:42:34 2013 +0000

    convert InfoBox to MessageDialog
    
    Change-Id: Ic3a7b927c4eceb4f059e84d135b710f150ccfc3e

diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 00551df..3701a1e 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -26,6 +26,7 @@
 #include <vcl/outdev.hxx>
 #include <svx/dlgutil.hxx>
 #include <svx/xtable.hxx>
+#include <vcl/layout.hxx>
 #include <vcl/msgbox.hxx>
 #include <sfx2/dispatch.hxx>
 #include <sfx2/printer.hxx>
@@ -1102,15 +1103,13 @@ void Outliner::ShowEndOfSearchDialog (void)
 
     // Show the message in an info box that is modal with respect to the
     // whole application.
-    InfoBox aInfoBox (NULL, aString);
+    MessageDialog aInfoBox(NULL, aString, VCL_MESSAGE_INFO);
+
     ShowModalMessageBox (aInfoBox);
 
     mbWholeDocumentProcessed = true;
 }
 
-
-
-
 bool Outliner::ShowWrapArroundDialog (void)
 {
     bool bDoWrapArround = false;
commit f120005ea41d59caf4b7d7f6017f3549d25b4287
Author: Armin Le Grand <alg at apache.org>
Date:   Tue Nov 5 16:13:12 2013 +0000

    Resolves: #i123500# redefined ColorModifiers and ColorModifierStack...
    
    redefined GraphicAttr to be expressed as primitives if needed, enhanced render
    and export quality if graphic is modified using graphic attributes
    
    (cherry picked from commit 1e79e8da3f8042f7d7bd94b2c9f03cff7545b05c)
    
    Conflicts:
    	basegfx/inc/basegfx/color/bcolor.hxx
    	basegfx/inc/basegfx/color/bcolormodifier.hxx
    	basegfx/source/color/bcolormodifier.cxx
    	drawinglayer/inc/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx
    	drawinglayer/inc/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
    	drawinglayer/inc/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
    	drawinglayer/source/primitive2d/graphicprimitive2d.cxx
    	drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
    	drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
    	drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
    
    Change-Id: Ief2172efc9cc1b9838de48ec7f536c05573c7dc3

diff --git a/basegfx/source/color/bcolormodifier.cxx b/basegfx/source/color/bcolormodifier.cxx
index a53715b..c1f7026 100644
--- a/basegfx/source/color/bcolormodifier.cxx
+++ b/basegfx/source/color/bcolormodifier.cxx
@@ -23,47 +23,315 @@
 
 namespace basegfx
 {
-    ::basegfx::BColor BColorModifier::getModifiedColor(const ::basegfx::BColor& aSourceColor) const
+    BColorModifier::~BColorModifier()
     {
-        switch(meMode)
+    }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    BColorModifier_gray::~BColorModifier_gray()
+    {
+    }
+
+    bool BColorModifier_gray::operator==(const BColorModifier& rCompare) const
+    {
+        return 0 != dynamic_cast< const BColorModifier_gray* >(&rCompare);
+    }
+
+    ::basegfx::BColor BColorModifier_gray::getModifiedColor(const ::basegfx::BColor& aSourceColor) const
+    {
+        const double fLuminance(aSourceColor.luminance());
+
+        return ::basegfx::BColor(fLuminance, fLuminance, fLuminance);
+    }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    BColorModifier_invert::~BColorModifier_invert()
+    {
+    }
+
+    bool BColorModifier_invert::operator==(const BColorModifier& rCompare) const
+    {
+        return 0 != dynamic_cast< const BColorModifier_invert* >(&rCompare);
+    }
+
+    ::basegfx::BColor BColorModifier_invert::getModifiedColor(const ::basegfx::BColor& aSourceColor) const
+    {
+        return ::basegfx::BColor(1.0 - aSourceColor.getRed(), 1.0 - aSourceColor.getGreen(), 1.0 - aSourceColor.getBlue());
+    }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    BColorModifier_luminance_to_alpha::~BColorModifier_luminance_to_alpha()
+    {
+    }
+
+    bool BColorModifier_luminance_to_alpha::operator==(const BColorModifier& rCompare) const
+    {
+        return 0 != dynamic_cast< const BColorModifier_luminance_to_alpha* >(&rCompare);
+    }
+
+    ::basegfx::BColor BColorModifier_luminance_to_alpha::getModifiedColor(const ::basegfx::BColor& aSourceColor) const
+    {
+        const double fAlpha(1.0 - ((aSourceColor.getRed() * 0.2125) + (aSourceColor.getGreen() * 0.7154) + (aSourceColor.getBlue() * 0.0721)));
+
+        return ::basegfx::BColor(fAlpha, fAlpha, fAlpha);
+    }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    BColorModifier_replace::~BColorModifier_replace()
+    {
+    }
+
+    bool BColorModifier_replace::operator==(const BColorModifier& rCompare) const
+    {
+        const BColorModifier_replace* pCompare = dynamic_cast< const BColorModifier_replace* >(&rCompare);
+
+        if(!pCompare)
         {
-            case BCOLORMODIFYMODE_INTERPOLATE :
-            {
-                return interpolate(maBColor, aSourceColor, mfValue);
-            }
-            case BCOLORMODIFYMODE_GRAY :
-            {
-                const double fLuminance(aSourceColor.luminance());
-                return ::basegfx::BColor(fLuminance, fLuminance, fLuminance);
-            }
-            case BCOLORMODIFYMODE_BLACKANDWHITE :
-            {
-                const double fLuminance(aSourceColor.luminance());
-
-                if(fLuminance < mfValue)
-                {
-                    return ::basegfx::BColor::getEmptyBColor();
-                }
-                else
-                {
-                    return ::basegfx::BColor(1.0, 1.0, 1.0);
-                }
-            }
-            case BCOLORMODIFYMODE_INVERT :
-            {
-                return ::basegfx::BColor(1.0 - aSourceColor.getRed(), 1.0 - aSourceColor.getGreen(), 1.0 - aSourceColor.getBlue());
-            }
-            case BCOLORMODIFYMODE_LUMINANCE_TO_ALPHA:
+            return false;
+        }
+
+        return getBColor() == pCompare->getBColor();
+    }
+
+    ::basegfx::BColor BColorModifier_replace::getModifiedColor(const ::basegfx::BColor& /*aSourceColor*/) const
+    {
+        return maBColor;
+    }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    BColorModifier_interpolate::~BColorModifier_interpolate()
+    {
+    }
+
+    bool BColorModifier_interpolate::operator==(const BColorModifier& rCompare) const
+    {
+        const BColorModifier_interpolate* pCompare = dynamic_cast< const BColorModifier_interpolate* >(&rCompare);
+
+        if(!pCompare)
+        {
+            return false;
+        }
+
+        return getBColor() == pCompare->getBColor() && getValue() == pCompare->getValue();
+    }
+
+    ::basegfx::BColor BColorModifier_interpolate::getModifiedColor(const ::basegfx::BColor& aSourceColor) const
+    {
+        return interpolate(maBColor, aSourceColor, mfValue);
+    }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    BColorModifier_black_and_white::~BColorModifier_black_and_white()
+    {
+    }
+
+    bool BColorModifier_black_and_white::operator==(const BColorModifier& rCompare) const
+    {
+        const BColorModifier_black_and_white* pCompare = dynamic_cast< const BColorModifier_black_and_white* >(&rCompare);
+
+        if(!pCompare)
+        {
+            return false;
+        }
+
+        return getValue() == pCompare->getValue();
+    }
+
+    ::basegfx::BColor BColorModifier_black_and_white::getModifiedColor(const ::basegfx::BColor& aSourceColor) const
+    {
+        const double fLuminance(aSourceColor.luminance());
+
+        if(fLuminance < mfValue)
+        {
+            return ::basegfx::BColor::getEmptyBColor();
+        }
+        else
+        {
+            return ::basegfx::BColor(1.0, 1.0, 1.0);
+        }
+    }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    BColorModifier_gamma::BColorModifier_gamma(double fValue)
+    :   BColorModifier(),
+        mfValue(fValue),
+        mfInvValue(fValue),
+        mbUseIt(!basegfx::fTools::equal(fValue, 1.0) && basegfx::fTools::more(fValue, 0.0) && basegfx::fTools::lessOrEqual(fValue, 10.0))
+    {
+        if(mbUseIt)
+        {
+            mfInvValue = 1.0 / mfValue;
+        }
+    }
+
+    BColorModifier_gamma::~BColorModifier_gamma()
+    {
+    }
+
+    bool BColorModifier_gamma::operator==(const BColorModifier& rCompare) const
+    {
+        const BColorModifier_gamma* pCompare = dynamic_cast< const BColorModifier_gamma* >(&rCompare);
+
+        if(!pCompare)
+        {
+            return false;
+        }
+
+        // getValue is sufficient, mfInvValue and mbUseIt are only helper values
+        return getValue() == pCompare->getValue();
+    }
+
+    ::basegfx::BColor BColorModifier_gamma::getModifiedColor(const ::basegfx::BColor& aSourceColor) const
+    {
+        if(mbUseIt)
+        {
+            ::basegfx::BColor aRetval(
+                pow(aSourceColor.getRed(), mfInvValue),
+                pow(aSourceColor.getGreen(), mfInvValue),
+                pow(aSourceColor.getBlue(), mfInvValue));
+
+            aRetval.clamp();
+            return aRetval;
+        }
+        else
+        {
+            return aSourceColor;
+        }
+    }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    BColorModifier_RGBLuminanceContrast::BColorModifier_RGBLuminanceContrast(double fRed, double fGreen, double fBlue, double fLuminance, double fContrast)
+    :   BColorModifier(),
+        mfRed(basegfx::clamp(fRed, -1.0, 1.0)),
+        mfGreen(basegfx::clamp(fGreen, -1.0, 1.0)),
+        mfBlue(basegfx::clamp(fBlue, -1.0, 1.0)),
+        mfLuminance(basegfx::clamp(fLuminance, -1.0, 1.0)),
+        mfContrast(basegfx::clamp(fContrast, -1.0, 1.0)),
+        mfContrastOff(1.0),
+        mfRedOff(0.0),
+        mfGreenOff(0.0),
+        mfBlueOff(0.0),
+        mbUseIt(false)
+    {
+        if(!basegfx::fTools::equalZero(mfRed)
+            || !basegfx::fTools::equalZero(mfGreen)
+            || !basegfx::fTools::equalZero(mfBlue)
+            || !basegfx::fTools::equalZero(mfLuminance)
+            || !basegfx::fTools::equalZero(mfContrast))
+        {
+            // calculate slope
+            if(mfContrast >= 0.0)
             {
-                const double fAlpha(1.0 - ((aSourceColor.getRed() * 0.2125) + (aSourceColor.getGreen() * 0.7154) + (aSourceColor.getBlue() * 0.0721)));
-                return ::basegfx::BColor(fAlpha, fAlpha, fAlpha);
+                mfContrastOff = 128.0 / (128.0 - (mfContrast * 127.0));
             }
-            default : // BCOLORMODIFYMODE_REPLACE
+            else
             {
-                return maBColor;
+                mfContrastOff = ( 128.0 + (mfContrast * 127.0)) / 128.0;
             }
+
+            // calculate unified contrast offset
+            const double fPreparedContrastOff((128.0 - mfContrastOff * 128.0) / 255.0);
+            const double fCombinedOffset(mfLuminance + fPreparedContrastOff);
+
+            // set full offsets
+            mfRedOff = mfRed + fCombinedOffset;
+            mfGreenOff = mfGreen + fCombinedOffset;
+            mfBlueOff = mfBlue + fCombinedOffset;
+
+            mbUseIt = true;
         }
     }
+
+    BColorModifier_RGBLuminanceContrast::~BColorModifier_RGBLuminanceContrast()
+    {
+    }
+
+    bool BColorModifier_RGBLuminanceContrast::operator==(const BColorModifier& rCompare) const
+    {
+        const BColorModifier_RGBLuminanceContrast* pCompare = dynamic_cast< const BColorModifier_RGBLuminanceContrast* >(&rCompare);
+
+        if(!pCompare)
+        {
+            return false;
+        }
+
+        // no need to compare other values, these are just helpers
+        return getRed() == pCompare->getRed()
+            && getGreen() == pCompare->getGreen()
+            && getBlue() == pCompare->getBlue()
+            && getLuminance() == pCompare->getLuminance()
+            && getContrast() == pCompare->getContrast();
+    }
+
+    ::basegfx::BColor BColorModifier_RGBLuminanceContrast::getModifiedColor(const ::basegfx::BColor& aSourceColor) const
+    {
+        if(mbUseIt)
+        {
+            return basegfx::BColor(
+                basegfx::clamp(aSourceColor.getRed() * mfContrastOff + mfRedOff, 0.0, 1.0),
+                basegfx::clamp(aSourceColor.getGreen() * mfContrastOff + mfGreenOff, 0.0, 1.0),
+                basegfx::clamp(aSourceColor.getBlue() * mfContrastOff + mfBlueOff, 0.0, 1.0));
+        }
+        else
+        {
+            return aSourceColor;
+        }
+    }
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    ::basegfx::BColor BColorModifierStack::getModifiedColor(const ::basegfx::BColor& rSource) const
+    {
+        if(maBColorModifiers.empty())
+        {
+            return rSource;
+        }
+
+        ::basegfx::BColor aRetval(rSource);
+
+        for(sal_uInt32 a(maBColorModifiers.size()); a;)
+        {
+            a--;
+            aRetval = maBColorModifiers[a]->getModifiedColor(aRetval);
+        }
+
+        return aRetval;
+    }
 } // end of namespace basegfx
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
index df69a36..cf1fd60 100644
--- a/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitive2d.cxx
@@ -22,6 +22,8 @@
 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
 #include <drawinglayer/primitive2d/maskprimitive2d.hxx>
 #include <drawinglayer/primitive2d/graphicprimitivehelper2d.hxx>
+#include <drawinglayer/primitive2d/unifiedtransparenceprimitive2d.hxx>
+#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/outdev.hxx>
@@ -37,79 +39,151 @@ namespace drawinglayer
         {
             Primitive2DSequence aRetval;
 
-            if(255L != getGraphicAttr().GetTransparency())
+            if(255L == getGraphicAttr().GetTransparency())
             {
-                // do not apply mirroring from GraphicAttr to the Metafile by calling
-                // GetTransformedGraphic, this will try to mirror the Metafile using Scale()
-                // at the Metafile. This again calls Scale at the single MetaFile actions,
-                // but this implementation never worked. I reworked that implementations,
-                // but for security reasons i will try not to use it.
-                basegfx::B2DHomMatrix aTransform(getTransform());
-
-                if(getGraphicAttr().IsMirrored())
-                {
-                    // content needs mirroring
-                    const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_HORZ);
-                    const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_VERT);
-
-                    // mirror by applying negative scale to the unit primitive and
-                    // applying the object transformation on it.
-                    aTransform = basegfx::tools::createScaleB2DHomMatrix(
-                        bHMirr ? -1.0 : 1.0,
-                        bVMirr ? -1.0 : 1.0);
-                    aTransform.translate(
-                        bHMirr ? 1.0 : 0.0,
-                        bVMirr ? 1.0 : 0.0);
-                    aTransform = getTransform() * aTransform;
-                }
+                // content is invisible, done
+                return aRetval;
+            }
+
+            // do not apply mirroring from GraphicAttr to the Metafile by calling
+            // GetTransformedGraphic, this will try to mirror the Metafile using Scale()
+            // at the Metafile. This again calls Scale at the single MetaFile actions,
+            // but this implementation never worked. I reworked that implementations,
+            // but for security reasons i will try not to use it.
+            basegfx::B2DHomMatrix aTransform(getTransform());
+
+            if(getGraphicAttr().IsMirrored())
+            {
+                // content needs mirroring
+                const bool bHMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_HORZ);
+                const bool bVMirr(getGraphicAttr().GetMirrorFlags() & BMP_MIRROR_VERT);
+
+                // mirror by applying negative scale to the unit primitive and
+                // applying the object transformation on it.
+                aTransform = basegfx::tools::createScaleB2DHomMatrix(
+                    bHMirr ? -1.0 : 1.0,
+                    bVMirr ? -1.0 : 1.0);
+                aTransform.translate(
+                    bHMirr ? 1.0 : 0.0,
+                    bVMirr ? 1.0 : 0.0);
+                aTransform = getTransform() * aTransform;
+            }
+
+            // Get transformed graphic. Suppress rotation and cropping, only filtering is needed
+            // here (and may be replaced later on). Cropping is handled below as mask primitive (if set).
+            // Also need to suppress mirroring, it is part of the transformation now (see above).
+            // Also move transparency handling to embedding to a UnifiedTransparencePrimitive2D; do
+            // that by remembering original transparency and applying that later if needed
+            GraphicAttr aSuppressGraphicAttr(getGraphicAttr());
+
+            aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
+            aSuppressGraphicAttr.SetRotation(0);
+            aSuppressGraphicAttr.SetMirrorFlags(0);
+            aSuppressGraphicAttr.SetTransparency(0);
+
+            const GraphicObject& rGraphicObject = getGraphicObject();
+            Graphic aTransformedGraphic(rGraphicObject.GetGraphic());
+            const bool isBitmap(GRAPHIC_BITMAP == aTransformedGraphic.GetType() && !aTransformedGraphic.getSvgData().get());
+            const bool isAdjusted(getGraphicAttr().IsAdjusted());
+            const bool isDrawMode(GRAPHICDRAWMODE_STANDARD != getGraphicAttr().GetDrawMode());
+
+            if(isBitmap && (isAdjusted || isDrawMode))
+            {
+                // the pure primitive solution with the color modifiers works well, too, but when
+                // it is a bitmap graphic the old modification currently is faster; so use it here
+                // instead of creating all as in create2DColorModifierEmbeddingsAsNeeded (see below).
+                // Still, crop, rotation, mirroring and transparency is handled by primitives already
+                // (see above).
+                // This could even be done when vector graphic, but we explicitely want to have the
+                // pure primitive solution for this; this will allow vector graphics to stay vector
+                // geraphics, independent from the color filtering stuff. This will enhance e.g.
+                // SVG and print quality while reducing data size at the same time.
+                // The other way around the old modifications when only used on already bitmap objects
+                // will not loose any quality.
+                aTransformedGraphic = rGraphicObject.GetTransformedGraphic(&aSuppressGraphicAttr);
+
+                // reset GraphicAttr after use to not apply double
+                aSuppressGraphicAttr = GraphicAttr();
+            }
+
+            // create sub-content; helper takes care of correct handling of
+            // bitmap, svg or metafile content
+            aRetval = create2DDecompositionOfGraphic(
+                aTransformedGraphic,
+                aTransform);
 
-                // Get transformed graphic. Suppress rotation and cropping, only filtering is needed
-                // here (and may be replaced later on). Cropping is handled below as mask primitive (if set).
-                // Also need to suppress mirroring, it is part of the transformation now (see above).
-                GraphicAttr aSuppressGraphicAttr(getGraphicAttr());
-                aSuppressGraphicAttr.SetCrop(0, 0, 0, 0);
-                aSuppressGraphicAttr.SetRotation(0);
-                aSuppressGraphicAttr.SetMirrorFlags(0);
+            if(!aRetval.getLength())
+            {
+                // content is invisible, done
+                return aRetval;
+            }
 
-                const GraphicObject& rGraphicObject = getGraphicObject();
-                const Graphic aTransformedGraphic(rGraphicObject.GetTransformedGraphic(&aSuppressGraphicAttr));
+            if(isAdjusted || isDrawMode)
+            {
+                // embed to needed ModifiedColorPrimitive2D's if necessary. Do this for
+                // adjustments and draw mode specials
+                aRetval = create2DColorModifierEmbeddingsAsNeeded(
+                    aRetval,
+                    aSuppressGraphicAttr.GetDrawMode(),
+                    basegfx::clamp(aSuppressGraphicAttr.GetLuminance() * 0.01, -1.0, 1.0),
+                    basegfx::clamp(aSuppressGraphicAttr.GetContrast() * 0.01, -1.0, 1.0),
+                    basegfx::clamp(aSuppressGraphicAttr.GetChannelR() * 0.01, -1.0, 1.0),
+                    basegfx::clamp(aSuppressGraphicAttr.GetChannelG() * 0.01, -1.0, 1.0),
+                    basegfx::clamp(aSuppressGraphicAttr.GetChannelB() * 0.01, -1.0, 1.0),
+                    basegfx::clamp(aSuppressGraphicAttr.GetGamma(), 0.0, 10.0),
+                    aSuppressGraphicAttr.IsInvert());
+
+                if(!aRetval.getLength())
+                {
+                    // content is invisible, done
+                    return aRetval;
+                }
+            }
 
-                aRetval = create2DDecompositionOfGraphic(
-                    aTransformedGraphic,
-                    aTransform);
+            if(getGraphicAttr().IsTransparent())
+            {
+                // check for transparency
+                const double fTransparency(basegfx::clamp(getGraphicAttr().GetTransparency() * (1.0 / 255.0), 0.0, 1.0));
 
-                if(aRetval.getLength())
+                if(!basegfx::fTools::equalZero(fTransparency))
                 {
-                    // check for cropping
-                    if(getGraphicAttr().IsCropped())
-                    {
-                        // calculate scalings between real image size and logic object size. This
-                        // is necessary since the crop values are relative to original bitmap size
-                        const basegfx::B2DVector aObjectScale(aTransform * basegfx::B2DVector(1.0, 1.0));
-                        const basegfx::B2DVector aCropScaleFactor(
-                            rGraphicObject.calculateCropScaling(
-                                aObjectScale.getX(),
-                                aObjectScale.getY(),
-                                getGraphicAttr().GetLeftCrop(),
-                                getGraphicAttr().GetTopCrop(),
-                                getGraphicAttr().GetRightCrop(),
-                                getGraphicAttr().GetBottomCrop()));
-
-                        // embed content in cropPrimitive
-                        Primitive2DReference xPrimitive(
-                            new CropPrimitive2D(
-                                aRetval,
-                                aTransform,
-                                getGraphicAttr().GetLeftCrop() * aCropScaleFactor.getX(),
-                                getGraphicAttr().GetTopCrop() * aCropScaleFactor.getY(),
-                                getGraphicAttr().GetRightCrop() * aCropScaleFactor.getX(),
-                                getGraphicAttr().GetBottomCrop() * aCropScaleFactor.getY()));
-
-                        aRetval = Primitive2DSequence(&xPrimitive, 1);
-                    }
+                    const Primitive2DReference aUnifiedTransparence(
+                        new UnifiedTransparencePrimitive2D(
+                            aRetval,
+                            fTransparency));
+
+                    aRetval = Primitive2DSequence(&aUnifiedTransparence, 1);
                 }
             }
 
+            if(getGraphicAttr().IsCropped())
+            {
+                // check for cropping
+                // calculate scalings between real image size and logic object size. This
+                // is necessary since the crop values are relative to original bitmap size
+                const basegfx::B2DVector aObjectScale(aTransform * basegfx::B2DVector(1.0, 1.0));
+                const basegfx::B2DVector aCropScaleFactor(
+                    rGraphicObject.calculateCropScaling(
+                        aObjectScale.getX(),
+                        aObjectScale.getY(),
+                        getGraphicAttr().GetLeftCrop(),
+                        getGraphicAttr().GetTopCrop(),
+                        getGraphicAttr().GetRightCrop(),
+                        getGraphicAttr().GetBottomCrop()));
+
+                // embed content in cropPrimitive
+                Primitive2DReference xPrimitive(
+                    new CropPrimitive2D(
+                        aRetval,
+                        aTransform,
+                        getGraphicAttr().GetLeftCrop() * aCropScaleFactor.getX(),
+                        getGraphicAttr().GetTopCrop() * aCropScaleFactor.getY(),
+                        getGraphicAttr().GetRightCrop() * aCropScaleFactor.getX(),
+                        getGraphicAttr().GetBottomCrop() * aCropScaleFactor.getY()));
+
+                aRetval = Primitive2DSequence(&xPrimitive, 1);
+            }
+
             return aRetval;
         }
 
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index 91c5cae..ca96b23 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -24,8 +24,10 @@
 #include <drawinglayer/primitive2d/metafileprimitive2d.hxx>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
 #include <drawinglayer/primitive2d/maskprimitive2d.hxx>
+#include <drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
 #include <basegfx/polygon/b2dpolygontools.hxx>
+#include <basegfx/numeric/ftools.hxx>
 
 //////////////////////////////////////////////////////////////////////////////
 // helper class for animated graphics
@@ -324,4 +326,137 @@ namespace drawinglayer
     } // end of namespace primitive2d
 } // end of namespace drawinglayer
 
+//////////////////////////////////////////////////////////////////////////////
+
+namespace drawinglayer
+{
+    namespace primitive2d
+    {
+        Primitive2DSequence create2DColorModifierEmbeddingsAsNeeded(
+            const Primitive2DSequence& rChildren,
+            GraphicDrawMode aGraphicDrawMode,
+            double fLuminance,
+            double fContrast,
+            double fRed,
+            double fGreen,
+            double fBlue,
+            double fGamma,
+            bool bInvert)
+        {
+            Primitive2DSequence aRetval;
+
+            if(!rChildren.getLength())
+            {
+                // no child content, done
+                return aRetval;
+            }
+
+            // set child content as retval; that is what will be used as child content in all
+            // embeddings from here
+            aRetval = rChildren;
+
+            if(GRAPHICDRAWMODE_WATERMARK == aGraphicDrawMode)
+            {
+                // this is solved by applying fixed values additionally to luminance
+                // and contrast, do it here and reset DrawMode to GRAPHICDRAWMODE_STANDARD
+                // original in svtools uses:
+                // #define WATERMARK_LUM_OFFSET        50
+                // #define WATERMARK_CON_OFFSET        -70
+                fLuminance = basegfx::clamp(fLuminance + 0.5, -1.0, 1.0);
+                fContrast = basegfx::clamp(fContrast - 0.7, -1.0, 1.0);
+                aGraphicDrawMode = GRAPHICDRAWMODE_STANDARD;
+            }
+
+            // DrawMode (GRAPHICDRAWMODE_WATERMARK already handled)
+            switch(aGraphicDrawMode)
+            {
+                case GRAPHICDRAWMODE_GREYS:
+                {
+                    // convert to grey
+                    const Primitive2DReference aPrimitiveGrey(
+                        new ModifiedColorPrimitive2D(
+                            aRetval,
+                            basegfx::BColorModifierSharedPtr(
+                                new basegfx::BColorModifier_gray())));
+
+                    aRetval = Primitive2DSequence(&aPrimitiveGrey, 1);
+                    break;
+                }
+                case GRAPHICDRAWMODE_MONO:
+                {
+                    // convert to mono (black/white with threshold 0.5)
+                    const Primitive2DReference aPrimitiveBlackAndWhite(
+                        new ModifiedColorPrimitive2D(
+                            aRetval,
+                            basegfx::BColorModifierSharedPtr(
+                                new basegfx::BColorModifier_black_and_white(0.5))));
+
+                    aRetval = Primitive2DSequence(&aPrimitiveBlackAndWhite, 1);
+                    break;
+                }
+                case GRAPHICDRAWMODE_WATERMARK:
+                {
+                    OSL_ENSURE(false, "OOps, GRAPHICDRAWMODE_WATERMARK should already be handled (see above)");
+                    // fallthrough intended
+                }
+                default: // case GRAPHICDRAWMODE_STANDARD:
+                {
+                    // nothing to do
+                    break;
+                }
+            }
+
+            // mnContPercent, mnLumPercent, mnRPercent, mnGPercent, mnBPercent
+            // handled in a single call
+            if(!basegfx::fTools::equalZero(fLuminance)
+                || !basegfx::fTools::equalZero(fContrast)
+                || !basegfx::fTools::equalZero(fRed)
+                || !basegfx::fTools::equalZero(fGreen)
+                || !basegfx::fTools::equalZero(fBlue))
+            {
+                const Primitive2DReference aPrimitiveRGBLuminannceContrast(
+                    new ModifiedColorPrimitive2D(
+                        aRetval,
+                        basegfx::BColorModifierSharedPtr(
+                            new basegfx::BColorModifier_RGBLuminanceContrast(
+                                fRed,
+                                fGreen,
+                                fBlue,
+                                fLuminance,
+                                fContrast))));
+
+                aRetval = Primitive2DSequence(&aPrimitiveRGBLuminannceContrast, 1);
+            }
+
+            // gamma (boolean)
+            if(!basegfx::fTools::equal(fGamma, 1.0))
+            {
+                const Primitive2DReference aPrimitiveGamma(
+                    new ModifiedColorPrimitive2D(
+                        aRetval,
+                        basegfx::BColorModifierSharedPtr(
+                            new basegfx::BColorModifier_gamma(
+                                fGamma))));
+
+                aRetval = Primitive2DSequence(&aPrimitiveGamma, 1);
+            }
+
+            // invert (boolean)
+            if(bInvert)
+            {
+                const Primitive2DReference aPrimitiveInvert(
+                    new ModifiedColorPrimitive2D(
+                        aRetval,
+                        basegfx::BColorModifierSharedPtr(
+                            new basegfx::BColorModifier_invert())));
+
+                aRetval = Primitive2DSequence(&aPrimitiveInvert, 1);
+            }
+
+            return aRetval;
+        }
+
+    } // end of namespace primitive2d
+} // end of namespace drawinglayer
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index d08a8ed..40913fa 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -1057,7 +1057,9 @@ namespace
                     rTargetHolders.Current().append(
                         new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
                             aSubContent,
-                            basegfx::BColorModifier(basegfx::BColor(0.0, 0.0, 0.0))));
+                            basegfx::BColorModifierSharedPtr(
+                                new basegfx::BColorModifier_replace(
+                                    basegfx::BColor(0.0, 0.0, 0.0)))));
                 }
                 else // if(rPropertyHolders.Current().isRasterOpInvert())
                 {
diff --git a/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
index 96af83a..ab664f2 100644
--- a/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/modifiedcolorprimitive2d.cxx
@@ -32,7 +32,7 @@ namespace drawinglayer
     {
         ModifiedColorPrimitive2D::ModifiedColorPrimitive2D(
             const Primitive2DSequence& rChildren,
-            const basegfx::BColorModifier& rColorModifier)
+            const basegfx::BColorModifierSharedPtr& rColorModifier)
         :   GroupPrimitive2D(rChildren),
             maColorModifier(rColorModifier)
         {
@@ -44,7 +44,17 @@ namespace drawinglayer
             {
                 const ModifiedColorPrimitive2D& rCompare = (ModifiedColorPrimitive2D&)rPrimitive;
 
-                return (getColorModifier() == rCompare.getColorModifier());
+                if(getColorModifier().get() == rCompare.getColorModifier().get())
+                {
+                    return true;
+                }
+
+                if(!getColorModifier().get() || !rCompare.getColorModifier().get())
+                {
+                    return false;
+                }
+
+                return *getColorModifier().get() == *rCompare.getColorModifier().get();
             }
 
             return false;
diff --git a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
index 1499faa..4fe7c8e 100644
--- a/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/shadowprimitive2d.cxx
@@ -73,8 +73,13 @@ namespace drawinglayer
             if(getChildren().hasElements())
             {
                 // create a modifiedColorPrimitive containing the shadow color and the content
-                const basegfx::BColorModifier aBColorModifier(getShadowColor());
-                const Primitive2DReference xRefA(new ModifiedColorPrimitive2D(getChildren(), aBColorModifier));
+                const basegfx::BColorModifierSharedPtr aBColorModifier(
+                    new basegfx::BColorModifier_replace(
+                        getShadowColor()));
+                const Primitive2DReference xRefA(
+                    new ModifiedColorPrimitive2D(
+                        getChildren(),
+                        aBColorModifier));
                 const Primitive2DSequence aSequenceB(&xRefA, 1L);
 
                 // build transformed primitiveVector with shadow offset and add to target
diff --git a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
index 5dc453f..254ac1b 100644
--- a/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/texteffectprimitive2d.cxx
@@ -84,20 +84,44 @@ namespace drawinglayer
                     if(bDefaultTextColor)
                     {
                         // emboss/engrave in black, original forced to white
-                        const basegfx::BColorModifier aBColorModifierToGray(basegfx::BColor(0.0));
-                        const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray));
-                        aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, Primitive2DSequence(&xModifiedColor, 1)));
+                        const basegfx::BColorModifierSharedPtr aBColorModifierToGray(
+                            new basegfx::BColorModifier_replace(
+                                basegfx::BColor(0.0)));
+                        const Primitive2DReference xModifiedColor(
+                            new ModifiedColorPrimitive2D(
+                                getTextContent(),
+                                aBColorModifierToGray));
+
+                        aRetval[0] = Primitive2DReference(
+                            new TransformPrimitive2D(
+                                aTransform,
+                                Primitive2DSequence(&xModifiedColor, 1)));
 
                         // add original, too
-                        const basegfx::BColorModifier aBColorModifierToWhite(basegfx::BColor(1.0));
-                        aRetval[1] = Primitive2DReference(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite));
+                        const basegfx::BColorModifierSharedPtr aBColorModifierToWhite(
+                            new basegfx::BColorModifier_replace(
+                                basegfx::BColor(1.0)));
+
+                        aRetval[1] = Primitive2DReference(
+                            new ModifiedColorPrimitive2D(
+                                getTextContent(),
+                                aBColorModifierToWhite));
                     }
                     else
                     {
                         // emboss/engrave in gray, keep original's color
-                        const basegfx::BColorModifier aBColorModifierToGray(basegfx::BColor(0.75)); // 192
-                        const Primitive2DReference xModifiedColor(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToGray));
-                        aRetval[0] = Primitive2DReference(new TransformPrimitive2D(aTransform, Primitive2DSequence(&xModifiedColor, 1)));
+                        const basegfx::BColorModifierSharedPtr aBColorModifierToGray(
+                            new basegfx::BColorModifier_replace(
+                                basegfx::BColor(0.75))); // 192
+                        const Primitive2DReference xModifiedColor(
+                            new ModifiedColorPrimitive2D(
+                                getTextContent(),
+                                aBColorModifierToGray));
+
+                        aRetval[0] = Primitive2DReference(
+                            new TransformPrimitive2D(
+                                aTransform,
+                                Primitive2DSequence(&xModifiedColor, 1)));
 
                         // add original, too
                         aRetval[1] = Primitive2DReference(new GroupPrimitive2D(getTextContent()));
@@ -144,8 +168,13 @@ namespace drawinglayer
                     aRetval[7] = Primitive2DReference(new TransformPrimitive2D(aTransform, getTextContent()));
 
                     // at last, place original over it, but force to white
-                    const basegfx::BColorModifier aBColorModifierToWhite(basegfx::BColor(1.0, 1.0, 1.0));
-                    aRetval[8] = Primitive2DReference(new ModifiedColorPrimitive2D(getTextContent(), aBColorModifierToWhite));
+                    const basegfx::BColorModifierSharedPtr aBColorModifierToWhite(
+                        new basegfx::BColorModifier_replace(
+                            basegfx::BColor(1.0, 1.0, 1.0)));
+                    aRetval[8] = Primitive2DReference(
+                        new ModifiedColorPrimitive2D(
+                            getTextContent(),
+                            aBColorModifierToWhite));
 
                     break;
                 }
diff --git a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
index daff063..a01007b 100644
--- a/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
+++ b/drawinglayer/source/primitive3d/modifiedcolorprimitive3d.cxx
@@ -32,7 +32,7 @@ namespace drawinglayer
     {
         ModifiedColorPrimitive3D::ModifiedColorPrimitive3D(
             const Primitive3DSequence& rChildren,
-            const basegfx::BColorModifier& rColorModifier)
+            const basegfx::BColorModifierSharedPtr& rColorModifier)
         :   GroupPrimitive3D(rChildren),
             maColorModifier(rColorModifier)
         {
@@ -44,7 +44,17 @@ namespace drawinglayer
             {
                 const ModifiedColorPrimitive3D& rCompare = (ModifiedColorPrimitive3D&)rPrimitive;
 
-                return (maColorModifier == rCompare.maColorModifier);
+                if(getColorModifier().get() == rCompare.getColorModifier().get())
+                {
+                    return true;
+                }
+
+                if(!getColorModifier().get() || !rCompare.getColorModifier().get())
+                {
+                    return false;
+                }
+
+                return *getColorModifier().get() == *rCompare.getColorModifier().get();
             }
 
             return false;
diff --git a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
index 667fae1..c301f3b 100644
--- a/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
+++ b/drawinglayer/source/primitive3d/sdrdecompositiontools3d.cxx
@@ -247,8 +247,13 @@ namespace drawinglayer
                     if(::com::sun::star::drawing::TextureKind2_LUMINANCE == aSdr3DObjectAttribute.getTextureKind())
                     {
                         // use modified color primitive to force textures to gray
-                        const basegfx::BColorModifier aBColorModifier(basegfx::BColor(), 0.0, basegfx::BCOLORMODIFYMODE_GRAY);
-                        const Primitive3DReference xRef2(new ModifiedColorPrimitive3D(aRetval, aBColorModifier));
+                        const basegfx::BColorModifierSharedPtr aBColorModifier(
+                            new basegfx::BColorModifier_gray());
+                        const Primitive3DReference xRef2(
+                            new ModifiedColorPrimitive3D(
+                                aRetval,
+                                aBColorModifier));
+
                         aRetval = Primitive3DSequence(&xRef2, 1L);
                     }
                 }
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 1cd768e..7f2ab70 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -688,9 +688,10 @@ namespace drawinglayer
 
                             if(nBColorModifierStackCount)
                             {
-                                const basegfx::BColorModifier& rTopmostModifier = maBColorModifierStack.getBColorModifier(nBColorModifierStackCount - 1);
+                                const basegfx::BColorModifierSharedPtr& rTopmostModifier = maBColorModifierStack.getBColorModifier(nBColorModifierStackCount - 1);
+                                const basegfx::BColorModifier_replace* pReplacer = dynamic_cast< const basegfx::BColorModifier_replace* >(rTopmostModifier.get());
 
-                                if(basegfx::BCOLORMODIFYMODE_REPLACE == rTopmostModifier.getMode())
+                                if(pReplacer)
                                 {
                                     // the bitmap fill is in unified color, so we can replace it with
                                     // a single polygon fill. The form of the fill depends on tiling
@@ -701,7 +702,7 @@ namespace drawinglayer
 
                                         aLocalPolyPolygon.transform(maCurrentTransformation);
                                         mpOutputDevice->SetLineColor();
-                                        mpOutputDevice->SetFillColor(Color(rTopmostModifier.getBColor()));
+                                        mpOutputDevice->SetFillColor(Color(pReplacer->getBColor()));
                                         mpOutputDevice->DrawPolyPolygon(aLocalPolyPolygon);
                                     }
                                     else
@@ -733,7 +734,7 @@ namespace drawinglayer
                                         {
                                             aTarget.transform(maCurrentTransformation);
                                             mpOutputDevice->SetLineColor();
-                                            mpOutputDevice->SetFillColor(Color(rTopmostModifier.getBColor()));
+                                            mpOutputDevice->SetFillColor(Color(pReplacer->getBColor()));
                                             mpOutputDevice->DrawPolyPolygon(aTarget);
                                         }
                                     }
diff --git a/drawinglayer/source/tools/converters.cxx b/drawinglayer/source/tools/converters.cxx
index 76f37d5..dfd0b8f 100644
--- a/drawinglayer/source/tools/converters.cxx
+++ b/drawinglayer/source/tools/converters.cxx
@@ -114,14 +114,12 @@ namespace drawinglayer
                     maContent.Erase();
 
                     // embed primitives to paint them black
-                    static basegfx::BColorModifyMode aMode = basegfx::BCOLORMODIFYMODE_REPLACE;
                     const primitive2d::Primitive2DReference xRef(
                         new primitive2d::ModifiedColorPrimitive2D(
                             aSequence,
-                            basegfx::BColorModifier(
-                                basegfx::BColor(0.0, 0.0, 0.0),
-                                0.5,
-                                aMode)));
+                            basegfx::BColorModifierSharedPtr(
+                                new basegfx::BColorModifier_replace(
+                                    basegfx::BColor(0.0, 0.0, 0.0)))));
                     const primitive2d::Primitive2DSequence xSeq(&xRef, 1);
 
                     // render
diff --git a/include/basegfx/color/bcolor.hxx b/include/basegfx/color/bcolor.hxx
index 152984a..6533c64 100644
--- a/include/basegfx/color/bcolor.hxx
+++ b/include/basegfx/color/bcolor.hxx
@@ -190,18 +190,20 @@ namespace basegfx
         }
 
         // clamp color to [0.0..1.0] values in all three intensity components
-        void clamp()
+        BColor& clamp()
         {
             mfX = basegfx::clamp(mfX, 0.0, 1.0);
             mfY = basegfx::clamp(mfY, 0.0, 1.0);
             mfZ = basegfx::clamp(mfZ, 0.0, 1.0);
+            return *this;
         }
 
-        void invert()
+        BColor& invert()
         {
             mfX = 1.0 - mfX;
             mfY = 1.0 - mfY;
             mfZ = 1.0 - mfZ;
+            return *this;
         }
 
         static const BColor& getEmptyBColor()
diff --git a/include/basegfx/color/bcolormodifier.hxx b/include/basegfx/color/bcolormodifier.hxx
index b8fbd9a..b174f48 100644
--- a/include/basegfx/color/bcolormodifier.hxx
+++ b/include/basegfx/color/bcolormodifier.hxx
@@ -20,73 +20,370 @@
 #ifndef INCLUDED_BASEGFX_COLOR_BCOLORMODIFIER_HXX
 #define INCLUDED_BASEGFX_COLOR_BCOLORMODIFIER_HXX
 
+#include <basegfx/basegfxdllapi.h>
 #include <basegfx/color/bcolor.hxx>
+#include <boost/shared_ptr.hpp>
+#include <boost/utility.hpp>
 #include <vector>
-#include <basegfx/basegfxdllapi.h>
 
 //////////////////////////////////////////////////////////////////////////////
 
 namespace basegfx
 {
-    /** Descriptor for type of color modification
+    /** base class to define color modifications
+
+        The basic idea is to have instances of color modifiers where each
+        of these can be asked to get a modified version of a color. This
+        can be as easy as to return a fixed color, but may also do any
+        other computation based on the given source color and the local
+        algorythm to apply.
+
+        This base implementation defines the abstract base class. Every
+        derivation offers another color blending effect, when needed with
+        parameters for that blending defined as members.
+
+        As long as aw080 is not applied, an operator== is needed to implement
+        the operator== of the primitive based on this instances.
+
+        For the exact definitions of the color blending applied refer to the
+        implementation of the method getModifiedColor
+
+        BColorModifier is not copyable (no copy constructor, no assigment
+        operator); local values cannot be changed after construction. The
+        instances are cheap and the idea is to create them on demand. To
+        be able to reuse these as much as possible, a define for a
+        ::boost::shared_ptr named BColorModifierSharedPtr exists below.
+        All usages should handle instances of BColorModifier encapsulated
+        into these shared pointers.
     */
-    enum BColorModifyMode
+    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier : private boost::noncopyable
     {
-        BCOLORMODIFYMODE_REPLACE,               // replace all color with local color
-        BCOLORMODIFYMODE_INTERPOLATE,           // interpolate color between given and local with local value
-        BCOLORMODIFYMODE_GRAY,                  // convert color to gray
-        BCOLORMODIFYMODE_BLACKANDWHITE,         // convert color to B&W, local value is treshhold
-        BCOLORMODIFYMODE_INVERT,                // invert color
-        BCOLORMODIFYMODE_LUMINANCE_TO_ALPHA     // convert color to alpha value (used for Svg Mask)
+    private:
+    protected:
+        // noone is allowed to incarnate the abstract base class
+        // except derivations
+        BColorModifier() {}
+
+    public:
+        // noone should directly destroy it; all incarnations should be
+        // handled in a boost::shared_ptr of type BColorModifierSharedPtr
+        virtual ~BColorModifier();
+
+        // compare operator
+        virtual bool operator==(const BColorModifier& rCompare) const = 0;
+        bool operator!=(const BColorModifier& rCompare) const
+        {
+            return !(operator==(rCompare));
+        }
+
+        // compute modified color
+        virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const = 0;
     };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
 
-    /** Class to hold a color, value and mode for a color modification. Color modification is
-        done calling the getModifiedColor() method
+namespace basegfx
+{
+    /** convert color to gray
     */
-    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier
+    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier_gray : public BColorModifier
     {
+    private:
     protected:
-        ::basegfx::BColor                           maBColor;
-        double                                      mfValue;
-        BColorModifyMode                            meMode;
+    public:
+        BColorModifier_gray()
+        :   BColorModifier()
+        {
+        }
+
+        virtual ~BColorModifier_gray();
+
+        // compare operator
+        virtual bool operator==(const BColorModifier& rCompare) const;
+
+        // compute modified color
+        virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
+    };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
 
+namespace basegfx
+{
+    /** invert color
+
+        returns a color where red green and blue are inverted using 1.0 - n
+    */
+    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier_invert : public BColorModifier
+    {
+    private:
+    protected:
     public:
-        BColorModifier(
-            const ::basegfx::BColor& rBColor,
-            double fValue = 0.5,
-            BColorModifyMode eMode = BCOLORMODIFYMODE_REPLACE)
-        :   maBColor(rBColor),
-            mfValue(fValue),
-            meMode(eMode)
-        {}
-
-        // compare operator(s)
-        bool operator==(const BColorModifier& rCompare) const
+        BColorModifier_invert()
+        :   BColorModifier()
         {
-            return (maBColor == rCompare.maBColor && mfValue == rCompare.mfValue && meMode == rCompare.meMode);
         }
 
-        bool operator!=(const BColorModifier& rCompare) const
+        virtual ~BColorModifier_invert();
+
+        // compare operator
+        virtual bool operator==(const BColorModifier& rCompare) const;
+
+        // compute modified color
+        virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
+    };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    /** convert to alpha based on luminance
+
+        returns a color where red green and blue are first weighted and added
+        to build a luminance value which is then inverted and used for red,
+        green and blue. The weights are  r * 0.2125 + g * 0.7154 + b * 0.0721.
+        This derivation is used for the svg importer and does exactly what SVG
+        defines for this needed case.
+    */
+    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier_luminance_to_alpha : public BColorModifier
+    {
+    private:
+    protected:
+    public:
+        BColorModifier_luminance_to_alpha()
+        :   BColorModifier()
+        {
+        }
+
+        virtual ~BColorModifier_luminance_to_alpha();
+
+        // compare operator
+        virtual bool operator==(const BColorModifier& rCompare) const;
+
+        // compute modified color
+        virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
+    };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    /** replace color
+
+        does not use the source color at all, but always returns the
+        given color, replacing everything. Useful e.g. for unified shadow
+        creation
+    */
+    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier_replace : public BColorModifier
+    {
+    private:
+        ::basegfx::BColor           maBColor;
+
+    protected:
+    public:
+        BColorModifier_replace(const ::basegfx::BColor& rBColor)
+        :   BColorModifier(),
+            maBColor(rBColor)
+        {
+        }
+
+        virtual ~BColorModifier_replace();
+
+        // data access
+        const ::basegfx::BColor& getBColor() const { return maBColor; }
+
+        // compare operator
+        virtual bool operator==(const BColorModifier& rCompare) const;
+
+        // compute modified color
+        virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
+    };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    /** interpolate color
+
+        returns an interpolated color mixed by the given value (f) in the range
+        [0.0 .. 1.0] and the given color (col) as follows:
+
+        col * (1 - f) + aSourceColor * f
+    */
+    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier_interpolate : public BColorModifier
+    {
+    private:
+        ::basegfx::BColor           maBColor;
+        double                      mfValue;
+
+    protected:
+    public:
+        BColorModifier_interpolate(const ::basegfx::BColor& rBColor, double fValue)
+        :   BColorModifier(),
+            maBColor(rBColor),
+            mfValue(fValue)
         {
-            return !(operator==(rCompare));
         }
 
+        virtual ~BColorModifier_interpolate();
+
         // data access
         const ::basegfx::BColor& getBColor() const { return maBColor; }
         double getValue() const { return mfValue; }
-        BColorModifyMode getMode() const { return meMode; }
+
+        // compare operator
+        virtual bool operator==(const BColorModifier& rCompare) const;
+
+        // compute modified color
+        virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
+    };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    /** convert color to black and white
+
+        returns black when the luminance of the given color is less than
+        the given treshhold value in the range [0.0 .. 1.0], else white
+    */
+    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier_black_and_white : public BColorModifier
+    {
+    private:
+        double                      mfValue;
+
+    protected:
+    public:
+        BColorModifier_black_and_white(double fValue)
+        :   BColorModifier(),
+            mfValue(fValue)
+        {
+        }
+
+        virtual ~BColorModifier_black_and_white();
+
+        // data access
+        double getValue() const { return mfValue; }
+
+        // compare operator
+        virtual bool operator==(const BColorModifier& rCompare) const;
+
+        // compute modified color
+        virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
+    };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    /** gamma correction
+
+        Input is a gamma correction value in the range ]0.0 .. 10.0]; the
+        color values get correted using
+
+        col(r,g,b) = clamp(pow(col(r,g,b), 1.0 / gamma), 0.0, 1.0)
+    */
+    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier_gamma : public BColorModifier
+    {
+    private:
+        double                      mfValue;
+        double                      mfInvValue;
+
+        /// bitfield
+        bool                        mbUseIt : 1;
+
+    protected:
+    public:
+        BColorModifier_gamma(double fValue);
+
+        virtual ~BColorModifier_gamma();
+
+        // data access
+        double getValue() const { return mfValue; }
+
+        // compare operator
+        virtual bool operator==(const BColorModifier& rCompare) const;
+
+        // compute modified color
+        virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
+    };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    /** Red, Green, Blue, Luminance and Contrast correction
+
+        Input are percent values from [-1.0 .. 1-0] which correspond to -100% to 100%
+        correction of Red, Green, Blue, Luminance or Contrast. 0.0 means no change of
+        the corresponding channel. All these are combined (but can be used single) to
+        - be able to cover a bigger change range utilizing the cmobination
+        - allow execution by a small, common, precalculated table
+    */
+    class BASEGFX_DLLPUBLIC SAL_WARN_UNUSED BColorModifier_RGBLuminanceContrast : public BColorModifier
+    {
+    private:
+        double                      mfRed;
+        double                      mfGreen;
+        double                      mfBlue;
+        double                      mfLuminance;
+        double                      mfContrast;
+
+        double                      mfContrastOff;
+        double                      mfRedOff;
+        double                      mfGreenOff;
+        double                      mfBlueOff;
+
+        /// bitfield
+        bool                        mbUseIt : 1;
+
+    protected:
+    public:
+        BColorModifier_RGBLuminanceContrast(double fRed, double fGreen, double fBlue, double fLuminance, double fContrast);
+
+        virtual ~BColorModifier_RGBLuminanceContrast();
+
+        // data access
+        double getRed() const { return mfRed; }
+        double getGreen() const { return mfGreen; }
+        double getBlue() const { return mfBlue; }
+        double getLuminance() const { return mfLuminance; }
+        double getContrast() const { return mfContrast; }
+
+        // compare operator
+        virtual bool operator==(const BColorModifier& rCompare) const;
 
         // compute modified color
-        ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
+        virtual ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& aSourceColor) const;
     };
+} // end of namespace basegfx
+
+//////////////////////////////////////////////////////////////////////////////
+
+namespace basegfx
+{
+    /// typedef to allow working with shared instances of BColorModifier
+    /// for the whole mechanism
+    typedef ::boost::shared_ptr< BColorModifier > BColorModifierSharedPtr;
 
-    /** Class to hold a stack of BColorModifiers and to get the modified color with
-        applying all existing entry changes
+    /** Class to hold a stack of BColorModifierSharedPtrs and to get the modified color with
+        applying all existing entry changes as defined in the stack. Instances of BColorModifier
+        can be pushed and popped to change the stack.
+
+        All references to BColorModifier members use shared pointers, thus instances of
+        BColorModifierStack can be copied by the default mechanisms if needed.
     */
     class BASEGFX_DLLPUBLIC BColorModifierStack
     {
     protected:
-        ::std::vector< BColorModifier >             maBColorModifiers;
+        ::std::vector< BColorModifierSharedPtr >        maBColorModifiers;
 
     public:
         sal_uInt32 count() const
@@ -94,33 +391,17 @@ namespace basegfx
             return maBColorModifiers.size();
         }
 
-        const BColorModifier& getBColorModifier(sal_uInt32 nIndex) const
+        const BColorModifierSharedPtr& getBColorModifier(sal_uInt32 nIndex) const
         {
             OSL_ENSURE(nIndex < count(), "BColorModifierStack: Access out of range (!)");
             return maBColorModifiers[nIndex];
         }
 
-        ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& rSource) const
-        {
-            if(count())
-            {
-                ::basegfx::BColor aRetval(rSource);
-                ::std::vector< BColorModifier >::const_iterator aEnd(maBColorModifiers.end());
-
-                while(aEnd != maBColorModifiers.begin())
-                {
-                    aRetval = (--aEnd)->getModifiedColor(aRetval);
-                }
-
-                return aRetval;
-            }
-            else
-            {
-                return rSource;
-            }
-        }
+        // get the color in it's modified form by applying all existing BColorModifiers,
+        // from back to front (the newest first)
+        ::basegfx::BColor getModifiedColor(const ::basegfx::BColor& rSource) const;
 
-        void push(const BColorModifier& rNew)
+        void push(const BColorModifierSharedPtr& rNew)
         {
             maBColorModifiers.push_back(rNew);
         }
@@ -132,6 +413,8 @@ namespace basegfx
     };
 } // end of namespace basegfx
 
+//////////////////////////////////////////////////////////////////////////////
+
 #endif // INCLUDED_BASEGFX_COLOR_BCOLORMODIFIER_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx b/include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx
index 9755a2d..00e11b3 100644
--- a/include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx
+++ b/include/drawinglayer/primitive2d/graphicprimitivehelper2d.hxx
@@ -21,6 +21,7 @@
 
 #include <drawinglayer/drawinglayerdllapi.h>
 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <svtools/grfmgr.hxx>
 
 //////////////////////////////////////////////////////////////////////////////
 // predefines
@@ -44,6 +45,22 @@ namespace drawinglayer
         Primitive2DSequence create2DDecompositionOfGraphic(
             const Graphic& rGraphic,
             const basegfx::B2DHomMatrix& rTransform);
+
+        /** Helper to embed given sequence of primitives to evtl. a stack
+            of ModifiedColorPrimitive2D's to get all the needed modifications
+            applied.
+        */
+        Primitive2DSequence create2DColorModifierEmbeddingsAsNeeded(
+            const Primitive2DSequence& rChildren,
+            GraphicDrawMode aGraphicDrawMode = GRAPHICDRAWMODE_STANDARD,
+            double fLuminance = 0.0,        // [-1.0 .. 1.0]
+            double fContrast = 0.0,         // [-1.0 .. 1.0]
+            double fRed = 0.0,              // [-1.0 .. 1.0]
+            double fGreen = 0.0,            // [-1.0 .. 1.0]
+            double fBlue = 0.0,             // [-1.0 .. 1.0]
+            double fGamma = 1.0,            // ]0.0 .. 10.0]
+            bool bInvert = false);
+
     } // end of namespace primitive2d
 } // end of namespace drawinglayer
 
diff --git a/include/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx b/include/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
index 4dc0371..6f68a89 100644
--- a/include/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/modifiedcolorprimitive2d.hxx
@@ -17,6 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+
+
 #ifndef INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_MODIFIEDCOLORPRIMITIVE2D_HXX
 
@@ -42,7 +44,7 @@ namespace drawinglayer
             For the possibilities of color modifications, please refer
             to the basegfx::BColorModifier definitions in basegfx. For
             processing there is tooling in basegfx to build a stack of
-            BColorModifiers to always be able to proccess the correct
+            BColorModifierSharedPtrs to always be able to proccess the correct
             colors.
 
             If a renderer does not handle this primitive, the content will
@@ -52,16 +54,16 @@ namespace drawinglayer
         {
         private:
             /// The ColorModifier to use
-            basegfx::BColorModifier                 maColorModifier;
+            basegfx::BColorModifierSharedPtr    maColorModifier;
 
         public:
             /// constructor
             ModifiedColorPrimitive2D(
                 const Primitive2DSequence& rChildren,
-                const basegfx::BColorModifier& rColorModifier);
+                const basegfx::BColorModifierSharedPtr& rColorModifier);
 
             /// data read access
-            const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
+            const basegfx::BColorModifierSharedPtr& getColorModifier() const { return maColorModifier; }
 
             /// compare operator
             virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
diff --git a/include/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx b/include/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
index f791213..c07aa21 100644
--- a/include/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
+++ b/include/drawinglayer/primitive3d/modifiedcolorprimitive3d.hxx
@@ -42,16 +42,16 @@ namespace drawinglayer
         {
         private:
             /// The ColorModifier to use
-            basegfx::BColorModifier                 maColorModifier;
+            basegfx::BColorModifierSharedPtr    maColorModifier;
 
         public:
             /// constructor
             ModifiedColorPrimitive3D(
                 const Primitive3DSequence& rChildren,
-                const basegfx::BColorModifier& rColorModifier);
+                const basegfx::BColorModifierSharedPtr& rColorModifier);
 
             /// data read access
-            const basegfx::BColorModifier& getColorModifier() const { return maColorModifier; }
+            const basegfx::BColorModifierSharedPtr& getColorModifier() const { return maColorModifier; }
 
             /// compare operator
             virtual bool operator==(const BasePrimitive3D& rPrimitive) const;
diff --git a/svgio/source/svgreader/svgmasknode.cxx b/svgio/source/svgreader/svgmasknode.cxx
index 460b7f4..30927c5 100644
--- a/svgio/source/svgreader/svgmasknode.cxx
+++ b/svgio/source/svgreader/svgmasknode.cxx
@@ -261,10 +261,8 @@ namespace svgio
                             const drawinglayer::primitive2d::Primitive2DReference xInverseMask(
                                 new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
                                     aMaskTarget,
-                                    basegfx::BColorModifier(
-                                        basegfx::BColor(0.0, 0.0, 0.0),
-                                        0.5,
-                                        basegfx::BCOLORMODIFYMODE_LUMINANCE_TO_ALPHA)));
+                                    basegfx::BColorModifierSharedPtr(
+                                        new basegfx::BColorModifier_luminance_to_alpha())));
 
                             aMaskTarget = drawinglayer::primitive2d::Primitive2DSequence(&xInverseMask, 1);
                         }
diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx
index b2443d6..5cc4e2d 100644
--- a/svx/source/sdr/contact/viewobjectcontact.cxx
+++ b/svx/source/sdr/contact/viewobjectcontact.cxx
@@ -328,8 +328,15 @@ namespace sdr
                 if(isPrimitiveGhosted(rDisplayInfo))
                 {
                     const basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
-                    const basegfx::BColorModifier aBColorModifier(aRGBWhite, 0.5, basegfx::BCOLORMODIFYMODE_INTERPOLATE);
-                    const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ModifiedColorPrimitive2D(xRetval, aBColorModifier));
+                    const basegfx::BColorModifierSharedPtr aBColorModifier(
+                        new basegfx::BColorModifier_interpolate(
+                            aRGBWhite,
+                            0.5));
+                    const drawinglayer::primitive2d::Primitive2DReference xReference(
+                        new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
+                            xRetval,
+                            aBColorModifier));
+
                     xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
                 }
             }
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
index 35183bf..f929aec 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3d.cxx
@@ -54,8 +54,15 @@ namespace sdr
             if(isPrimitiveGhosted(rDisplayInfo))
             {
                 const ::basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
-                const ::basegfx::BColorModifier aBColorModifier(aRGBWhite, 0.5, ::basegfx::BCOLORMODIFYMODE_INTERPOLATE);
-                const drawinglayer::primitive3d::Primitive3DReference xReference(new drawinglayer::primitive3d::ModifiedColorPrimitive3D(xRetval, aBColorModifier));
+                const ::basegfx::BColorModifierSharedPtr aBColorModifier(
+                    new basegfx::BColorModifier_interpolate(
+                        aRGBWhite,
+                        0.5));
+                const drawinglayer::primitive3d::Primitive3DReference xReference(
+                    new drawinglayer::primitive3d::ModifiedColorPrimitive3D(
+                        xRetval,
+                        aBColorModifier));
+
                 xRetval = drawinglayer::primitive3d::Primitive3DSequence(&xReference, 1);
             }
 
diff --git a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
index e9515f0..196e2d7 100644
--- a/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofe3dscene.cxx
@@ -108,8 +108,14 @@ namespace sdr
                 if(isPrimitiveGhosted(rDisplayInfo))
                 {
                     const ::basegfx::BColor aRGBWhite(1.0, 1.0, 1.0);
-                    const ::basegfx::BColorModifier aBColorModifier(aRGBWhite, 0.5, ::basegfx::BCOLORMODIFYMODE_INTERPOLATE);
-                    const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::ModifiedColorPrimitive2D(xRetval, aBColorModifier));
+                    const ::basegfx::BColorModifierSharedPtr aBColorModifier(
+                        new basegfx::BColorModifier_interpolate(
+                            aRGBWhite,
+                            0.5));
+                    const drawinglayer::primitive2d::Primitive2DReference xReference(
+                        new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
+                            xRetval,
+                            aBColorModifier));
 
                     xRetval = drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1);
                 }
diff --git a/sw/source/ui/docvw/HeaderFooterWin.cxx b/sw/source/ui/docvw/HeaderFooterWin.cxx
index 19c5b5e..600c42c 100644
--- a/sw/source/ui/docvw/HeaderFooterWin.cxx
+++ b/sw/source/ui/docvw/HeaderFooterWin.cxx
@@ -358,8 +358,12 @@ void SwHeaderFooterWin::Paint( const Rectangle& )
     // TODO Ghost it all if needed
     drawinglayer::primitive2d::Primitive2DSequence aGhostedSeq( 1 );
     double nFadeRate = double( m_nFadeRate ) / 100.0;
+    const basegfx::BColorModifierSharedPtr aBColorModifier(
+        new basegfx::BColorModifier_interpolate(
+            Color( COL_WHITE ).getBColor(),
+            1.0 - nFadeRate));
     aGhostedSeq[0] = drawinglayer::primitive2d::Primitive2DReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
-                aSeq, BColorModifier( Color( COL_WHITE ).getBColor(), 1.0 - nFadeRate, BCOLORMODIFYMODE_INTERPOLATE ) ) );
+                aSeq, aBColorModifier ) );
 
     pProcessor->process( aGhostedSeq );
     delete pProcessor;
diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx
index 507f3f5..a30fb0b 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -188,8 +188,12 @@ void SwPageBreakWin::Paint( const Rectangle& )
 
     Primitive2DSequence aGhostedSeq( 1 );
     double nFadeRate = double( m_nFadeRate ) / 100.0;
+    const basegfx::BColorModifierSharedPtr aBColorModifier(
+        new basegfx::BColorModifier_interpolate(
+            Color( COL_WHITE ).getBColor(),
+            1.0 - nFadeRate));
     aGhostedSeq[0] = Primitive2DReference( new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
-                aSeq, BColorModifier( Color( COL_WHITE ).getBColor(), 1.0 - nFadeRate, BCOLORMODIFYMODE_INTERPOLATE ) ) );
+                aSeq, aBColorModifier ) );
 
     // Create the processor and process the primitives
     const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index ec0f052..6deb1db 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -1017,58 +1017,110 @@ BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorMod
 
     for(sal_uInt32 a(rBColorModifierStack.count()); a && !bDone; )
     {
-        const basegfx::BColorModifier& rModifier = rBColorModifierStack.getBColorModifier(--a);
+        const basegfx::BColorModifierSharedPtr& rModifier = rBColorModifierStack.getBColorModifier(--a);
+        const basegfx::BColorModifier_replace* pReplace = dynamic_cast< const basegfx::BColorModifier_replace* >(rModifier.get());
 
-        switch(rModifier.getMode())
+        if(pReplace)
         {
-            case basegfx::BCOLORMODIFYMODE_REPLACE :
+            // complete replace
+            if(IsTransparent())
             {
-                // complete replace
-                if(IsTransparent())
+                // clear bitmap with dest color
+                if(aChangedBitmap.GetBitCount() <= 8)
                 {
-                    // clear bitmap with dest color
-                    if(aChangedBitmap.GetBitCount() <= 8)
-                    {
-                        // do NOT use erase; for e.g. 8bit Bitmaps, the nearest color to the given
-                        // erase color is determined and used -> this may be different from what is
-                        // wanted here. Better create a new bitmap with the needed color explicitely
-                        BitmapReadAccess* pReadAccess = aChangedBitmap.AcquireReadAccess();
-                        OSL_ENSURE(pReadAccess, "Got no Bitmap ReadAccess ?!?");
+                    // do NOT use erase; for e.g. 8bit Bitmaps, the nearest color to the given
+                    // erase color is determined and used -> this may be different from what is
+                    // wanted here. Better create a new bitmap with the needed color explicitely
+                    BitmapReadAccess* pReadAccess = aChangedBitmap.AcquireReadAccess();
+                    OSL_ENSURE(pReadAccess, "Got no Bitmap ReadAccess ?!?");
 
-                        if(pReadAccess)
-                        {
-                            BitmapPalette aNewPalette(pReadAccess->GetPalette());
-                            aNewPalette[0] = BitmapColor(Color(rModifier.getBColor()));
-                            aChangedBitmap = Bitmap(
-                                aChangedBitmap.GetSizePixel(),
-                                aChangedBitmap.GetBitCount(),
-                                &aNewPalette);
-                            delete pReadAccess;
-                        }
-                    }
-                    else
+                    if(pReadAccess)
                     {
-                        aChangedBitmap.Erase(Color(rModifier.getBColor()));
+                        BitmapPalette aNewPalette(pReadAccess->GetPalette());
+                        aNewPalette[0] = BitmapColor(Color(pReplace->getBColor()));
+                        aChangedBitmap = Bitmap(
+                            aChangedBitmap.GetSizePixel(),
+                            aChangedBitmap.GetBitCount(),
+                            &aNewPalette);
+                        delete pReadAccess;
                     }
                 }
                 else
                 {
-                    // erase bitmap, caller will know to paint direct
-                    aChangedBitmap.SetEmpty();
+                    aChangedBitmap.Erase(Color(pReplace->getBColor()));
                 }
-
-                bDone = true;
-                break;
             }
+            else
+            {
+                // erase bitmap, caller will know to paint direct
+                aChangedBitmap.SetEmpty();
+            }
+
+            bDone = true;
+        }
+        else
+        {
+            BitmapWriteAccess* pContent = aChangedBitmap.AcquireWriteAccess();
 
-            default : // BCOLORMODIFYMODE_INTERPOLATE, BCOLORMODIFYMODE_GRAY, BCOLORMODIFYMODE_BLACKANDWHITE
+            if(pContent)
             {
-                BitmapWriteAccess* pContent = aChangedBitmap.AcquireWriteAccess();
+                const double fConvertColor(1.0 / 255.0);
+
+                if(pContent->HasPalette())
+                {
+                    const sal_uInt16 nCount(pContent->GetPaletteEntryCount());
+
+                    for(sal_uInt16 b(0); b < nCount; b++)
+                    {
+                        const BitmapColor& rCol = pContent->GetPaletteColor(b);
+                        const basegfx::BColor aBSource(
+                            rCol.GetRed() * fConvertColor,
+                            rCol.GetGreen() * fConvertColor,
+                            rCol.GetBlue() * fConvertColor);
+                        const basegfx::BColor aBDest(rModifier->getModifiedColor(aBSource));
+                        pContent->SetPaletteColor(b, BitmapColor(Color(aBDest)));
+                    }
+                }
+                else if(BMP_FORMAT_24BIT_TC_BGR == pContent->GetScanlineFormat())
+                {
+                    for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++)
+                    {
+                        Scanline pScan = pContent->GetScanline(y);
 
-                if(pContent)
+                        for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++)
+                        {
+                            const basegfx::BColor aBSource(
+                                *(pScan + 2)* fConvertColor,
+                                *(pScan + 1) * fConvertColor,
+                                *pScan * fConvertColor);
+                            const basegfx::BColor aBDest(rModifier->getModifiedColor(aBSource));
+                            *pScan++ = static_cast< sal_uInt8 >(aBDest.getBlue() * 255.0);
+                            *pScan++ = static_cast< sal_uInt8 >(aBDest.getGreen() * 255.0);
+                            *pScan++ = static_cast< sal_uInt8 >(aBDest.getRed() * 255.0);
+                        }
+                    }
+                }
+                else if(BMP_FORMAT_24BIT_TC_RGB == pContent->GetScanlineFormat())
                 {
-                    const double fConvertColor(1.0 / 255.0);
+                    for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++)
+                    {
+                        Scanline pScan = pContent->GetScanline(y);
 
+                        for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++)
+                        {
+                            const basegfx::BColor aBSource(
+                                *pScan * fConvertColor,
+                                *(pScan + 1) * fConvertColor,
+                                *(pScan + 2) * fConvertColor);
+                            const basegfx::BColor aBDest(rModifier->getModifiedColor(aBSource));
+                            *pScan++ = static_cast< sal_uInt8 >(aBDest.getRed() * 255.0);
+                            *pScan++ = static_cast< sal_uInt8 >(aBDest.getGreen() * 255.0);
+                            *pScan++ = static_cast< sal_uInt8 >(aBDest.getBlue() * 255.0);
+                        }
+                    }
+                }
+                else
+                {
                     for(sal_uInt32 y(0L); y < (sal_uInt32)pContent->Height(); y++)
                     {
                         for(sal_uInt32 x(0L); x < (sal_uInt32)pContent->Width(); x++)
@@ -1078,16 +1130,14 @@ BitmapEx BitmapEx::ModifyBitmapEx(const basegfx::BColorModifierStack& rBColorMod
                                 (double)aBMCol.GetRed() * fConvertColor,
                                 (double)aBMCol.GetGreen() * fConvertColor,
                                 (double)aBMCol.GetBlue() * fConvertColor);
-                            const basegfx::BColor aBDest(rModifier.getModifiedColor(aBSource));
+                            const basegfx::BColor aBDest(rModifier->getModifiedColor(aBSource));
 
                             pContent->SetPixel(y, x, BitmapColor(Color(aBDest)));
                         }
                     }
-
-                    delete pContent;
                 }
 
-                break;
+                delete pContent;
             }
         }
     }


More information about the Libreoffice-commits mailing list