summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cppcanvas/Library_cppcanvas.mk1
-rw-r--r--cppcanvas/source/inc/tools.hxx4
-rw-r--r--cppcanvas/source/mtfrenderer/implrenderer.cxx10
-rw-r--r--cppcanvas/source/tools/tools.cxx4
-rw-r--r--cppcanvas/source/wrapper/implcanvas.cxx6
-rw-r--r--cppcanvas/source/wrapper/implcanvas.hxx2
-rw-r--r--cppcanvas/source/wrapper/implcolor.cxx53
-rw-r--r--cppcanvas/source/wrapper/implcolor.hxx51
-rw-r--r--cppcanvas/source/wrapper/implpolypolygon.cxx6
-rw-r--r--cppcanvas/source/wrapper/implpolypolygon.hxx6
-rw-r--r--include/cppcanvas/canvas.hxx2
-rw-r--r--include/cppcanvas/color.hxx30
-rw-r--r--include/cppcanvas/polypolygon.hxx6
-rw-r--r--include/cppcanvas/renderer.hxx8
-rw-r--r--slideshow/source/engine/color.cxx4
-rw-r--r--slideshow/source/engine/tools.cxx4
-rw-r--r--slideshow/source/inc/rgbcolor.hxx4
-rw-r--r--slideshow/source/inc/tools.hxx4
18 files changed, 39 insertions, 166 deletions
diff --git a/cppcanvas/Library_cppcanvas.mk b/cppcanvas/Library_cppcanvas.mk
index 62611a4ee808..d60c75606fb3 100644
--- a/cppcanvas/Library_cppcanvas.mk
+++ b/cppcanvas/Library_cppcanvas.mk
@@ -71,7 +71,6 @@ $(eval $(call gb_Library_add_exception_objects,cppcanvas,\
cppcanvas/source/wrapper/implbitmap \
cppcanvas/source/wrapper/implbitmapcanvas \
cppcanvas/source/wrapper/implcanvas \
- cppcanvas/source/wrapper/implcolor \
cppcanvas/source/wrapper/implcustomsprite \
cppcanvas/source/wrapper/implfont \
cppcanvas/source/wrapper/implpolypolygon \
diff --git a/cppcanvas/source/inc/tools.hxx b/cppcanvas/source/inc/tools.hxx
index 80ded934203f..80a238881790 100644
--- a/cppcanvas/source/inc/tools.hxx
+++ b/cppcanvas/source/inc/tools.hxx
@@ -27,9 +27,9 @@ namespace cppcanvas
{
namespace tools
{
- css::uno::Sequence< double > intSRGBAToDoubleSequence( Color::IntSRGBA );
+ css::uno::Sequence< double > intSRGBAToDoubleSequence( IntSRGBA );
- Color::IntSRGBA doubleSequenceToIntSRGBA( const css::uno::Sequence< double >& rColor );
+ IntSRGBA doubleSequenceToIntSRGBA( const css::uno::Sequence< double >& rColor );
}
}
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index f5e59ed6359c..144246de2e2f 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -2902,14 +2902,12 @@ namespace cppcanvas
tools::calcLogic2PixelAffineTransform( aStateStack.getState().mapModeTransform,
*aVDev.get() );
- ColorSharedPtr pColor( getCanvas()->createColor() );
-
{
::cppcanvas::internal::OutDevState& rState = aStateStack.getState();
// setup default text color to black
rState.textColor =
rState.textFillColor =
- rState.textLineColor = pColor->getDeviceColor( 0x000000FF );
+ rState.textLineColor = tools::intSRGBAToDoubleSequence( 0x000000FF );
}
// apply overrides from the Parameters struct
@@ -2917,13 +2915,13 @@ namespace cppcanvas
{
::cppcanvas::internal::OutDevState& rState = aStateStack.getState();
rState.isFillColorSet = true;
- rState.fillColor = pColor->getDeviceColor( *rParams.maFillColor );
+ rState.fillColor = tools::intSRGBAToDoubleSequence( *rParams.maFillColor );
}
if( rParams.maLineColor.is_initialized() )
{
::cppcanvas::internal::OutDevState& rState = aStateStack.getState();
rState.isLineColorSet = true;
- rState.lineColor = pColor->getDeviceColor( *rParams.maLineColor );
+ rState.lineColor = tools::intSRGBAToDoubleSequence( *rParams.maLineColor );
}
if( rParams.maTextColor.is_initialized() )
{
@@ -2932,7 +2930,7 @@ namespace cppcanvas
rState.isTextLineColorSet = true;
rState.textColor =
rState.textFillColor =
- rState.textLineColor = pColor->getDeviceColor( *rParams.maTextColor );
+ rState.textLineColor = tools::intSRGBAToDoubleSequence( *rParams.maTextColor );
}
if( rParams.maFontName.is_initialized() ||
rParams.maFontWeight.is_initialized() ||
diff --git a/cppcanvas/source/tools/tools.cxx b/cppcanvas/source/tools/tools.cxx
index 6bf9c55433c4..de0e0d1c5169 100644
--- a/cppcanvas/source/tools/tools.cxx
+++ b/cppcanvas/source/tools/tools.cxx
@@ -27,7 +27,7 @@ namespace cppcanvas
{
namespace tools
{
- uno::Sequence< double > intSRGBAToDoubleSequence( Color::IntSRGBA aColor )
+ uno::Sequence< double > intSRGBAToDoubleSequence( IntSRGBA aColor )
{
uno::Sequence< double > aRes( 4 );
@@ -39,7 +39,7 @@ namespace cppcanvas
return aRes;
}
- Color::IntSRGBA doubleSequenceToIntSRGBA( const uno::Sequence< double >& rColor )
+ IntSRGBA doubleSequenceToIntSRGBA( const uno::Sequence< double >& rColor )
{
return makeColor( static_cast<sal_uInt8>( 255*rColor[0] + .5 ),
static_cast<sal_uInt8>( 255*rColor[1] + .5 ),
diff --git a/cppcanvas/source/wrapper/implcanvas.cxx b/cppcanvas/source/wrapper/implcanvas.cxx
index 23d055e2b9f6..68a4cb28750c 100644
--- a/cppcanvas/source/wrapper/implcanvas.cxx
+++ b/cppcanvas/source/wrapper/implcanvas.cxx
@@ -29,7 +29,6 @@
#include <cppcanvas/polypolygon.hxx>
#include "implfont.hxx"
-#include "implcolor.hxx"
#include "implcanvas.hxx"
@@ -84,11 +83,6 @@ namespace cppcanvas
return !maClipPolyPolygon ? nullptr : &(*maClipPolyPolygon);
}
- ColorSharedPtr ImplCanvas::createColor() const
- {
- return ColorSharedPtr( new ImplColor( getUNOCanvas()->getDevice() ) );
- }
-
CanvasSharedPtr ImplCanvas::clone() const
{
return CanvasSharedPtr( new ImplCanvas( *this ) );
diff --git a/cppcanvas/source/wrapper/implcanvas.hxx b/cppcanvas/source/wrapper/implcanvas.hxx
index d1162d605ea4..b71f2311f67b 100644
--- a/cppcanvas/source/wrapper/implcanvas.hxx
+++ b/cppcanvas/source/wrapper/implcanvas.hxx
@@ -60,8 +60,6 @@ namespace cppcanvas
virtual void setClip() override;
virtual ::basegfx::B2DPolyPolygon const* getClip() const override;
- virtual ColorSharedPtr createColor() const override;
-
virtual CanvasSharedPtr clone() const override;
virtual void clear() const override;
diff --git a/cppcanvas/source/wrapper/implcolor.cxx b/cppcanvas/source/wrapper/implcolor.cxx
deleted file mode 100644
index a22fffe39c47..000000000000
--- a/cppcanvas/source/wrapper/implcolor.cxx
+++ /dev/null
@@ -1,53 +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 <implcolor.hxx>
-#include <tools.hxx>
-#include <osl/diagnose.h>
-
-using namespace ::com::sun::star;
-
-namespace cppcanvas
-{
- namespace internal
- {
-
- ImplColor::ImplColor( const uno::Reference< rendering::XGraphicDevice >& rDevice ) :
- mxDevice( rDevice )
- {
- OSL_ENSURE( mxDevice.is(), "ImplColor::ImplColor(): Invalid graphic device" );
- }
-
- ImplColor::~ImplColor()
- {
- }
-
- uno::Sequence< double > ImplColor::getDeviceColor( Color::IntSRGBA aSRGBA ) const
- {
- OSL_ENSURE( mxDevice.is(), "ImplColor::getDeviceColor(): Invalid graphic device" );
-
- // TODO(F1): Color space handling
- return tools::intSRGBAToDoubleSequence( aSRGBA );
- }
-
- }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppcanvas/source/wrapper/implcolor.hxx b/cppcanvas/source/wrapper/implcolor.hxx
deleted file mode 100644
index a53834c3228c..000000000000
--- a/cppcanvas/source/wrapper/implcolor.hxx
+++ /dev/null
@@ -1,51 +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 .
- */
-
-#ifndef INCLUDED_CPPCANVAS_SOURCE_WRAPPER_IMPLCOLOR_HXX
-#define INCLUDED_CPPCANVAS_SOURCE_WRAPPER_IMPLCOLOR_HXX
-
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/rendering/XGraphicDevice.hpp>
-#include <cppcanvas/color.hxx>
-
-/* Definition of Color class */
-
-namespace cppcanvas
-{
- namespace internal
- {
- class ImplColor : public Color
- {
- public:
- explicit ImplColor( const css::uno::Reference<
- css::rendering::XGraphicDevice >& rDevice );
- virtual ~ImplColor() override;
-
- virtual css::uno::Sequence< double > getDeviceColor( IntSRGBA aSRGBA ) const override;
-
- private:
- css::uno::Reference< css::rendering::XGraphicDevice > mxDevice;
- };
-
- }
-}
-
-#endif // INCLUDED_CPPCANVAS_SOURCE_WRAPPER_IMPLCOLOR_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppcanvas/source/wrapper/implpolypolygon.cxx b/cppcanvas/source/wrapper/implpolypolygon.cxx
index 16e29abc541a..d59d5eb3448e 100644
--- a/cppcanvas/source/wrapper/implpolypolygon.cxx
+++ b/cppcanvas/source/wrapper/implpolypolygon.cxx
@@ -62,19 +62,19 @@ namespace cppcanvas
{
}
- void ImplPolyPolygon::setRGBAFillColor( Color::IntSRGBA aColor )
+ void ImplPolyPolygon::setRGBAFillColor( IntSRGBA aColor )
{
maFillColor = tools::intSRGBAToDoubleSequence( aColor );
mbFillColorSet = true;
}
- void ImplPolyPolygon::setRGBALineColor( Color::IntSRGBA aColor )
+ void ImplPolyPolygon::setRGBALineColor( IntSRGBA aColor )
{
maStrokeColor = tools::intSRGBAToDoubleSequence( aColor );
mbStrokeColorSet = true;
}
- Color::IntSRGBA ImplPolyPolygon::getRGBALineColor() const
+ IntSRGBA ImplPolyPolygon::getRGBALineColor() const
{
return tools::doubleSequenceToIntSRGBA( maStrokeColor );
}
diff --git a/cppcanvas/source/wrapper/implpolypolygon.hxx b/cppcanvas/source/wrapper/implpolypolygon.hxx
index 431561a6b3d8..d6747cdd5374 100644
--- a/cppcanvas/source/wrapper/implpolypolygon.hxx
+++ b/cppcanvas/source/wrapper/implpolypolygon.hxx
@@ -48,9 +48,9 @@ namespace cppcanvas
virtual ~ImplPolyPolygon() override;
- virtual void setRGBAFillColor( Color::IntSRGBA ) override;
- virtual void setRGBALineColor( Color::IntSRGBA ) override;
- virtual Color::IntSRGBA getRGBALineColor() const override;
+ virtual void setRGBAFillColor( IntSRGBA ) override;
+ virtual void setRGBALineColor( IntSRGBA ) override;
+ virtual IntSRGBA getRGBALineColor() const override;
virtual void setStrokeWidth( const double& rStrokeWidth ) override;
virtual double getStrokeWidth() const override;
diff --git a/include/cppcanvas/canvas.hxx b/include/cppcanvas/canvas.hxx
index b7d39ca473fe..425d38e44213 100644
--- a/include/cppcanvas/canvas.hxx
+++ b/include/cppcanvas/canvas.hxx
@@ -83,8 +83,6 @@ namespace cppcanvas
*/
virtual ::basegfx::B2DPolyPolygon const* getClip() const = 0;
- virtual ColorSharedPtr createColor() const = 0;
-
virtual CanvasSharedPtr clone() const = 0;
virtual void clear() const = 0;
diff --git a/include/cppcanvas/color.hxx b/include/cppcanvas/color.hxx
index 0a5477cfa995..2f735e52b638 100644
--- a/include/cppcanvas/color.hxx
+++ b/include/cppcanvas/color.hxx
@@ -27,44 +27,34 @@
namespace cppcanvas
{
- class Color
- {
- public:
- /** Color in the sRGB color space, plus alpha channel
-
- The four bytes of the sal_uInt32 are allocated as follows
- to the color channels and alpha: 0xRRGGBBAA.
- */
- typedef sal_uInt32 IntSRGBA;
-
- virtual ~Color() {}
-
- virtual css::uno::Sequence< double > getDeviceColor( IntSRGBA aSRGBA ) const = 0;
- };
+ /** Color in the sRGB color space, plus alpha channel
- typedef std::shared_ptr< ::cppcanvas::Color > ColorSharedPtr;
+ The four bytes of the sal_uInt32 are allocated as follows
+ to the color channels and alpha: 0xRRGGBBAA.
+ */
+ typedef sal_uInt32 IntSRGBA;
- inline sal_uInt8 getRed( Color::IntSRGBA nCol )
+ inline sal_uInt8 getRed( IntSRGBA nCol )
{
return static_cast<sal_uInt8>( (nCol&0xFF000000U) >> 24U );
}
- inline sal_uInt8 getGreen( Color::IntSRGBA nCol )
+ inline sal_uInt8 getGreen( IntSRGBA nCol )
{
return static_cast<sal_uInt8>( (nCol&0x00FF0000U) >> 16U );
}
- inline sal_uInt8 getBlue( Color::IntSRGBA nCol )
+ inline sal_uInt8 getBlue( IntSRGBA nCol )
{
return static_cast<sal_uInt8>( (nCol&0x0000FF00U) >> 8U );
}
- inline sal_uInt8 getAlpha( Color::IntSRGBA nCol )
+ inline sal_uInt8 getAlpha( IntSRGBA nCol )
{
return static_cast<sal_uInt8>( nCol&0x000000FFU );
}
- inline Color::IntSRGBA makeColor( sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue, sal_uInt8 nAlpha )
+ inline IntSRGBA makeColor( sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue, sal_uInt8 nAlpha )
{
return (nRed << 24U)|(nGreen << 16U)|(nBlue << 8U)|nAlpha;
}
diff --git a/include/cppcanvas/polypolygon.hxx b/include/cppcanvas/polypolygon.hxx
index 04fae838d18c..869301652329 100644
--- a/include/cppcanvas/polypolygon.hxx
+++ b/include/cppcanvas/polypolygon.hxx
@@ -58,13 +58,13 @@ namespace cppcanvas
/** Set polygon fill color
*/
- virtual void setRGBAFillColor( Color::IntSRGBA ) = 0;
+ virtual void setRGBAFillColor( IntSRGBA ) = 0;
/** Set polygon line color
*/
- virtual void setRGBALineColor( Color::IntSRGBA ) = 0;
+ virtual void setRGBALineColor( IntSRGBA ) = 0;
/** Get polygon line color
*/
- virtual Color::IntSRGBA getRGBALineColor() const = 0;
+ virtual IntSRGBA getRGBALineColor() const = 0;
virtual void setStrokeWidth( const double& rStrokeWidth ) = 0;
virtual double getStrokeWidth() const = 0;
diff --git a/include/cppcanvas/renderer.hxx b/include/cppcanvas/renderer.hxx
index 51b5085ca455..113bda783f20 100644
--- a/include/cppcanvas/renderer.hxx
+++ b/include/cppcanvas/renderer.hxx
@@ -100,16 +100,16 @@ namespace cppcanvas
struct Parameters
{
/// Optionally forces the fill color attribute for all actions
- ::boost::optional< Color::IntSRGBA > maFillColor;
+ ::boost::optional< IntSRGBA > maFillColor;
/// Optionally forces the line color attribute for all actions
- ::boost::optional< Color::IntSRGBA > maLineColor;
+ ::boost::optional< IntSRGBA > maLineColor;
/// Optionally forces the text color attribute for all actions
- ::boost::optional< Color::IntSRGBA > maTextColor;
+ ::boost::optional< IntSRGBA > maTextColor;
/// Optionally forces the given fontname for all text actions
- ::boost::optional< OUString > maFontName;
+ ::boost::optional< OUString > maFontName;
/** Optionally transforms all text output actions with the
given matrix (in addition to the overall canvas
diff --git a/slideshow/source/engine/color.cxx b/slideshow/source/engine/color.cxx
index 374508393753..a7a957e7f423 100644
--- a/slideshow/source/engine/color.cxx
+++ b/slideshow/source/engine/color.cxx
@@ -277,7 +277,7 @@ namespace slideshow
{
}
- RGBColor::RGBColor( ::cppcanvas::Color::IntSRGBA nRGBColor ) :
+ RGBColor::RGBColor( ::cppcanvas::IntSRGBA nRGBColor ) :
maRGBTriple( ::cppcanvas::getRed( nRGBColor ) / 255.0,
::cppcanvas::getGreen( nRGBColor ) / 255.0,
::cppcanvas::getBlue( nRGBColor ) / 255.0 )
@@ -297,7 +297,7 @@ namespace slideshow
}
- ::cppcanvas::Color::IntSRGBA RGBColor::getIntegerColor() const
+ ::cppcanvas::IntSRGBA RGBColor::getIntegerColor() const
{
return ::cppcanvas::makeColor( colorToInt( getRed() ),
colorToInt( getGreen() ),
diff --git a/slideshow/source/engine/tools.cxx b/slideshow/source/engine/tools.cxx
index eaac078f459e..db3fbcdfa452 100644
--- a/slideshow/source/engine/tools.cxx
+++ b/slideshow/source/engine/tools.cxx
@@ -649,7 +649,7 @@ namespace slideshow
static_cast< sal_uInt8 >( nColor >> 24U ) ) );
}
- sal_Int32 RGBAColor2UnoColor( ::cppcanvas::Color::IntSRGBA aColor )
+ sal_Int32 RGBAColor2UnoColor( ::cppcanvas::IntSRGBA aColor )
{
return ::cppcanvas::makeColorARGB(
// convert from IntSRGBA color to API color
@@ -662,7 +662,7 @@ namespace slideshow
void fillRect( const ::cppcanvas::CanvasSharedPtr& rCanvas,
const ::basegfx::B2DRectangle& rRect,
- ::cppcanvas::Color::IntSRGBA aFillColor )
+ ::cppcanvas::IntSRGBA aFillColor )
{
const ::basegfx::B2DPolygon aPoly(
::basegfx::utils::createPolygonFromRect( rRect ));
diff --git a/slideshow/source/inc/rgbcolor.hxx b/slideshow/source/inc/rgbcolor.hxx
index 6028c1e889e9..9e12ec902a02 100644
--- a/slideshow/source/inc/rgbcolor.hxx
+++ b/slideshow/source/inc/rgbcolor.hxx
@@ -37,7 +37,7 @@ namespace slideshow
{
public:
RGBColor();
- explicit RGBColor( ::cppcanvas::Color::IntSRGBA nRGBColor );
+ explicit RGBColor( ::cppcanvas::IntSRGBA nRGBColor );
RGBColor( double nRed, double nGreen, double nBlue );
explicit RGBColor( const HSLColor& rColor );
@@ -55,7 +55,7 @@ namespace slideshow
/** Create an integer sRGBA color.
*/
- ::cppcanvas::Color::IntSRGBA getIntegerColor() const;
+ ::cppcanvas::IntSRGBA getIntegerColor() const;
struct RGBTriple
{
diff --git a/slideshow/source/inc/tools.hxx b/slideshow/source/inc/tools.hxx
index 646c646e7d62..1f4128d65199 100644
--- a/slideshow/source/inc/tools.hxx
+++ b/slideshow/source/inc/tools.hxx
@@ -261,13 +261,13 @@ namespace slideshow
RGBColor unoColor2RGBColor( sal_Int32 );
/** Convert an IntSRGBA to plain UNO API 32 bit int
*/
- sal_Int32 RGBAColor2UnoColor( cppcanvas::Color::IntSRGBA );
+ sal_Int32 RGBAColor2UnoColor( cppcanvas::IntSRGBA );
/** Fill a plain rectangle on the given canvas with the given color
*/
void fillRect( const std::shared_ptr< cppcanvas::Canvas >& rCanvas,
const basegfx::B2DRange& rRect,
- cppcanvas::Color::IntSRGBA aFillColor );
+ cppcanvas::IntSRGBA aFillColor );
/** Init canvas with default background (white)
*/