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/compositor/operations/COM_KeyingScreenOperation.cc | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/compositor/operations/COM_KeyingScreenOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_KeyingScreenOperation.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/compositor/operations/COM_KeyingScreenOperation.cc b/source/blender/compositor/operations/COM_KeyingScreenOperation.cc index c037a1e0330..5c5bf5534a7 100644 --- a/source/blender/compositor/operations/COM_KeyingScreenOperation.cc +++ b/source/blender/compositor/operations/COM_KeyingScreenOperation.cc @@ -152,9 +152,9 @@ KeyingScreenOperation::TriangulationData *KeyingScreenOperation::build_voronoi_t else { uchar *rrgb = (uchar *)pattern_ibuf->rect; - site->color[0] += srgb_to_linearrgb((float)rrgb[4 * j + 0] / 255.0f); - site->color[1] += srgb_to_linearrgb((float)rrgb[4 * j + 1] / 255.0f); - site->color[2] += srgb_to_linearrgb((float)rrgb[4 * j + 2] / 255.0f); + site->color[0] += srgb_to_linearrgb(float(rrgb[4 * j + 0]) / 255.0f); + site->color[1] += srgb_to_linearrgb(float(rrgb[4 * j + 1]) / 255.0f); + site->color[2] += srgb_to_linearrgb(float(rrgb[4 * j + 2]) / 255.0f); } } @@ -204,11 +204,11 @@ KeyingScreenOperation::TriangulationData *KeyingScreenOperation::build_voronoi_t minmax_v2v2_v2(min, max, b->co); minmax_v2v2_v2(min, max, c->co); - rect->xmin = (int)min[0]; - rect->ymin = (int)min[1]; + rect->xmin = int(min[0]); + rect->ymin = int(min[1]); - rect->xmax = (int)max[0] + 1; - rect->ymax = (int)max[1] + 1; + rect->xmax = int(max[0]) + 1; + rect->ymax = int(max[1]) + 1; } } @@ -311,7 +311,7 @@ void KeyingScreenOperation::execute_pixel(float output[4], int x, int y, void *d TriangulationData *triangulation = cached_triangulation_; TileData *tile_data = (TileData *)data; int i; - float co[2] = {(float)x, (float)y}; + float co[2] = {float(x), float(y)}; for (i = 0; i < tile_data->triangles_total; i++) { int triangle_idx = tile_data->triangles[i]; @@ -356,7 +356,7 @@ void KeyingScreenOperation::update_memory_buffer_partial(MemoryBuffer *output, for (BuffersIterator<float> it = output->iterate_with(inputs, area); !it.is_end(); ++it) { copy_v4_v4(it.out, COM_COLOR_BLACK); - const float co[2] = {(float)it.x, (float)it.y}; + const float co[2] = {float(it.x), float(it.y)}; for (int i = 0; i < num_triangles; i++) { const int triangle_idx = triangles[i]; const rcti *rect = &triangulation->triangles_AABB[triangle_idx]; |