Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_BoxMaskOperation.h
| Show All 12 Lines | |||||
| * along with this program; if not, write to the Free Software Foundation, | * along with this program; if not, write to the Free Software Foundation, | ||||
| * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
| * | * | ||||
| * Copyright 2011, Blender Foundation. | * Copyright 2011, Blender Foundation. | ||||
| */ | */ | ||||
| #pragma once | #pragma once | ||||
| #include "COM_NodeOperation.h" | #include "COM_MultiThreadedOperation.h" | ||||
| namespace blender::compositor { | namespace blender::compositor { | ||||
| class BoxMaskOperation : public NodeOperation { | class BoxMaskOperation : public MultiThreadedOperation { | ||||
| private: | private: | ||||
| using MaskFunc = std::function<float(bool is_inside, const float *mask, const float *value)>; | |||||
| /** | /** | ||||
| * Cached reference to the inputProgram | * Cached reference to the inputProgram | ||||
| */ | */ | ||||
| SocketReader *m_inputMask; | SocketReader *m_inputMask; | ||||
| SocketReader *m_inputValue; | SocketReader *m_inputValue; | ||||
| float m_sine; | float m_sine; | ||||
| float m_cosine; | float m_cosine; | ||||
| Show All 24 Lines | public: | ||||
| { | { | ||||
| this->m_data = data; | this->m_data = data; | ||||
| } | } | ||||
| void setMaskType(int maskType) | void setMaskType(int maskType) | ||||
| { | { | ||||
| this->m_maskType = maskType; | this->m_maskType = maskType; | ||||
| } | } | ||||
| void update_memory_buffer_partial(MemoryBuffer *output, | |||||
| const rcti &area, | |||||
| Span<MemoryBuffer *> inputs) override; | |||||
| private: | |||||
| void apply_mask(MemoryBuffer *output, | |||||
| const rcti &area, | |||||
| Span<MemoryBuffer *> inputs, | |||||
| MaskFunc mask_func); | |||||
| }; | }; | ||||
| } // namespace blender::compositor | } // namespace blender::compositor | ||||