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-09-28 20:33:18 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-09-28 23:00:17 +0300
commit0830211c952983075f420175904fa10edf7b7f08 (patch)
treea8dd3c48d4d6624847665b55cbcffcf36e979e0b
parentf84fb12f5d72433780a96c3cc4381399f153cf1a (diff)
Cleanup: Remove XRange and YRange in Compositor
Mostly unused and originally meant for areas with positive values. With canvas compositing areas position may be negative.
-rw-r--r--source/blender/compositor/COM_defines.h20
-rw-r--r--source/blender/compositor/operations/COM_EllipseMaskOperation.cc4
-rw-r--r--source/blender/compositor/operations/COM_MixOperation.cc2
3 files changed, 3 insertions, 23 deletions
diff --git a/source/blender/compositor/COM_defines.h b/source/blender/compositor/COM_defines.h
index 55b331e279f..9991414aba4 100644
--- a/source/blender/compositor/COM_defines.h
+++ b/source/blender/compositor/COM_defines.h
@@ -127,24 +127,4 @@ constexpr float COM_BLUR_BOKEH_PIXELS = 512;
constexpr rcti COM_AREA_NONE = {0, 0, 0, 0};
constexpr rcti COM_CONSTANT_INPUT_AREA_OF_INTEREST = COM_AREA_NONE;
-constexpr IndexRange XRange(const rcti &area)
-{
- return IndexRange(area.xmin, area.xmax - area.xmin);
-}
-
-constexpr IndexRange YRange(const rcti &area)
-{
- return IndexRange(area.ymin, area.ymax - area.ymin);
-}
-
-constexpr IndexRange XRange(const rcti *area)
-{
- return XRange(*area);
-}
-
-constexpr IndexRange YRange(const rcti *area)
-{
- return YRange(*area);
-}
-
} // namespace blender::compositor
diff --git a/source/blender/compositor/operations/COM_EllipseMaskOperation.cc b/source/blender/compositor/operations/COM_EllipseMaskOperation.cc
index eb1fd98a590..bf6eee6d3f9 100644
--- a/source/blender/compositor/operations/COM_EllipseMaskOperation.cc
+++ b/source/blender/compositor/operations/COM_EllipseMaskOperation.cc
@@ -162,13 +162,13 @@ void EllipseMaskOperation::apply_mask(MemoryBuffer *output,
const float half_h = this->m_data->height / 2.0f;
const float tx = half_w * half_w;
const float ty = half_h * half_h;
- for (const int y : YRange(area)) {
+ for (int y = area.ymin; y < area.ymax; y++) {
const float op_ry = y / op_h;
const float dy = (op_ry - this->m_data->y) / m_aspectRatio;
float *out = output->get_elem(area.xmin, y);
const float *mask = input_mask->get_elem(area.xmin, y);
const float *value = input_value->get_elem(area.xmin, y);
- for (const int x : XRange(area)) {
+ for (int x = area.xmin; x < area.xmax; x++) {
const float op_rx = 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);
diff --git a/source/blender/compositor/operations/COM_MixOperation.cc b/source/blender/compositor/operations/COM_MixOperation.cc
index 4b9f4786e79..895d32e6fee 100644
--- a/source/blender/compositor/operations/COM_MixOperation.cc
+++ b/source/blender/compositor/operations/COM_MixOperation.cc
@@ -109,7 +109,7 @@ void MixBaseOperation::update_memory_buffer_partial(MemoryBuffer *output,
p.value_stride = input_value->elem_stride;
p.color1_stride = input_color1->elem_stride;
p.color2_stride = input_color2->elem_stride;
- for (const int y : YRange(area)) {
+ for (int y = area.ymin; y < area.ymax; y++) {
p.out = output->get_elem(area.xmin, y);
p.row_end = p.out + width * output->elem_stride;
p.value = input_value->get_elem(area.xmin, y);