Blender  V2.93
COM_ReadBufferOperation.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_MemoryBuffer.h"
22 #include "COM_MemoryProxy.h"
23 #include "COM_NodeOperation.h"
24 
25 namespace blender::compositor {
26 
28  private:
29  MemoryProxy *m_memoryProxy;
30  bool m_single_value; /* single value stored in buffer, copied from associated write operation */
31  unsigned int m_offset;
32  MemoryBuffer *m_buffer;
33 
34  public:
35  ReadBufferOperation(DataType datatype);
36  void setMemoryProxy(MemoryProxy *memoryProxy)
37  {
38  this->m_memoryProxy = memoryProxy;
39  }
40 
42  {
43  return this->m_memoryProxy;
44  }
45 
46  void determineResolution(unsigned int resolution[2],
47  unsigned int preferredResolution[2]) override;
48 
49  void *initializeTileData(rcti *rect) override;
50  void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override;
51  void executePixelExtend(float output[4],
52  float x,
53  float y,
54  PixelSampler sampler,
55  MemoryBufferExtend extend_x,
56  MemoryBufferExtend extend_y);
57  void executePixelFiltered(float output[4], float x, float y, float dx[2], float dy[2]) override;
58  void setOffset(unsigned int offset)
59  {
60  this->m_offset = offset;
61  }
62  unsigned int getOffset() const
63  {
64  return this->m_offset;
65  }
67  ReadBufferOperation *readOperation,
68  rcti *output) override;
69  MemoryBuffer *getInputMemoryBuffer(MemoryBuffer **memoryBuffers) override
70  {
71  return memoryBuffers[this->m_offset];
72  }
74  void updateMemoryBuffer();
75 };
76 
77 } // 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 y
#define output
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...
NodeOperation contains calculation logic.
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]) override
determine the resolution of this node
void setMemoryProxy(MemoryProxy *memoryProxy)
void executePixelExtend(float output[4], float x, float y, PixelSampler sampler, MemoryBufferExtend extend_x, MemoryBufferExtend extend_y)
void executePixelFiltered(float output[4], float x, float y, float dx[2], float dy[2]) override
calculate a single pixel using an EWA filter
void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
MemoryBuffer * getInputMemoryBuffer(MemoryBuffer **memoryBuffers) override
DataType
possible data types for sockets
Definition: COM_defines.h:27