Compositor: Full frame Viewer node
Adds full frame implementation to this node operation. No functional changes. No performance changes. Reviewed By: jbakker Differential Revision: https://developer.blender.org/D11698
This commit is contained in:
parent
b848d5cdf5
commit
300fe84bf0
|
@ -191,10 +191,11 @@ void ViewerOperation::initImage()
|
|||
BLI_thread_unlock(LOCK_DRAW_IMAGE);
|
||||
}
|
||||
|
||||
void ViewerOperation::updateImage(rcti *rect)
|
||||
void ViewerOperation::updateImage(const rcti *rect)
|
||||
{
|
||||
float *buffer = m_outputBuffer;
|
||||
IMB_partial_display_buffer_update(this->m_ibuf,
|
||||
this->m_outputBuffer,
|
||||
buffer,
|
||||
nullptr,
|
||||
getWidth(),
|
||||
0,
|
||||
|
@ -218,4 +219,31 @@ eCompositorPriority ViewerOperation::getRenderPriority() const
|
|||
return eCompositorPriority::Low;
|
||||
}
|
||||
|
||||
void ViewerOperation::update_memory_buffer_partial(MemoryBuffer *UNUSED(output),
|
||||
const rcti &area,
|
||||
Span<MemoryBuffer *> inputs)
|
||||
{
|
||||
if (!m_outputBuffer) {
|
||||
return;
|
||||
}
|
||||
|
||||
MemoryBuffer output_buffer(
|
||||
m_outputBuffer, COM_DATA_TYPE_COLOR_CHANNELS, getWidth(), getHeight());
|
||||
const MemoryBuffer *input_image = inputs[0];
|
||||
output_buffer.copy_from(input_image, area);
|
||||
if (this->m_useAlphaInput) {
|
||||
const MemoryBuffer *input_alpha = inputs[1];
|
||||
output_buffer.copy_from(input_alpha, area, 0, COM_DATA_TYPE_VALUE_CHANNELS, 3);
|
||||
}
|
||||
|
||||
if (m_depthBuffer) {
|
||||
MemoryBuffer depth_buffer(
|
||||
m_depthBuffer, COM_DATA_TYPE_VALUE_CHANNELS, getWidth(), getHeight());
|
||||
const MemoryBuffer *input_depth = inputs[2];
|
||||
depth_buffer.copy_from(input_depth, area);
|
||||
}
|
||||
|
||||
updateImage(&area);
|
||||
}
|
||||
|
||||
} // namespace blender::compositor
|
||||
|
|
|
@ -20,15 +20,17 @@
|
|||
|
||||
#include "BKE_global.h"
|
||||
#include "BLI_rect.h"
|
||||
#include "COM_NodeOperation.h"
|
||||
#include "COM_MultiThreadedOperation.h"
|
||||
#include "DNA_image_types.h"
|
||||
|
||||
namespace blender::compositor {
|
||||
|
||||
class ViewerOperation : public NodeOperation {
|
||||
class ViewerOperation : public MultiThreadedOperation {
|
||||
private:
|
||||
/* TODO(manzanilla): To be removed together with tiled implementation. */
|
||||
float *m_outputBuffer;
|
||||
float *m_depthBuffer;
|
||||
|
||||
Image *m_image;
|
||||
ImageUser *m_imageUser;
|
||||
bool m_active;
|
||||
|
@ -125,8 +127,12 @@ class ViewerOperation : public NodeOperation {
|
|||
this->m_displaySettings = displaySettings;
|
||||
}
|
||||
|
||||
void update_memory_buffer_partial(MemoryBuffer *output,
|
||||
const rcti &area,
|
||||
Span<MemoryBuffer *> inputs) override;
|
||||
|
||||
private:
|
||||
void updateImage(rcti *rect);
|
||||
void updateImage(const rcti *rect);
|
||||
void initImage();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue