summaryrefslogtreecommitdiff
path: root/drawinglayer/inc
diff options
context:
space:
mode:
authorArmin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de>2023-03-13 19:39:34 +0100
committerArmin Le Grand <Armin.Le.Grand@me.com>2023-03-19 17:38:38 +0000
commit01d0019c851b9e942f9a3b94d6dd554fb1adb40c (patch)
tree201cb6d13f57f8fa06128785c1ddb330eeacc349 /drawinglayer/inc
parentfd299d209d82495eb6528fb444e0b68f41c8ae0d (diff)
MCGR: Model data changes for ColorSteps
Added tooling replaceStart/EndColor to allow simple transition for code that does not immediately adapt to multi color gradients. Also added createColorStepsFromStartEndColor for the same purpose. Adapted XGradient to no longer have Start/EndColor at all, but only use ColorSteps. Adapted all usages of XGradient to no longer use Get/Set/Start/EndColor, but access the ColorSteps instead. Replaced quite some XGradient constructors that used XGradient() as Start/EndColor since this is already the default. Adapted ColorBlending to black AKA Start/EndIntens in XGradient to work now on all ColorSteps in the required linearly-scaled manner. UNO API changes: Added com::sun::star::awt::ColorStep as basic data element that holds a pair of Offset and Color. Added com::sun::star::awt::ColorStepSequence to handle an array of sorted entries. Added com::sun::star::awt::Gradient2 derived from com::sun::star::awt::Gradient, extended by the needed com::sun::star::awt::ColorStepSequence. Added MID_GRADIENT_COLORSTEPSEQUENCE to UNO API to provide access to ColorSteps directly. Adapted XFillGradientItem::QueryValue/PutValue to make use of new UNO API data structures. To do so, added tooling methods for data transition: - fillColorStepSequenceFromColorSteps - fillGradient2FromXGradient - fillColorStepsFromAny - fillXGradientFromAny and adapted - case '0' (all data) - MID_FILLGRADIENT - MID_GRADIENT_COLORSTEPSEQUENCE - MID_GRADIENT_START/ENDCOLOR to make use of these. Tested usage of these in the office. Renamed from GradientStep to GradientStop after discussions with members on the list to make this closer related to other norms/definitions. Also renamed classes and class members to better reflect to GradientStop, so grepping/finding will be easier (e.g. 'Color' just exists pretty often, but 'StopColor' is more precise). Changed the used UNO API class for reprsenting the Color to better reflect to ranges [0.0 .. 1.0] and usage of RGB. Change-Id: I1eeb3e97e81d6785967615d1ff256551fc3b882d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148849 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'drawinglayer/inc')
-rw-r--r--drawinglayer/inc/texture/texture.hxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/drawinglayer/inc/texture/texture.hxx b/drawinglayer/inc/texture/texture.hxx
index 567a24417f51..8eff5bee261a 100644
--- a/drawinglayer/inc/texture/texture.hxx
+++ b/drawinglayer/inc/texture/texture.hxx
@@ -57,14 +57,14 @@ namespace drawinglayer::texture
basegfx::ODFGradientInfo maGradientInfo;
basegfx::B2DRange maDefinitionRange;
sal_uInt32 mnRequestedSteps;
- basegfx::ColorSteps mnColorSteps;
+ basegfx::ColorStops mnColorStops;
double mfBorder;
public:
GeoTexSvxGradient(
const basegfx::B2DRange& rDefinitionRange,
sal_uInt32 nRequestedSteps,
- const basegfx::ColorSteps& rColorSteps,
+ const basegfx::ColorStops& rColorStops,
double fBorder);
virtual ~GeoTexSvxGradient() override;
@@ -88,7 +88,7 @@ namespace drawinglayer::texture
const basegfx::B2DRange& rDefinitionRange,
const basegfx::B2DRange& rOutputRange,
sal_uInt32 nRequestedSteps,
- const basegfx::ColorSteps& rColorSteps,
+ const basegfx::ColorStops& rColorStops,
double fBorder,
double fAngle);
virtual ~GeoTexSvxGradientLinear() override;
@@ -109,7 +109,7 @@ namespace drawinglayer::texture
const basegfx::B2DRange& rDefinitionRange,
const basegfx::B2DRange& rOutputRange,
sal_uInt32 nRequestedSteps,
- const basegfx::ColorSteps& rColorSteps,
+ const basegfx::ColorStops& rColorStops,
double fBorder,
double fAngle);
virtual ~GeoTexSvxGradientAxial() override;
@@ -126,7 +126,7 @@ namespace drawinglayer::texture
GeoTexSvxGradientRadial(
const basegfx::B2DRange& rDefinitionRange,
sal_uInt32 nRequestedSteps,
- const basegfx::ColorSteps& rColorSteps,
+ const basegfx::ColorStops& rColorStops,
double fBorder,
double fOffsetX,
double fOffsetY);
@@ -144,7 +144,7 @@ namespace drawinglayer::texture
GeoTexSvxGradientElliptical(
const basegfx::B2DRange& rDefinitionRange,
sal_uInt32 nRequestedSteps,
- const basegfx::ColorSteps& rColorSteps,
+ const basegfx::ColorStops& rColorStops,
double fBorder,
double fOffsetX,
double fOffsetY,
@@ -163,7 +163,7 @@ namespace drawinglayer::texture
GeoTexSvxGradientSquare(
const basegfx::B2DRange& rDefinitionRange,
sal_uInt32 nRequestedSteps,
- const basegfx::ColorSteps& rColorSteps,
+ const basegfx::ColorStops& rColorStops,
double fBorder,
double fOffsetX,
double fOffsetY,
@@ -182,7 +182,7 @@ namespace drawinglayer::texture
GeoTexSvxGradientRect(
const basegfx::B2DRange& rDefinitionRange,
sal_uInt32 nRequestedSteps,
- const basegfx::ColorSteps& rColorSteps,
+ const basegfx::ColorStops& rColorStops,
double fBorder,
double fOffsetX,
double fOffsetY,