Blender  V3.3
COM_RenderLayersProg.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
4 #pragma once
5 
6 #include "BLI_listbase.h"
7 #include "BLI_utildefines.h"
9 #include "DNA_scene_types.h"
10 #include "MEM_guardedalloc.h"
11 
12 #include "RE_pipeline.h"
13 
14 namespace blender::compositor {
15 
22  protected:
27 
31  short layer_id_;
32 
36  const char *view_name_;
37 
39 
44  float *input_buffer_;
45 
49  std::string pass_name_;
50 
52 
56  const RenderData *rd_;
57 
61  void determine_canvas(const rcti &preferred_area, rcti &r_area) override;
62 
66  inline float *get_input_buffer()
67  {
68  return input_buffer_;
69  }
70 
71  void do_interpolation(float output[4], float x, float y, PixelSampler sampler);
72 
73  public:
77  RenderLayersProg(const char *pass_name, DataType type, int elementsize);
84  {
85  scene_ = scene;
86  }
87  Scene *get_scene() const
88  {
89  return scene_;
90  }
91  void set_render_data(const RenderData *rd)
92  {
93  rd_ = rd;
94  }
95  void set_layer_id(short layer_id)
96  {
97  layer_id_ = layer_id;
98  }
99  short get_layer_id() const
100  {
101  return layer_id_;
102  }
103  void set_view_name(const char *view_name)
104  {
105  view_name_ = view_name;
106  }
107  const char *get_view_name()
108  {
109  return view_name_;
110  }
111  void init_execution() override;
112  void deinit_execution() override;
113  void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override;
114 
115  std::unique_ptr<MetaData> get_meta_data() override;
116 
118  const rcti &area,
119  Span<MemoryBuffer *> inputs) override;
120 };
121 
123  public:
124  RenderLayersAOOperation(const char *pass_name, DataType type, int elementsize)
125  : RenderLayersProg(pass_name, type, elementsize)
126  {
127  }
128  void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override;
129 
131  const rcti &area,
132  Span<MemoryBuffer *> inputs) override;
133 };
134 
136  public:
137  RenderLayersAlphaProg(const char *pass_name, DataType type, int elementsize)
138  : RenderLayersProg(pass_name, type, elementsize)
139  {
140  }
141  void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override;
142 
144  const rcti &area,
145  Span<MemoryBuffer *> inputs) override;
146 };
147 
149  public:
150  RenderLayersDepthProg(const char *pass_name, DataType type, int elementsize)
151  : RenderLayersProg(pass_name, type, elementsize)
152  {
153  }
154  void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override;
155 
157  const rcti &area,
158  Span<MemoryBuffer *> inputs) override;
159 };
160 
161 } // 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
_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
Read Guarded memory(de)allocation.
a MemoryBuffer contains access to the data of a chunk
RenderLayersAOOperation(const char *pass_name, DataType type, int elementsize)
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
RenderLayersAlphaProg(const char *pass_name, DataType type, int elementsize)
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
RenderLayersDepthProg(const char *pass_name, DataType type, int elementsize)
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
RenderLayersProg(const char *pass_name, DataType type, int elementsize)
std::unique_ptr< MetaData > get_meta_data() override
const RenderData * rd_
render data used for active rendering
void set_view_name(const char *view_name)
virtual void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
void determine_canvas(const rcti &preferred_area, rcti &r_area) override
void set_render_data(const RenderData *rd)
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void do_interpolation(float output[4], float x, float y, PixelSampler sampler)
Scene scene
depth_tx sampler(1, ImageType::FLOAT_2D, "combined_tx") .sampler(2
DataType
possible data types for sockets
Definition: COM_defines.h:30
ccl_global KernelShaderEvalInput ccl_global float * output
static void area(int d1, int d2, int e1, int e2, float weights[2])
static bNodeSocketTemplate inputs[]