cui/source/dialogs/cuigrfflt.cxx             |   20 ++++++++++----------
 include/vcl/BitmapEmbossGreyFilter.hxx       |   13 ++++++++-----
 vcl/source/bitmap/BitmapEmbossGreyFilter.cxx |    4 ++--
 vcl/workben/vcldemo.cxx                      |    2 +-
 4 files changed, 21 insertions(+), 18 deletions(-)

New commits:
commit 140dc375adfffa59dff2652eb8b9625c23d81c8b
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Tue Oct 3 15:09:23 2023 +0300
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Tue Oct 3 17:03:34 2023 +0200

    Use Degree100
    
    Change-Id: I133dbe40d57eda77b64f3e38631da30f296489f4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157517
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx
index 48373e7f1968..c29bc4947e00 100644
--- a/cui/source/dialogs/cuigrfflt.cxx
+++ b/cui/source/dialogs/cuigrfflt.cxx
@@ -431,21 +431,21 @@ GraphicFilterEmboss::~GraphicFilterEmboss()
 Graphic GraphicFilterEmboss::GetFilteredGraphic( const Graphic& rGraphic, 
double, double )
 {
     Graphic aRet;
-    sal_uInt16  nAzim, nElev;
+    Degree100  nAzim, nElev;
 
     switch (maCtlLight.GetActualRP())
     {
         default:       
OSL_FAIL("svx::GraphicFilterEmboss::GetFilteredGraphic(), unknown Reference 
Point!" );
                        [[fallthrough]];
-        case RectPoint::LT: nAzim = 4500;    nElev = 4500; break;
-        case RectPoint::MT: nAzim = 9000;    nElev = 4500; break;
-        case RectPoint::RT: nAzim = 13500;   nElev = 4500; break;
-        case RectPoint::LM: nAzim = 0;       nElev = 4500; break;
-        case RectPoint::MM: nAzim = 0;       nElev = 9000; break;
-        case RectPoint::RM: nAzim = 18000;   nElev = 4500; break;
-        case RectPoint::LB: nAzim = 31500;   nElev = 4500; break;
-        case RectPoint::MB: nAzim = 27000;   nElev = 4500; break;
-        case RectPoint::RB: nAzim = 22500;   nElev = 4500; break;
+        case RectPoint::LT: nAzim = 4500_deg100;    nElev = 4500_deg100; break;
+        case RectPoint::MT: nAzim = 9000_deg100;    nElev = 4500_deg100; break;
+        case RectPoint::RT: nAzim = 13500_deg100;   nElev = 4500_deg100; break;
+        case RectPoint::LM: nAzim = 0_deg100;       nElev = 4500_deg100; break;
+        case RectPoint::MM: nAzim = 0_deg100;       nElev = 9000_deg100; break;
+        case RectPoint::RM: nAzim = 18000_deg100;   nElev = 4500_deg100; break;
+        case RectPoint::LB: nAzim = 31500_deg100;   nElev = 4500_deg100; break;
+        case RectPoint::MB: nAzim = 27000_deg100;   nElev = 4500_deg100; break;
+        case RectPoint::RB: nAzim = 22500_deg100;   nElev = 4500_deg100; break;
     }
 
     if( rGraphic.IsAnimated() )
diff --git a/include/vcl/BitmapEmbossGreyFilter.hxx 
b/include/vcl/BitmapEmbossGreyFilter.hxx
index 2f1d309e0e59..34d9b5bb8c10 100644
--- a/include/vcl/BitmapEmbossGreyFilter.hxx
+++ b/include/vcl/BitmapEmbossGreyFilter.hxx
@@ -11,6 +11,9 @@
 #ifndef INCLUDED_VCL_BITMAPEMBOSSGREYFILTER_HXX
 #define INCLUDED_VCL_BITMAPEMBOSSGREYFILTER_HXX
 
+#include <sal/config.h>
+
+#include <tools/degree.hxx>
 #include <vcl/BitmapFilter.hxx>
 
 class BitmapEx;
@@ -18,17 +21,17 @@ class BitmapEx;
 class VCL_DLLPUBLIC BitmapEmbossGreyFilter final : public BitmapFilter
 {
 public:
-    BitmapEmbossGreyFilter(sal_uInt16 nAzimuthAngle100, sal_uInt16 
nElevationAngle100)
-        : mnAzimuthAngle100(nAzimuthAngle100)
-        , mnElevationAngle100(nElevationAngle100)
+    BitmapEmbossGreyFilter(Degree100 nAzimuthAngle, Degree100 nElevationAngle)
+        : mnAzimuthAngle(nAzimuthAngle)
+        , mnElevationAngle(nElevationAngle)
     {
     }
 
     virtual BitmapEx execute(BitmapEx const& rBitmapEx) const override;
 
 private:
-    sal_uInt16 mnAzimuthAngle100;
-    sal_uInt16 mnElevationAngle100;
+    Degree100 mnAzimuthAngle;
+    Degree100 mnElevationAngle;
 };
 
 #endif
diff --git a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx 
b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx
index 06406152d6d6..405a9056b954 100644
--- a/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx
+++ b/vcl/source/bitmap/BitmapEmbossGreyFilter.cxx
@@ -39,8 +39,8 @@ BitmapEx BitmapEmbossGreyFilter::execute(BitmapEx const& 
rBitmapEx) const
     BitmapColor aGrey(sal_uInt8(0));
     const sal_Int32 nWidth = pWriteAcc->Width();
     const sal_Int32 nHeight = pWriteAcc->Height();
-    const double fAzim = basegfx::deg2rad<100>(mnAzimuthAngle100);
-    const double fElev = basegfx::deg2rad<100>(mnElevationAngle100);
+    const double fAzim = toRadians(mnAzimuthAngle);
+    const double fElev = toRadians(mnElevationAngle);
     std::vector<sal_Int32> pHMap(nWidth + 2);
     std::vector<sal_Int32> pVMap(nHeight + 2);
     const double nLx = cos(fAzim) * cos(fElev) * 255.0;
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 5b9b2b0289e1..346de0b52a09 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -149,7 +149,7 @@ public:
         maIntroBW = maIntro.GetBitmap();
 
         BitmapEx aTmpBmpEx(maIntroBW);
-        BitmapFilter::Filter(aTmpBmpEx, BitmapEmbossGreyFilter(0, 0));
+        BitmapFilter::Filter(aTmpBmpEx, BitmapEmbossGreyFilter(0_deg100, 
0_deg100));
         maIntroBW = aTmpBmpEx.GetBitmap();
 
         InitRenderers();

Reply via email to