diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2014-04-30 22:19:08 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-01 09:24:21 +0000 |
commit | 75a839188d1cac5f0ac602e59462b32879d2242a (patch) | |
tree | fe2209e9768f7fa2dde575fafad113441ccb7f9c /svtools | |
parent | f295a442e18db2f3bb647bf502dd60d87823c19f (diff) |
handle brightness+contrast from msoffice (bnc#875713)
This is the same like 1139d618b8bc6ab823a96184bd0f0257980aad24, for docx.
(cherry picked from commit 893fe88469dec5b727d96f8ea1b4edb9e88288a7)
Conflicts:
oox/source/drawingml/fillproperties.cxx
Change-Id: I1ef4e18444e8c60e9ae8f67249bcef1053f0d62d
Reviewed-on: https://gerrit.libreoffice.org/9217
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/graphic/transformer.cxx | 17 | ||||
-rw-r--r-- | svtools/source/graphic/transformer.hxx | 5 |
2 files changed, 22 insertions, 0 deletions
diff --git a/svtools/source/graphic/transformer.cxx b/svtools/source/graphic/transformer.cxx index 30f07c7af197..bf6362132577 100644 --- a/svtools/source/graphic/transformer.cxx +++ b/svtools/source/graphic/transformer.cxx @@ -159,6 +159,23 @@ uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::applyDuotone( return xRet; } +uno::Reference< graphic::XGraphic > SAL_CALL GraphicTransformer::applyBrightnessContrast( + const uno::Reference< graphic::XGraphic >& rxGraphic, sal_Int32 nBrightness, sal_Int32 nContrast, sal_Bool mso ) + throw ( lang::IllegalArgumentException, uno::RuntimeException, std::exception) +{ + const uno::Reference< uno::XInterface > xIFace( rxGraphic, uno::UNO_QUERY ); + ::Graphic aGraphic( *::unographic::Graphic::getImplementation( xIFace ) ); + + BitmapEx aBitmapEx( aGraphic.GetBitmapEx() ); + aBitmapEx.Adjust( nBrightness, nContrast, 0, 0, 0, 0, false, mso ); + aGraphic = ::Graphic( aBitmapEx ); + + ::unographic::Graphic* pUnoGraphic = new ::unographic::Graphic(); + pUnoGraphic->init( aGraphic ); + uno::Reference< graphic::XGraphic > xRet( pUnoGraphic ); + return xRet; +} + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/graphic/transformer.hxx b/svtools/source/graphic/transformer.hxx index e57b8fa0bde3..1707183a3a05 100644 --- a/svtools/source/graphic/transformer.hxx +++ b/svtools/source/graphic/transformer.hxx @@ -51,6 +51,11 @@ class GraphicTransformer : public GraphicTransformer_UnoImplHelper1 sal_Int32 nColorOne, sal_Int32 nColorTwo ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > SAL_CALL applyBrightnessContrast( + const ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic >& rxGraphic, + sal_Int32 nBrightness, sal_Int32 nContrast, sal_Bool mso ) + throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; + }; } |