diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 11:33:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 13:17:08 +0300 |
commit | f68cfd6bb078482c4a779a6e26a56e2734edb5b8 (patch) | |
tree | 2878e5b80dba5bdeba186d99661d604eb38879cd /source/blender/freestyle/intern/view_map/SteerableViewMap.cpp | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/freestyle/intern/view_map/SteerableViewMap.cpp')
-rw-r--r-- | source/blender/freestyle/intern/view_map/SteerableViewMap.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp index 88f94e152a1..0a05d469585 100644 --- a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp +++ b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp @@ -29,10 +29,10 @@ using namespace Geometry; SteerableViewMap::SteerableViewMap(uint nbOrientations) { _nbOrientations = nbOrientations; - _bound = cos(M_PI / (float)_nbOrientations); + _bound = cos(M_PI / float(_nbOrientations)); for (uint i = 0; i < _nbOrientations; ++i) { - _directions.emplace_back(cos((float)i * M_PI / (float)_nbOrientations), - sin((float)i * M_PI / (float)_nbOrientations)); + _directions.emplace_back(cos(float(i) * M_PI / float(_nbOrientations)), + sin(float(i) * M_PI / float(_nbOrientations))); } Build(); } @@ -101,7 +101,7 @@ double SteerableViewMap::ComputeWeight(const Vec2d &dir, unsigned i) dotp = 1.0; } - return cos((float)_nbOrientations / 2.0 * acos(dotp)); + return cos(float(_nbOrientations) / 2.0 * acos(dotp)); } double *SteerableViewMap::AddFEdge(FEdge *iFEdge) @@ -246,7 +246,7 @@ void SteerableViewMap::saveSteerableViewMap() const for (int y = 0; y < oh; ++y) { // soc for (int x = 0; x < ow; ++x) { // soc - int c = (int)(coeff * _imagesPyramids[i]->pixel(x, y, j)); + int c = int(coeff * _imagesPyramids[i]->pixel(x, y, j)); if (c > 255) { c = 255; } |