diff options
author | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-28 20:32:49 +0300 |
---|---|---|
committer | Manuel Castilla <manzanillawork@gmail.com> | 2021-09-28 23:00:16 +0300 |
commit | 76377f0176b9561a7fc8f46b4ed704c631ddd90d (patch) | |
tree | 96775442f403dfdb0dc4d91f835495c72c1ca9c1 /source/blender/compositor/operations/COM_ImageOperation.cc | |
parent | 2ecd963d87e4f5215d1d86e7f1c22ab7833697f3 (diff) |
Compositor: Replace resolution concept by canvas
This is a code refactor in preparation of supporting canvas
compositing. See {D12466}.
No functional changes, all canvases are at (0,0) position matching
tiled implementation.
Differential Revision: https://developer.blender.org/D12465
Diffstat (limited to 'source/blender/compositor/operations/COM_ImageOperation.cc')
-rw-r--r-- | source/blender/compositor/operations/COM_ImageOperation.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/compositor/operations/COM_ImageOperation.cc b/source/blender/compositor/operations/COM_ImageOperation.cc index e78d389410f..ff389093f5a 100644 --- a/source/blender/compositor/operations/COM_ImageOperation.cc +++ b/source/blender/compositor/operations/COM_ImageOperation.cc @@ -112,17 +112,14 @@ void BaseImageOperation::deinitExecution() } } -void BaseImageOperation::determineResolution(unsigned int resolution[2], - unsigned int /*preferredResolution*/[2]) +void BaseImageOperation::determine_canvas(const rcti &UNUSED(preferred_area), rcti &r_area) { ImBuf *stackbuf = getImBuf(); - resolution[0] = 0; - resolution[1] = 0; + r_area = COM_AREA_NONE; if (stackbuf) { - resolution[0] = stackbuf->x; - resolution[1] = stackbuf->y; + BLI_rcti_init(&r_area, 0, stackbuf->x, 0, stackbuf->y); } BKE_image_release_ibuf(this->m_image, stackbuf, nullptr); @@ -222,7 +219,7 @@ void ImageDepthOperation::executePixelSampled(float output[4], output[0] = 0.0f; } else { - int offset = y * this->m_width + x; + int offset = y * getWidth() + x; output[0] = this->m_depthBuffer[offset]; } } |