diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-10-14 00:00:50 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-10-14 00:41:14 +0300 |
commit | ea79efef70da14100b591b50dcada819808f20b6 (patch) | |
tree | 4faf296870f1ab27ee33fee2b331fdb6b2d2bec4 /source/blender/compositor/operations/COM_BoxMaskOperation.cc | |
parent | ecb8a574c752068de9f8d9eb98f54db1569df2f7 (diff) |
Cleanup: remove `this->` for `m_` prefixed members in Compositor
For cleaning old code style as new code usually omit it.
Diffstat (limited to 'source/blender/compositor/operations/COM_BoxMaskOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_BoxMaskOperation.cc | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/source/blender/compositor/operations/COM_BoxMaskOperation.cc b/source/blender/compositor/operations/COM_BoxMaskOperation.cc index f536d9eb32d..e79e86e5ed2 100644 --- a/source/blender/compositor/operations/COM_BoxMaskOperation.cc +++ b/source/blender/compositor/operations/COM_BoxMaskOperation.cc @@ -25,19 +25,19 @@ BoxMaskOperation::BoxMaskOperation() this->addInputSocket(DataType::Value); this->addInputSocket(DataType::Value); this->addOutputSocket(DataType::Value); - this->m_inputMask = nullptr; - this->m_inputValue = nullptr; - this->m_cosine = 0.0f; - this->m_sine = 0.0f; + m_inputMask = nullptr; + m_inputValue = nullptr; + m_cosine = 0.0f; + m_sine = 0.0f; } void BoxMaskOperation::initExecution() { - this->m_inputMask = this->getInputSocketReader(0); - this->m_inputValue = this->getInputSocketReader(1); - const double rad = (double)this->m_data->rotation; - this->m_cosine = cos(rad); - this->m_sine = sin(rad); - this->m_aspectRatio = ((float)this->getWidth()) / this->getHeight(); + m_inputMask = this->getInputSocketReader(0); + m_inputValue = this->getInputSocketReader(1); + const double rad = (double)m_data->rotation; + m_cosine = cos(rad); + m_sine = sin(rad); + m_aspectRatio = ((float)this->getWidth()) / this->getHeight(); } void BoxMaskOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler) @@ -48,20 +48,20 @@ void BoxMaskOperation::executePixelSampled(float output[4], float x, float y, Pi float rx = x / this->getWidth(); float ry = y / this->getHeight(); - const float dy = (ry - this->m_data->y) / this->m_aspectRatio; - const float dx = rx - this->m_data->x; - rx = this->m_data->x + (this->m_cosine * dx + this->m_sine * dy); - ry = this->m_data->y + (-this->m_sine * dx + this->m_cosine * dy); + const float dy = (ry - m_data->y) / m_aspectRatio; + const float dx = rx - m_data->x; + rx = m_data->x + (m_cosine * dx + m_sine * dy); + ry = m_data->y + (-m_sine * dx + m_cosine * dy); - this->m_inputMask->readSampled(inputMask, x, y, sampler); - this->m_inputValue->readSampled(inputValue, x, y, sampler); + m_inputMask->readSampled(inputMask, x, y, sampler); + m_inputValue->readSampled(inputValue, x, y, sampler); - float halfHeight = this->m_data->height / 2.0f; - float halfWidth = this->m_data->width / 2.0f; - bool inside = (rx > this->m_data->x - halfWidth && rx < this->m_data->x + halfWidth && - ry > this->m_data->y - halfHeight && ry < this->m_data->y + halfHeight); + float halfHeight = m_data->height / 2.0f; + float halfWidth = m_data->width / 2.0f; + bool inside = (rx > m_data->x - halfWidth && rx < m_data->x + halfWidth && + ry > m_data->y - halfHeight && ry < m_data->y + halfHeight); - switch (this->m_maskType) { + switch (m_maskType) { case CMP_NODE_MASKTYPE_ADD: if (inside) { output[0] = MAX2(inputMask[0], inputValue[0]); @@ -143,18 +143,18 @@ void BoxMaskOperation::apply_mask(MemoryBuffer *output, { const float op_w = this->getWidth(); const float op_h = this->getHeight(); - const float half_w = this->m_data->width / 2.0f; - const float half_h = this->m_data->height / 2.0f; + const float half_w = m_data->width / 2.0f; + const float half_h = m_data->height / 2.0f; for (BuffersIterator<float> it = output->iterate_with(inputs, area); !it.is_end(); ++it) { const float op_ry = it.y / op_h; - const float dy = (op_ry - this->m_data->y) / m_aspectRatio; + const float dy = (op_ry - m_data->y) / m_aspectRatio; const float op_rx = it.x / op_w; - const float dx = op_rx - this->m_data->x; - const float rx = this->m_data->x + (m_cosine * dx + m_sine * dy); - const float ry = this->m_data->y + (-m_sine * dx + m_cosine * dy); + const float dx = op_rx - m_data->x; + const float rx = m_data->x + (m_cosine * dx + m_sine * dy); + const float ry = m_data->y + (-m_sine * dx + m_cosine * dy); - const bool inside = (rx > this->m_data->x - half_w && rx < this->m_data->x + half_w && - ry > this->m_data->y - half_h && ry < this->m_data->y + half_h); + const bool inside = (rx > m_data->x - half_w && rx < m_data->x + half_w && + ry > m_data->y - half_h && ry < m_data->y + half_h); const float *mask = it.in(0); const float *value = it.in(1); *it.out = mask_func(inside, mask, value); @@ -163,8 +163,8 @@ void BoxMaskOperation::apply_mask(MemoryBuffer *output, void BoxMaskOperation::deinitExecution() { - this->m_inputMask = nullptr; - this->m_inputValue = nullptr; + m_inputMask = nullptr; + m_inputValue = nullptr; } } // namespace blender::compositor |