Blender  V2.93
COM_MemoryProxy.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * Copyright 2011, Blender Foundation.
17  */
18 
19 #pragma once
20 
21 #include "COM_defines.h"
22 
23 namespace blender::compositor {
24 
25 /* Forward declarations. */
26 class MemoryBuffer;
27 class ExecutionGroup;
28 class WriteBufferOperation;
29 
36 class MemoryProxy {
37  private:
41  WriteBufferOperation *m_writeBufferOperation;
42 
46  ExecutionGroup *m_executor;
47 
51  MemoryBuffer *m_buffer;
52 
56  DataType m_datatype;
57 
58  public:
60 
65  void setExecutor(ExecutionGroup *executor)
66  {
67  this->m_executor = executor;
68  }
69 
74  {
75  return this->m_executor;
76  }
77 
83  {
84  this->m_writeBufferOperation = operation;
85  }
86 
92  {
93  return this->m_writeBufferOperation;
94  }
95 
99  void allocate(unsigned int width, unsigned int height);
100 
104  void free();
105 
110  {
111  return this->m_buffer;
112  }
113 
115  {
116  return this->m_datatype;
117  }
118 
119 #ifdef WITH_CXX_GUARDEDALLOC
120  MEM_CXX_CLASS_ALLOC_FUNCS("COM:MemoryProxy")
121 #endif
122 };
123 
124 } // namespace blender::compositor
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
Class ExecutionGroup is a group of Operations that are executed as one. This grouping is used to comb...
a MemoryBuffer contains access to the data of a chunk
A MemoryProxy is a unique identifier for a memory buffer. A single MemoryProxy is used among all chun...
void free()
free the allocated memory
void setExecutor(ExecutionGroup *executor)
set the ExecutionGroup that can be scheduled to calculate a certain chunk.
ExecutionGroup * getExecutor() const
get the ExecutionGroup that can be scheduled to calculate a certain chunk.
MemoryBuffer * getBuffer()
get the allocated memory
void allocate(unsigned int width, unsigned int height)
allocate memory of size width x height
void setWriteBufferOperation(WriteBufferOperation *operation)
set the WriteBufferOperation that is responsible for writing to this MemoryProxy
WriteBufferOperation * getWriteBufferOperation() const
get the WriteBufferOperation that is responsible for writing to this MemoryProxy
DataType
possible data types for sockets
Definition: COM_defines.h:27