diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-25 10:04:52 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-25 11:26:27 +0300 |
commit | 891949cbb47143420f4324cb60efc05ef5d70b39 (patch) | |
tree | fe70a45612ae96f9ce1f37378ef5ff035d3127f5 /source/blender/freestyle/intern/image/ImagePyramid.cpp | |
parent | c9e35c2ced92082c86f1ecb9ecd16c6230218c7c (diff) |
Cleanup: use 'u' prefixed integer types for brevity & cast style
To use function style cast '(unsigned char)x' can't be replaced by
'unsigned char(x)'.
Diffstat (limited to 'source/blender/freestyle/intern/image/ImagePyramid.cpp')
-rw-r--r-- | source/blender/freestyle/intern/image/ImagePyramid.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/freestyle/intern/image/ImagePyramid.cpp b/source/blender/freestyle/intern/image/ImagePyramid.cpp index 2a555a22915..f595efabe0b 100644 --- a/source/blender/freestyle/intern/image/ImagePyramid.cpp +++ b/source/blender/freestyle/intern/image/ImagePyramid.cpp @@ -54,9 +54,9 @@ float ImagePyramid::pixel(int x, int y, int level) if (0 == level) { return img->pixel(x, y); } - unsigned int i = 1 << level; - unsigned int sx = x >> level; - unsigned int sy = y >> level; + uint i = 1 << level; + uint sx = x >> level; + uint sy = y >> level; if (sx >= img->width()) { sx = img->width() - 1; } @@ -141,12 +141,12 @@ void GaussianPyramid::BuildPyramid(GrayImage *level0, unsigned nbLevels) unsigned w = pLevel->width(); unsigned h = pLevel->height(); if (nbLevels != 0) { - for (unsigned int i = 0; i < nbLevels; ++i) { // soc + for (uint i = 0; i < nbLevels; ++i) { // soc w = pLevel->width() >> 1; h = pLevel->height() >> 1; GrayImage *img = new GrayImage(w, h); - for (unsigned int y = 0; y < h; ++y) { - for (unsigned int x = 0; x < w; ++x) { + for (uint y = 0; y < h; ++y) { + for (uint x = 0; x < w; ++x) { float v = gf.getSmoothedPixel<GrayImage>(pLevel, 2 * x, 2 * y); img->setPixel(x, y, v); } @@ -160,8 +160,8 @@ void GaussianPyramid::BuildPyramid(GrayImage *level0, unsigned nbLevels) w = pLevel->width() >> 1; h = pLevel->height() >> 1; GrayImage *img = new GrayImage(w, h); - for (unsigned int y = 0; y < h; ++y) { - for (unsigned int x = 0; x < w; ++x) { + for (uint y = 0; y < h; ++y) { + for (uint x = 0; x < w; ++x) { float v = gf.getSmoothedPixel<GrayImage>(pLevel, 2 * x, 2 * y); img->setPixel(x, y, v); } |