Blender V4.3
COM_GlareBaseOperation.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include "COM_NodeOperation.h"
8#include "DNA_node_types.h"
9
10namespace blender::compositor {
11
12/* Utility functions used by glare, tone-map and lens distortion. */
13/* Some macros for color handling. */
14typedef float fRGB[4];
15
16/* TODO: replace with BLI_math_vector. */
17/* multiply c2 by color rgb, rgb as separate arguments */
18#define fRGB_rgbmult(c, r, g, b) \
19 { \
20 c[0] *= (r); \
21 c[1] *= (g); \
22 c[2] *= (b); \
23 } \
24 (void)0
25
27 private:
31 const NodeGlare *settings_;
32
33 bool is_output_rendered_;
34
35 public:
36 void set_glare_settings(const NodeGlare *settings)
37 {
38 settings_ = settings;
39 }
40
41 void get_area_of_interest(int input_idx, const rcti &output_area, rcti &r_input_area) final;
42
44 const rcti &area,
45 Span<MemoryBuffer *> inputs) final;
46
47 protected:
49
50 virtual void generate_glare(float *data,
51 MemoryBuffer *input_tile,
52 const NodeGlare *settings) = 0;
53};
54
55} // namespace blender::compositor
void set_glare_settings(const NodeGlare *settings)
virtual void generate_glare(float *data, MemoryBuffer *input_tile, const NodeGlare *settings)=0
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
a MemoryBuffer contains access to the data
NodeOperation contains calculation logic.