summaryrefslogtreecommitdiff
path: root/canvas/source
diff options
context:
space:
mode:
authorthb <thb@openoffice.org>2010-01-18 21:01:43 +0100
committerthb <thb@openoffice.org>2010-01-18 21:01:43 +0100
commit9fb80cbeeebce009d0b437f36c8d0ba124463a27 (patch)
treebb2e667153694a81a50971fd0f44861c71a7d391 /canvas/source
parent80e02df062b8e91202d3cd4c420edbe33efcfc7a (diff)
#i107137# fix wrong colorspace calculations
* applied patch from i107137
Diffstat (limited to 'canvas/source')
-rw-r--r--canvas/source/cairo/cairo_canvashelper.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 831655f1256f..64f246afc1a4 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -1794,12 +1794,12 @@ namespace cairocanvas
rendering::RGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
- const sal_Int8 nAlpha(pIn[3]);
- if( nAlpha )
+ const double fAlpha((sal_uInt8)pIn[3]);
+ if( fAlpha )
*pOut++ = rendering::RGBColor(
- vcl::unotools::toDoubleColor(pIn[2]/nAlpha),
- vcl::unotools::toDoubleColor(pIn[1]/nAlpha),
- vcl::unotools::toDoubleColor(pIn[0]/nAlpha));
+ pIn[2]/fAlpha,
+ pIn[1]/fAlpha,
+ pIn[0]/fAlpha);
else
*pOut++ = rendering::RGBColor(0,0,0);
pIn += 4;
@@ -1819,13 +1819,13 @@ namespace cairocanvas
rendering::ARGBColor* pOut( aRes.getArray() );
for( sal_Size i=0; i<nLen; i+=4 )
{
- const sal_Int8 nAlpha(pIn[3]);
- if( nAlpha )
+ const double fAlpha((sal_uInt8)pIn[3]);
+ if( fAlpha )
*pOut++ = rendering::ARGBColor(
- vcl::unotools::toDoubleColor(nAlpha),
- vcl::unotools::toDoubleColor(pIn[2]/nAlpha),
- vcl::unotools::toDoubleColor(pIn[1]/nAlpha),
- vcl::unotools::toDoubleColor(pIn[0]/nAlpha));
+ fAlpha/255.0,
+ pIn[2]/fAlpha,
+ pIn[1]/fAlpha,
+ pIn[0]/fAlpha);
else
*pOut++ = rendering::ARGBColor(0,0,0,0);
pIn += 4;