diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-10-14 00:01:15 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-10-14 00:41:14 +0300 |
commit | 1c42d4930a24d639b3aa561b9a8b4bbce05977e0 (patch) | |
tree | 68c2aae3fd5ae98b78708bea28c0b55d3f4fb5f0 /source/blender/compositor/operations/COM_TextureOperation.cc | |
parent | a2ee3c3a9f01f5cb2f05f1e84a1b6c1931d9d4a4 (diff) |
Cleanup: convert camelCase naming to snake_case in Compositor
To convert old code to the current convention and
use a single code style.
Diffstat (limited to 'source/blender/compositor/operations/COM_TextureOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_TextureOperation.cc | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/source/blender/compositor/operations/COM_TextureOperation.cc b/source/blender/compositor/operations/COM_TextureOperation.cc index 7c18b8214de..da1c90cd1c5 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cc +++ b/source/blender/compositor/operations/COM_TextureOperation.cc @@ -26,46 +26,46 @@ namespace blender::compositor { TextureBaseOperation::TextureBaseOperation() { - this->addInputSocket(DataType::Vector); // offset - this->addInputSocket(DataType::Vector); // size + this->add_input_socket(DataType::Vector); // offset + this->add_input_socket(DataType::Vector); // size texture_ = nullptr; - inputSize_ = nullptr; - inputOffset_ = nullptr; + input_size_ = nullptr; + input_offset_ = nullptr; rd_ = nullptr; pool_ = nullptr; - sceneColorManage_ = false; + scene_color_manage_ = false; flags.complex = true; } TextureOperation::TextureOperation() : TextureBaseOperation() { - this->addOutputSocket(DataType::Color); + this->add_output_socket(DataType::Color); } TextureAlphaOperation::TextureAlphaOperation() : TextureBaseOperation() { - this->addOutputSocket(DataType::Value); + this->add_output_socket(DataType::Value); } -void TextureBaseOperation::initExecution() +void TextureBaseOperation::init_execution() { - inputOffset_ = getInputSocketReader(0); - inputSize_ = getInputSocketReader(1); + input_offset_ = get_input_socket_reader(0); + input_size_ = get_input_socket_reader(1); pool_ = BKE_image_pool_new(); if (texture_ != nullptr && texture_->nodetree != nullptr && texture_->use_nodes) { ntreeTexBeginExecTree(texture_->nodetree); } - NodeOperation::initExecution(); + NodeOperation::init_execution(); } -void TextureBaseOperation::deinitExecution() +void TextureBaseOperation::deinit_execution() { - inputSize_ = nullptr; - inputOffset_ = nullptr; + input_size_ = nullptr; + input_offset_ = nullptr; BKE_image_pool_free(pool_); pool_ = nullptr; if (texture_ != nullptr && texture_->use_nodes && texture_->nodetree != nullptr && texture_->nodetree->execdata != nullptr) { ntreeTexEndExecTree(texture_->nodetree->execdata); } - NodeOperation::deinitExecution(); + NodeOperation::deinit_execution(); } void TextureBaseOperation::determine_canvas(const rcti &preferred_area, rcti &r_area) @@ -85,30 +85,30 @@ void TextureBaseOperation::determine_canvas(const rcti &preferred_area, rcti &r_ } } -void TextureAlphaOperation::executePixelSampled(float output[4], - float x, - float y, - PixelSampler sampler) +void TextureAlphaOperation::execute_pixel_sampled(float output[4], + float x, + float y, + PixelSampler sampler) { float color[4]; - TextureBaseOperation::executePixelSampled(color, x, y, sampler); + TextureBaseOperation::execute_pixel_sampled(color, x, y, sampler); output[0] = color[3]; } -void TextureBaseOperation::executePixelSampled(float output[4], - float x, - float y, - PixelSampler sampler) +void TextureBaseOperation::execute_pixel_sampled(float output[4], + float x, + float y, + PixelSampler sampler) { TexResult texres = {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, nullptr}; - float textureSize[4]; - float textureOffset[4]; + float texture_size[4]; + float texture_offset[4]; float vec[3]; int retval; - const float cx = this->getWidth() / 2; - const float cy = this->getHeight() / 2; - float u = (x - cx) / this->getWidth() * 2; - float v = (y - cy) / this->getHeight() * 2; + const float cx = this->get_width() / 2; + const float cy = this->get_height() / 2; + float u = (x - cx) / this->get_width() * 2; + float v = (y - cy) / this->get_height() * 2; /* When no interpolation/filtering happens in multitex() force nearest interpolation. * We do it here because (a) we can't easily say multitex() that we want nearest @@ -120,16 +120,16 @@ void TextureBaseOperation::executePixelSampled(float output[4], v += 0.5f / cy; } - inputSize_->readSampled(textureSize, x, y, sampler); - inputOffset_->readSampled(textureOffset, x, y, sampler); + input_size_->read_sampled(texture_size, x, y, sampler); + input_offset_->read_sampled(texture_offset, x, y, sampler); - vec[0] = textureSize[0] * (u + textureOffset[0]); - vec[1] = textureSize[1] * (v + textureOffset[1]); - vec[2] = textureSize[2] * textureOffset[2]; + vec[0] = texture_size[0] * (u + texture_offset[0]); + vec[1] = texture_size[1] * (v + texture_offset[1]); + vec[2] = texture_size[2] * texture_offset[2]; const int thread_id = WorkScheduler::current_thread_id(); retval = multitex_ext( - texture_, vec, nullptr, nullptr, 0, &texres, thread_id, pool_, sceneColorManage_, false); + texture_, vec, nullptr, nullptr, 0, &texres, thread_id, pool_, scene_color_manage_, false); output[3] = texres.talpha ? texres.ta : texres.tin; if (retval & TEX_RGB) { @@ -146,8 +146,8 @@ void TextureBaseOperation::update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span<MemoryBuffer *> inputs) { - const int op_width = this->getWidth(); - const int op_height = this->getHeight(); + const int op_width = this->get_width(); + const int op_height = this->get_height(); const float center_x = op_width / 2; const float center_y = op_height / 2; TexResult tex_result = {0}; @@ -181,7 +181,7 @@ void TextureBaseOperation::update_memory_buffer_partial(MemoryBuffer *output, &tex_result, thread_id, pool_, - sceneColorManage_, + scene_color_manage_, false); it.out[3] = tex_result.talpha ? tex_result.ta : tex_result.tin; |