Blender  V3.3
COM_TranslateOperation.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 
8 
9 namespace blender::compositor {
10 
12  protected:
13  static constexpr int IMAGE_INPUT_INDEX = 0;
14  static constexpr int X_INPUT_INDEX = 1;
15  static constexpr int Y_INPUT_INDEX = 2;
16 
17  private:
18  SocketReader *input_operation_;
19  SocketReader *input_xoperation_;
20  SocketReader *input_yoperation_;
21  float delta_x_;
22  float delta_y_;
23  bool is_delta_set_;
24  float factor_x_;
25  float factor_y_;
26 
27  protected:
30 
31  public:
35  ReadBufferOperation *read_operation,
36  rcti *output) override;
37  void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override;
38 
39  void init_execution() override;
40  void deinit_execution() override;
41 
42  float getDeltaX()
43  {
44  return delta_x_ * factor_x_;
45  }
46  float getDeltaY()
47  {
48  return delta_y_ * factor_y_;
49  }
50 
51  inline void ensure_delta()
52  {
53  if (!is_delta_set_) {
55  float temp_delta[4];
56  input_xoperation_->read_sampled(temp_delta, 0, 0, PixelSampler::Nearest);
57  delta_x_ = temp_delta[0];
58  input_yoperation_->read_sampled(temp_delta, 0, 0, PixelSampler::Nearest);
59  delta_y_ = temp_delta[0];
60  }
61  else {
64  }
65 
66  is_delta_set_ = true;
67  }
68  }
69 
70  void setFactorXY(float factorX, float factorY);
71  void set_wrapping(int wrapping_type);
72 
73  void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override;
74 
76  const rcti &area,
77  Span<MemoryBuffer *> inputs) override;
78 };
79 
81  public:
83  void determine_canvas(const rcti &preferred_area, rcti &r_area) override;
84 };
85 
86 } // 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
a MemoryBuffer contains access to the data of a chunk
NodeOperation contains calculation logic.
float get_constant_value_default(float default_value)
NodeOperation * get_input_operation(int index)
void read_sampled(float result[4], float x, float y, PixelSampler sampler)
void determine_canvas(const rcti &preferred_area, rcti &r_area) override
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void execute_pixel_sampled(float output[4], float x, float y, PixelSampler sampler) override
calculate a single pixel
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) override
Get input operation area being read by this operation on rendering given output area.
void setFactorXY(float factorX, float factorY)
depth_tx sampler(1, ImageType::FLOAT_2D, "combined_tx") .sampler(2
DataType
possible data types for sockets
Definition: COM_defines.h:30
ResizeMode
Resize modes of inputsockets How are the input and working resolutions matched.
@ Center
Center the input image to the center of the working area of the node, no resizing occurs.
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_global KernelShaderEvalInput * input
static void area(int d1, int d2, int e1, int e2, float weights[2])
static bNodeSocketTemplate inputs[]