summaryrefslogtreecommitdiff
path: root/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2005-04-18 09:01:14 +0000
committerOliver Bolte <obo@openoffice.org>2005-04-18 09:01:14 +0000
commitb6e7f1c224bc0552df22495a48eeac3e56e8a705 (patch)
tree6f4eab7d466f0a2a3e2e010a7e1c4813f65673ec /cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
parent190178d899acc29466b0ad059af974d106d2a7d7 (diff)
INTEGRATION: CWS presfixes03 (1.4.2); FILE MERGED
2005/04/01 16:09:45 thb 1.4.2.1: #i36190#, #i39245# Changed uno::Sequence::operator[] for nonconst sequences to use naked ptr; added support for true bezier polygons (and removed subdivision, where it was added because of that canvas deficiency); overhauled mtf renderer to provide faithful bounds also for subsetted meta files
Diffstat (limited to 'cppcanvas/source/mtfrenderer/transparencygroupaction.cxx')
-rw-r--r--cppcanvas/source/mtfrenderer/transparencygroupaction.cxx51
1 files changed, 44 insertions, 7 deletions
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
index 06a06f741353..48b3c3d78421 100644
--- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
+++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: transparencygroupaction.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: rt $ $Date: 2005-03-30 08:32:26 $
+ * last change: $Author: obo $ $Date: 2005-04-18 10:01:14 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,8 @@
#include <canvas/debug.hxx>
#include <canvas/verbosetrace.hxx>
+#include <canvas/canvastools.hxx>
+
#include <transparencygroupaction.hxx>
#include <outdevstate.hxx>
@@ -112,6 +114,9 @@
#include <canvas/canvastools.hxx>
#endif
+#ifndef _BGFX_RANGE_B2DRANGE_HXX
+#include <basegfx/range/b2drange.hxx>
+#endif
#ifndef _BGFX_NUMERIC_FTOOLS_HXX
#include <basegfx/numeric/ftools.hxx>
#endif
@@ -205,6 +210,10 @@ namespace cppcanvas
virtual bool render( const ::basegfx::B2DHomMatrix& rTransformation,
const Subset& rSubset ) const;
+ virtual ::basegfx::B2DRange getBounds( const ::basegfx::B2DHomMatrix& rTransformation ) const;
+ virtual ::basegfx::B2DRange getBounds( const ::basegfx::B2DHomMatrix& rTransformation,
+ const Subset& rSubset ) const;
+
virtual sal_Int32 getActionCount() const;
private:
@@ -511,11 +520,9 @@ namespace cppcanvas
else
{
// add alpha modulation value to DeviceColor
- aLocalState.DeviceColor.realloc(4);
- aLocalState.DeviceColor[0] = 1.0;
- aLocalState.DeviceColor[1] = 1.0;
- aLocalState.DeviceColor[2] = 1.0;
- aLocalState.DeviceColor[3] = mnAlpha;
+ ::canvas::tools::setDeviceColor( aLocalState,
+ 1.0, 1.0, 1.0, mnAlpha );
+
mpCanvas->getUNOCanvas()->drawBitmapModulated( mxBufferBitmap,
mpCanvas->getViewState(),
aLocalState );
@@ -541,6 +548,36 @@ namespace cppcanvas
return render( rTransformation, aSubset );
}
+ ::basegfx::B2DRange TransparencyGroupAction::getBounds( const ::basegfx::B2DHomMatrix& rTransformation ) const
+ {
+ rendering::RenderState aLocalState( maState );
+ ::canvas::tools::prependToRenderState(aLocalState, rTransformation);
+
+ return tools::calcDevicePixelBounds(
+ ::basegfx::B2DRange( 0,0,
+ maDstSize.Width(),
+ maDstSize.Height() ),
+ mpCanvas->getViewState(),
+ aLocalState );
+ }
+
+ ::basegfx::B2DRange TransparencyGroupAction::getBounds( const ::basegfx::B2DHomMatrix& rTransformation,
+ const Subset& rSubset ) const
+ {
+ // TODO(F3): Currently, the bounds for
+ // TransparencyGroupAction subsets equal those of the
+ // full set, although this action is able to render
+ // true subsets.
+
+ // polygon only contains a single action, empty bounds
+ // if subset requests different range
+ if( rSubset.mnSubsetBegin != 0 ||
+ rSubset.mnSubsetEnd != 1 )
+ return ::basegfx::B2DRange();
+
+ return getBounds( rTransformation );
+ }
+
sal_Int32 TransparencyGroupAction::getActionCount() const
{
return mpGroupMtf.get() ? mpGroupMtf->GetActionCount() : 0;