summaryrefslogtreecommitdiff
path: root/cppcanvas/source/wrapper/implbitmap.cxx
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-11-26 19:58:48 +0000
committerRüdiger Timm <rt@openoffice.org>2004-11-26 19:58:48 +0000
commita869566a7a361ce0c6c8a3bb2bc2afb75811f566 (patch)
tree3e4e89703f0df960082643e385589bdb6276bdae /cppcanvas/source/wrapper/implbitmap.cxx
parent7c80a3d5e25b75bdcb0e7a8f7191173c45deccb0 (diff)
INTEGRATION: CWS presentationengine01 (1.2.2); FILE MERGED
2004/10/13 12:14:04 thb 1.2.2.5: #i34997#: Fixed problem with transparency bitmap rendering 2004/10/12 14:14:41 thb 1.2.2.4: #i34997# Added support for FLOATTRANSPARENCY meta action 2004/07/20 19:09:03 thb 1.2.2.3: #110496# Unified include statements; removed external prefix from boost includes 2004/05/27 20:51:29 thb 1.2.2.2: #110496# Added classification code to all TODO/HACK/FIXME comments. There are four categories: - code quality (C) - performance (P) - missing functionality (F) - and missing/incomplete error handling (E) Furthermore, every category has a severity number between 1 and 3 associated, where 1 is lowest and 3 highest severity 2004/04/05 15:58:51 thb 1.2.2.1: Resync with canvas01 changes
Diffstat (limited to 'cppcanvas/source/wrapper/implbitmap.cxx')
-rw-r--r--cppcanvas/source/wrapper/implbitmap.cxx43
1 files changed, 37 insertions, 6 deletions
diff --git a/cppcanvas/source/wrapper/implbitmap.cxx b/cppcanvas/source/wrapper/implbitmap.cxx
index 9ed4ab22f947..22de22d5c5e7 100644
--- a/cppcanvas/source/wrapper/implbitmap.cxx
+++ b/cppcanvas/source/wrapper/implbitmap.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: implbitmap.cxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: thb $ $Date: 2004-03-18 10:41:09 $
+ * last change: $Author: rt $ $Date: 2004-11-26 20:58:48 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -59,8 +59,8 @@
*
************************************************************************/
-#include "implbitmap.hxx"
-#include "implbitmapcanvas.hxx"
+#include <implbitmap.hxx>
+#include <implbitmapcanvas.hxx>
#ifndef _BGFX_MATRIX_B2DHOMMATRIX_HXX
#include <basegfx/matrix/b2dhommatrix.hxx>
@@ -100,10 +100,12 @@ namespace cppcanvas
"ImplBitmap::draw: invalid canvas" );
if( pCanvas.get() == NULL ||
- pCanvas->getUNOCanvas().is() )
+ !pCanvas->getUNOCanvas().is() )
+ {
return false;
+ }
- // TODO: implement caching
+ // TODO(P1): implement caching
pCanvas->getUNOCanvas()->drawBitmap( mxBitmap,
pCanvas->getViewState(),
maRenderState );
@@ -111,6 +113,35 @@ namespace cppcanvas
return true;
}
+ bool ImplBitmap::drawAlphaModulated( double nAlphaModulation ) const
+ {
+ CanvasSharedPtr pCanvas( getCanvas() );
+
+ OSL_ENSURE( pCanvas.get() != NULL &&
+ pCanvas->getUNOCanvas().is(),
+ "ImplBitmap::drawAlphaModulated(): invalid canvas" );
+
+ if( pCanvas.get() == NULL ||
+ !pCanvas->getUNOCanvas().is() )
+ {
+ return false;
+ }
+
+ rendering::RenderState aLocalState( maRenderState );
+ aLocalState.DeviceColor.realloc( 4 );
+ aLocalState.DeviceColor[0] = 1.0;
+ aLocalState.DeviceColor[1] = 1.0;
+ aLocalState.DeviceColor[2] = 1.0;
+ aLocalState.DeviceColor[3] = nAlphaModulation;
+
+ // TODO(P1): implement caching
+ pCanvas->getUNOCanvas()->drawBitmapModulated( mxBitmap,
+ pCanvas->getViewState(),
+ aLocalState );
+
+ return true;
+ }
+
BitmapCanvasSharedPtr ImplBitmap::getBitmapCanvas() const
{
return mpBitmapCanvas;