36 this->m_resolutionInputSocketIndex = 0;
39 this->m_btree =
nullptr;
44 return &m_outputs[index];
49 return &m_inputs[index];
63 unsigned int preferredResolution[2])
65 unsigned int used_resolution_index = 0;
68 unsigned int any_resolution[2] = {0, 0};
69 input.determineResolution(any_resolution, preferredResolution);
70 if (any_resolution[0] * any_resolution[1] > 0) {
71 resolution[0] = any_resolution[0];
72 resolution[1] = any_resolution[1];
75 used_resolution_index += 1;
78 else if (m_resolutionInputSocketIndex < m_inputs.size()) {
81 used_resolution_index = m_resolutionInputSocketIndex;
83 unsigned int temp2[2] = {resolution[0], resolution[1]};
86 for (
unsigned int index = 0; index < m_inputs.size(); index++) {
87 if (index == used_resolution_index) {
99 this->m_resolutionInputSocketIndex = index;
149 if (m_inputs.size() == 0) {
158 if (inputOperation &&
183 : m_operation(op), m_datatype(datatype), m_resizeMode(resizeMode), m_link(nullptr)
197 unsigned int preferredResolution[2])
209 : m_operation(op), m_datatype(datatype)
214 unsigned int preferredResolution[2])
218 resolution[0] = operation.
getWidth();
223 if (resolution[0] > 0 && resolution[1] > 0) {
231 if (node_operation_flags.
complex) {
234 if (node_operation_flags.
open_cl) {
238 os <<
"single_threaded,";
241 os <<
"render_border,";
244 os <<
"view_border,";
247 os <<
"resolution_set,";
250 os <<
"set_operation,";
253 os <<
"write_buffer,";
256 os <<
"read_buffer,";
268 os <<
"no_conversion,";
277 os <<
"NodeOperation(";
278 os <<
"id=" << node_operation.
get_id();
279 if (!node_operation.
get_name().empty()) {
280 os <<
",name=" << node_operation.
get_name();
282 os <<
",flags={" << flags <<
"}";
288 if (write_operation) {
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
void BLI_mutex_end(ThreadMutex *mutex)
void BLI_mutex_init(ThreadMutex *mutex)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_mutex_unlock(ThreadMutex *mutex)
A MemoryProxy is a unique identifier for a memory buffer. A single MemoryProxy is used among all chun...
WriteBufferOperation * getWriteBufferOperation() const
get the WriteBufferOperation that is responsible for writing to this MemoryProxy
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
determine the resolution of this data going through this socket
NodeOperationOutput(NodeOperation *op, DataType datatype)
NodeOperation & getOperation() const
NodeOperation contains calculation logic.
virtual void initExecution()
NodeOperationInput * getInputSocket(unsigned int index)
unsigned int getHeight() const
void addInputSocket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
NodeOperation * getInputOperation(unsigned int inputSocketindex)
const NodeOperationFlags get_flags() const
unsigned int getNumberOfInputSockets() const
virtual void deinitExecution()
void addOutputSocket(DataType datatype)
unsigned int getWidth() const
void setResolutionInputSocketIndex(unsigned int index)
set the index of the input socket that will determine the resolution of this operation
virtual void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2])
determine the resolution of this node
SocketReader * getInputSocketReader(unsigned int inputSocketindex)
NodeOperationOutput * getOutputSocket(unsigned int index=0)
const std::string get_name() const
virtual bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output)
void setResolution(unsigned int resolution[2])
set the resolution
MemoryProxy * getMemoryProxy() const
NodeOperation to write to a tile.
DataType
possible data types for sockets
ResizeMode
Resize modes of inputsockets How are the input and working resolutions matched.
static constexpr unsigned int RESOLUTION_INPUT_ANY
std::ostream & operator<<(std::ostream &os, const eCompositorPriority &priority)
bool is_write_buffer_operation
bool use_datatype_conversion
bool is_preview_operation
bool is_read_buffer_operation