Changeset View
Changeset View
Standalone View
Standalone View
source/blender/compositor/operations/COM_TextureOperation.h
| Show All 13 Lines | |||||
| * 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 "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "COM_NodeOperation.h" | #include "COM_MultiThreadedOperation.h" | ||||
| #include "DNA_texture_types.h" | #include "DNA_texture_types.h" | ||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| #include "RE_pipeline.h" | #include "RE_pipeline.h" | ||||
| #include "RE_texture.h" | #include "RE_texture.h" | ||||
| namespace blender::compositor { | namespace blender::compositor { | ||||
| /** | /** | ||||
| * Base class for all renderlayeroperations | * Base class for all renderlayeroperations | ||||
| * | * | ||||
| * \todo Rename to operation. | * \todo Rename to operation. | ||||
| */ | */ | ||||
| class TextureBaseOperation : public NodeOperation { | class TextureBaseOperation : public MultiThreadedOperation { | ||||
| private: | private: | ||||
| Tex *m_texture; | Tex *m_texture; | ||||
| const RenderData *m_rd; | const RenderData *m_rd; | ||||
| SocketReader *m_inputSize; | SocketReader *m_inputSize; | ||||
| SocketReader *m_inputOffset; | SocketReader *m_inputOffset; | ||||
| struct ImagePool *m_pool; | struct ImagePool *m_pool; | ||||
| bool m_sceneColorManage; | bool m_sceneColorManage; | ||||
| Show All 21 Lines | public: | ||||
| void setRenderData(const RenderData *rd) | void setRenderData(const RenderData *rd) | ||||
| { | { | ||||
| this->m_rd = rd; | this->m_rd = rd; | ||||
| } | } | ||||
| void setSceneColorManage(bool sceneColorManage) | void setSceneColorManage(bool sceneColorManage) | ||||
| { | { | ||||
| this->m_sceneColorManage = sceneColorManage; | this->m_sceneColorManage = sceneColorManage; | ||||
| } | } | ||||
| void update_memory_buffer_partial(MemoryBuffer *output, | |||||
| const rcti &area, | |||||
| Span<MemoryBuffer *> inputs) override; | |||||
| }; | }; | ||||
| class TextureOperation : public TextureBaseOperation { | class TextureOperation : public TextureBaseOperation { | ||||
| public: | public: | ||||
| TextureOperation(); | TextureOperation(); | ||||
| }; | }; | ||||
| class TextureAlphaOperation : public TextureBaseOperation { | class TextureAlphaOperation : public TextureBaseOperation { | ||||
| public: | public: | ||||
| TextureAlphaOperation(); | TextureAlphaOperation(); | ||||
| void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override; | void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override; | ||||
| void update_memory_buffer_partial(MemoryBuffer *output, | |||||
| const rcti &area, | |||||
| Span<MemoryBuffer *> inputs) override; | |||||
| }; | }; | ||||
| } // namespace blender::compositor | } // namespace blender::compositor | ||||