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/application | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/freestyle/intern/application')
-rw-r--r-- | source/blender/freestyle/intern/application/AppCanvas.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/application/AppCanvas.cpp b/source/blender/freestyle/intern/application/AppCanvas.cpp index 0367f5c1d6d..109afd48b1b 100644 --- a/source/blender/freestyle/intern/application/AppCanvas.cpp +++ b/source/blender/freestyle/intern/application/AppCanvas.cpp @@ -118,8 +118,8 @@ void AppCanvas::readColorPixels(int x, int y, int w, int h, RGBImage &oImage) co int ymax = border().getMax().y(); int rectx = _pass_diffuse.width; int recty = _pass_diffuse.height; - float xfac = ((float)rectx) / ((float)(xmax - xmin)); - float yfac = ((float)recty) / ((float)(ymax - ymin)); + float xfac = float(rectx) / float(xmax - xmin); + float yfac = float(recty) / float(ymax - ymin); #if 0 if (G.debug & G_DEBUG_FREESTYLE) { printf("readColorPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n", @@ -138,12 +138,12 @@ void AppCanvas::readColorPixels(int x, int y, int w, int h, RGBImage &oImage) co #endif int ii, jj; for (int j = 0; j < h; j++) { - jj = (int)((y - ymin + j) * yfac); + jj = int((y - ymin + j) * yfac); if (jj < 0 || jj >= recty) { continue; } for (int i = 0; i < w; i++) { - ii = (int)((x - xmin + i) * xfac); + ii = int((x - xmin + i) * xfac); if (ii < 0 || ii >= rectx) { continue; } @@ -167,8 +167,8 @@ void AppCanvas::readDepthPixels(int x, int y, int w, int h, GrayImage &oImage) c int ymax = border().getMax().y(); int rectx = _pass_z.width; int recty = _pass_z.height; - float xfac = ((float)rectx) / ((float)(xmax - xmin)); - float yfac = ((float)recty) / ((float)(ymax - ymin)); + float xfac = float(rectx) / float(xmax - xmin); + float yfac = float(recty) / float(ymax - ymin); #if 0 if (G.debug & G_DEBUG_FREESTYLE) { printf("readDepthPixels %d x %d @ (%d, %d) in %d x %d [%d x %d] -- %d x %d @ %d%%\n", @@ -187,12 +187,12 @@ void AppCanvas::readDepthPixels(int x, int y, int w, int h, GrayImage &oImage) c #endif int ii, jj; for (int j = 0; j < h; j++) { - jj = (int)((y - ymin + j) * yfac); + jj = int((y - ymin + j) * yfac); if (jj < 0 || jj >= recty) { continue; } for (int i = 0; i < w; i++) { - ii = (int)((x - xmin + i) * xfac); + ii = int((x - xmin + i) * xfac); if (ii < 0 || ii >= rectx) { continue; } |