Blender  V2.93
film.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2013 Blender Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef __FILM_H__
18 #define __FILM_H__
19 
20 #include "util/util_string.h"
21 #include "util/util_vector.h"
22 
23 #include "kernel/kernel_types.h"
24 
25 #include "graph/node.h"
26 
28 
29 class Device;
30 class DeviceScene;
31 class Scene;
32 
33 typedef enum FilterType {
37 
40 
41 class Pass : public Node {
42  public:
44 
45  Pass();
46 
49  bool filter;
50  bool exposure;
52  ustring name;
53 
54  static void add(PassType type, vector<Pass> &passes, const char *name = NULL);
55  static bool equals(const vector<Pass> &A, const vector<Pass> &B);
56  static bool contains(const vector<Pass> &passes, PassType);
57 };
58 
59 class Film : public Node {
60  public:
62 
63  NODE_SOCKET_API(float, exposure)
64  NODE_SOCKET_API(bool, denoising_data_pass)
65  NODE_SOCKET_API(bool, denoising_clean_pass)
66  NODE_SOCKET_API(bool, denoising_prefiltered_pass)
67  NODE_SOCKET_API(int, denoising_flags)
68  NODE_SOCKET_API(float, pass_alpha_threshold)
69 
70  NODE_SOCKET_API(PassType, display_pass)
71 
72  NODE_SOCKET_API(FilterType, filter_type)
73  NODE_SOCKET_API(float, filter_width)
74 
75  NODE_SOCKET_API(float, mist_start)
76  NODE_SOCKET_API(float, mist_depth)
77  NODE_SOCKET_API(float, mist_falloff)
78 
79  NODE_SOCKET_API(bool, use_light_visibility)
80  NODE_SOCKET_API(CryptomatteType, cryptomatte_passes)
81  NODE_SOCKET_API(int, cryptomatte_depth)
82 
83  NODE_SOCKET_API(bool, use_adaptive_sampling)
84 
85  private:
86  int pass_stride;
87  int denoising_data_offset;
88  int denoising_clean_offset;
89  size_t filter_table_offset;
90 
91  public:
92  Film();
93  ~Film();
94 
95  /* add default passes to scene */
96  static void add_default(Scene *scene);
97 
98  void device_update(Device *device, DeviceScene *dscene, Scene *scene);
99  void device_free(Device *device, DeviceScene *dscene, Scene *scene);
100 
101  void tag_passes_update(Scene *scene, const vector<Pass> &passes_, bool update_passes = true);
102 
103  int get_aov_offset(Scene *scene, string name, bool &is_color);
104 
105  int get_pass_stride() const;
106  int get_denoising_data_offset() const;
107  int get_denoising_clean_offset() const;
108  size_t get_filter_table_offset() const;
109 };
110 
112 
113 #endif /* __FILM_H__ */
#define A
Definition: device.h:293
Definition: film.h:59
int get_denoising_data_offset() const
Definition: film.cpp:736
int get_pass_stride() const
Definition: film.cpp:731
int get_aov_offset(Scene *scene, string name, bool &is_color)
Definition: film.cpp:708
~Film()
Definition: film.cpp:418
static void add_default(Scene *scene)
Definition: film.cpp:422
size_t get_filter_table_offset() const
Definition: film.cpp:746
void device_free(Device *device, DeviceScene *dscene, Scene *scene)
Definition: film.cpp:683
void device_update(Device *device, DeviceScene *dscene, Scene *scene)
Definition: film.cpp:427
int get_denoising_clean_offset() const
Definition: film.cpp:741
Film()
Definition: film.cpp:410
void tag_passes_update(Scene *scene, const vector< Pass > &passes_, bool update_passes=true)
Definition: film.cpp:688
Definition: film.h:41
PassType divide_type
Definition: film.h:51
NODE_DECLARE Pass()
Definition: film.cpp:99
ustring name
Definition: film.h:52
static bool contains(const vector< Pass > &passes, PassType)
Definition: film.cpp:295
PassType type
Definition: film.h:47
bool filter
Definition: film.h:49
int components
Definition: film.h:48
static bool equals(const vector< Pass > &A, const vector< Pass > &B)
Definition: film.cpp:283
bool exposure
Definition: film.h:50
static void add(PassType type, vector< Pass > &passes, const char *name=NULL)
Definition: film.cpp:103
Scene scene
FilterType
Definition: film.h:33
@ FILTER_NUM_TYPES
Definition: film.h:38
@ FILTER_BOX
Definition: film.h:34
@ FILTER_BLACKMAN_HARRIS
Definition: film.h:36
@ FILTER_GAUSSIAN
Definition: film.h:35
#define CCL_NAMESPACE_END
CryptomatteType
Definition: kernel_types.h:400
PassType
Definition: kernel_types.h:347
#define B
#define NODE_SOCKET_API(type_, name)
Definition: node.h:63
#define NODE_DECLARE
Definition: node_type.h:148
Definition: node.h:98
ustring name
Definition: node.h:174