Blender  V2.93
COM_GlareBaseOperation.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 
22 #include "DNA_node_types.h"
23 
24 namespace blender::compositor {
25 
26 /* utility functions used by glare, tonemap and lens distortion */
27 /* soms macros for color handling */
28 typedef float fRGB[4];
29 
30 /* TODO - replace with BLI_math_vector */
31 /* multiply c2 by color rgb, rgb as separate arguments */
32 #define fRGB_rgbmult(c, r, g, b) \
33  { \
34  c[0] *= (r); \
35  c[1] *= (g); \
36  c[2] *= (b); \
37  } \
38  (void)0
39 
41  private:
45  SocketReader *m_inputProgram;
46 
50  NodeGlare *m_settings;
51 
52  public:
56  void initExecution() override;
57 
61  void deinitExecution() override;
62 
63  void setGlareSettings(NodeGlare *settings)
64  {
65  this->m_settings = settings;
66  }
68  ReadBufferOperation *readOperation,
69  rcti *output) override;
70 
71  protected:
73 
74  virtual void generateGlare(float *data, MemoryBuffer *inputTile, NodeGlare *settings) = 0;
75 
76  MemoryBuffer *createMemoryBuffer(rcti *rect) override;
77 };
78 
79 } // namespace blender::compositor
#define output
virtual void generateGlare(float *data, MemoryBuffer *inputTile, NodeGlare *settings)=0
bool determineDependingAreaOfInterest(rcti *input, ReadBufferOperation *readOperation, rcti *output) override
MemoryBuffer * createMemoryBuffer(rcti *rect) override
a MemoryBuffer contains access to the data of a chunk
NodeOperation contains calculation logic.