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/intern/COM_MemoryBuffer.cc | |
parent | c7b247a118e302a3afc6473797e53b6af28b69e2 (diff) |
Cleanup: replace C-style casts with functional casts for numeric types
Diffstat (limited to 'source/blender/compositor/intern/COM_MemoryBuffer.cc')
-rw-r--r-- | source/blender/compositor/intern/COM_MemoryBuffer.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cc b/source/blender/compositor/intern/COM_MemoryBuffer.cc index 95bb233ff6c..539e1179bc8 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cc +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cc @@ -266,7 +266,7 @@ void MemoryBuffer::copy_from(const uchar *src, const float *row_end = to_elem + width * this->elem_stride; while (to_elem < row_end) { for (int i = 0; i < elem_size; i++) { - to_elem[i] = ((float)from_elem[i]) * (1.0f / 255.0f); + to_elem[i] = float(from_elem[i]) * (1.0f / 255.0f); } to_elem += this->elem_stride; from_elem += elem_stride; @@ -427,7 +427,7 @@ void MemoryBuffer::read_elem_filtered( const float deriv[2][2] = {{dx[0], dx[1]}, {dy[0], dy[1]}}; - float inv_width = 1.0f / (float)this->get_width(), inv_height = 1.0f / (float)this->get_height(); + float inv_width = 1.0f / float(this->get_width()), inv_height = 1.0f / float(this->get_height()); /* TODO(sergey): Render pipeline uses normalized coordinates and derivatives, * but compositor uses pixel space. For now let's just divide the values and * switch compositor to normalized space for EWA later. @@ -463,8 +463,8 @@ void MemoryBuffer::readEWA(float *result, const float uv[2], const float derivat } else { BLI_assert(datatype_ == DataType::Color); - float inv_width = 1.0f / (float)this->get_width(), - inv_height = 1.0f / (float)this->get_height(); + float inv_width = 1.0f / float(this->get_width()), + inv_height = 1.0f / float(this->get_height()); /* TODO(sergey): Render pipeline uses normalized coordinates and derivatives, * but compositor uses pixel space. For now let's just divide the values and * switch compositor to normalized space for EWA later. |