Blender  V3.3
COM_GlareBaseOperation.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 
7 #include "DNA_node_types.h"
8 
9 namespace blender::compositor {
10 
11 /* Utility functions used by glare, tone-map and lens distortion. */
12 /* Some macros for color handling. */
13 typedef float fRGB[4];
14 
15 /* TODO: replace with BLI_math_vector. */
16 /* multiply c2 by color rgb, rgb as separate arguments */
17 #define fRGB_rgbmult(c, r, g, b) \
18  { \
19  c[0] *= (r); \
20  c[1] *= (g); \
21  c[2] *= (b); \
22  } \
23  (void)0
24 
26  private:
30  SocketReader *input_program_;
31 
35  NodeGlare *settings_;
36 
37  bool is_output_rendered_;
38 
39  public:
43  void init_execution() override;
44 
48  void deinit_execution() override;
49 
50  void set_glare_settings(NodeGlare *settings)
51  {
52  settings_ = settings;
53  }
55  ReadBufferOperation *read_operation,
56  rcti *output) override;
57 
58  void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) final;
59 
61  const rcti &area,
63 
64  protected:
66 
67  virtual void generate_glare(float *data, MemoryBuffer *input_tile, NodeGlare *settings) = 0;
68 
69  MemoryBuffer *create_memory_buffer(rcti *rect) override;
70 };
71 
72 } // namespace blender::compositor
virtual void generate_glare(float *data, MemoryBuffer *input_tile, NodeGlare *settings)=0
bool determine_depending_area_of_interest(rcti *input, ReadBufferOperation *read_operation, rcti *output) override
void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) final
Get input operation area being read by this operation on rendering given output area.
void update_memory_buffer(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) final
MemoryBuffer * create_memory_buffer(rcti *rect) override
a MemoryBuffer contains access to the data of a chunk
NodeOperation contains calculation logic.
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[]