Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Castilla <manzanillawork@gmail.com>2021-10-14 00:01:15 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-10-14 00:41:14 +0300
commit1c42d4930a24d639b3aa561b9a8b4bbce05977e0 (patch)
tree68c2aae3fd5ae98b78708bea28c0b55d3f4fb5f0 /source/blender/compositor/operations/COM_ImageOperation.cc
parenta2ee3c3a9f01f5cb2f05f1e84a1b6c1931d9d4a4 (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_ImageOperation.cc')
-rw-r--r--source/blender/compositor/operations/COM_ImageOperation.cc80
1 files changed, 40 insertions, 40 deletions
diff --git a/source/blender/compositor/operations/COM_ImageOperation.cc b/source/blender/compositor/operations/COM_ImageOperation.cc
index 84c5b9654ce..e32343cfbf2 100644
--- a/source/blender/compositor/operations/COM_ImageOperation.cc
+++ b/source/blender/compositor/operations/COM_ImageOperation.cc
@@ -30,35 +30,35 @@ BaseImageOperation::BaseImageOperation()
{
image_ = nullptr;
buffer_ = nullptr;
- imageFloatBuffer_ = nullptr;
- imageByteBuffer_ = nullptr;
- imageUser_ = nullptr;
+ image_float_buffer_ = nullptr;
+ image_byte_buffer_ = nullptr;
+ image_user_ = nullptr;
imagewidth_ = 0;
imageheight_ = 0;
framenumber_ = 0;
- depthBuffer_ = nullptr;
+ image_depth_buffer_ = nullptr;
depth_buffer_ = nullptr;
- numberOfChannels_ = 0;
+ number_of_channels_ = 0;
rd_ = nullptr;
- viewName_ = nullptr;
+ view_name_ = nullptr;
}
ImageOperation::ImageOperation() : BaseImageOperation()
{
- this->addOutputSocket(DataType::Color);
+ this->add_output_socket(DataType::Color);
}
ImageAlphaOperation::ImageAlphaOperation() : BaseImageOperation()
{
- this->addOutputSocket(DataType::Value);
+ this->add_output_socket(DataType::Value);
}
ImageDepthOperation::ImageDepthOperation() : BaseImageOperation()
{
- this->addOutputSocket(DataType::Value);
+ this->add_output_socket(DataType::Value);
}
-ImBuf *BaseImageOperation::getImBuf()
+ImBuf *BaseImageOperation::get_im_buf()
{
ImBuf *ibuf;
- ImageUser iuser = *imageUser_;
+ ImageUser iuser = *image_user_;
if (image_ == nullptr) {
return nullptr;
@@ -66,7 +66,7 @@ ImBuf *BaseImageOperation::getImBuf()
/* local changes to the original ImageUser */
if (BKE_image_is_multilayer(image_) == false) {
- iuser.multi_index = BKE_scene_multiview_view_id_get(rd_, viewName_);
+ iuser.multi_index = BKE_scene_multiview_view_id_get(rd_, view_name_);
}
ibuf = BKE_image_acquire_ibuf(image_, &iuser, nullptr);
@@ -77,27 +77,27 @@ ImBuf *BaseImageOperation::getImBuf()
return ibuf;
}
-void BaseImageOperation::initExecution()
+void BaseImageOperation::init_execution()
{
- ImBuf *stackbuf = getImBuf();
+ ImBuf *stackbuf = get_im_buf();
buffer_ = stackbuf;
if (stackbuf) {
- imageFloatBuffer_ = stackbuf->rect_float;
- imageByteBuffer_ = stackbuf->rect;
- depthBuffer_ = stackbuf->zbuf_float;
+ image_float_buffer_ = stackbuf->rect_float;
+ image_byte_buffer_ = stackbuf->rect;
+ image_depth_buffer_ = stackbuf->zbuf_float;
if (stackbuf->zbuf_float) {
depth_buffer_ = new MemoryBuffer(stackbuf->zbuf_float, 1, stackbuf->x, stackbuf->y);
}
imagewidth_ = stackbuf->x;
imageheight_ = stackbuf->y;
- numberOfChannels_ = stackbuf->channels;
+ number_of_channels_ = stackbuf->channels;
}
}
-void BaseImageOperation::deinitExecution()
+void BaseImageOperation::deinit_execution()
{
- imageFloatBuffer_ = nullptr;
- imageByteBuffer_ = nullptr;
+ image_float_buffer_ = nullptr;
+ image_byte_buffer_ = nullptr;
BKE_image_release_ibuf(image_, buffer_, nullptr);
if (depth_buffer_) {
delete depth_buffer_;
@@ -107,7 +107,7 @@ void BaseImageOperation::deinitExecution()
void BaseImageOperation::determine_canvas(const rcti &UNUSED(preferred_area), rcti &r_area)
{
- ImBuf *stackbuf = getImBuf();
+ ImBuf *stackbuf = get_im_buf();
r_area = COM_AREA_NONE;
@@ -118,7 +118,7 @@ void BaseImageOperation::determine_canvas(const rcti &UNUSED(preferred_area), rc
BKE_image_release_ibuf(image_, stackbuf, nullptr);
}
-static void sampleImageAtLocation(
+static void sample_image_at_location(
ImBuf *ibuf, float x, float y, PixelSampler sampler, bool make_linear_rgb, float color[4])
{
if (ibuf->rect_float) {
@@ -154,17 +154,17 @@ static void sampleImageAtLocation(
}
}
-void ImageOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)
+void ImageOperation::execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler)
{
int ix = x, iy = y;
- if (imageFloatBuffer_ == nullptr && imageByteBuffer_ == nullptr) {
+ if (image_float_buffer_ == nullptr && image_byte_buffer_ == nullptr) {
zero_v4(output);
}
else if (ix < 0 || iy < 0 || ix >= buffer_->x || iy >= buffer_->y) {
zero_v4(output);
}
else {
- sampleImageAtLocation(buffer_, x, y, sampler, true, output);
+ sample_image_at_location(buffer_, x, y, sampler, true, output);
}
}
@@ -175,19 +175,19 @@ void ImageOperation::update_memory_buffer_partial(MemoryBuffer *output,
output->copy_from(buffer_, area, true);
}
-void ImageAlphaOperation::executePixelSampled(float output[4],
- float x,
- float y,
- PixelSampler sampler)
+void ImageAlphaOperation::execute_pixel_sampled(float output[4],
+ float x,
+ float y,
+ PixelSampler sampler)
{
float tempcolor[4];
- if (imageFloatBuffer_ == nullptr && imageByteBuffer_ == nullptr) {
+ if (image_float_buffer_ == nullptr && image_byte_buffer_ == nullptr) {
output[0] = 0.0f;
}
else {
tempcolor[3] = 1.0f;
- sampleImageAtLocation(buffer_, x, y, sampler, false, tempcolor);
+ sample_image_at_location(buffer_, x, y, sampler, false, tempcolor);
output[0] = tempcolor[3];
}
}
@@ -199,21 +199,21 @@ void ImageAlphaOperation::update_memory_buffer_partial(MemoryBuffer *output,
output->copy_from(buffer_, area, 3, COM_DATA_TYPE_VALUE_CHANNELS, 0);
}
-void ImageDepthOperation::executePixelSampled(float output[4],
- float x,
- float y,
- PixelSampler /*sampler*/)
+void ImageDepthOperation::execute_pixel_sampled(float output[4],
+ float x,
+ float y,
+ PixelSampler /*sampler*/)
{
- if (depthBuffer_ == nullptr) {
+ if (image_depth_buffer_ == nullptr) {
output[0] = 0.0f;
}
else {
- if (x < 0 || y < 0 || x >= this->getWidth() || y >= this->getHeight()) {
+ if (x < 0 || y < 0 || x >= this->get_width() || y >= this->get_height()) {
output[0] = 0.0f;
}
else {
- int offset = y * getWidth() + x;
- output[0] = depthBuffer_[offset];
+ int offset = y * get_width() + x;
+ output[0] = image_depth_buffer_[offset];
}
}
}