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 27 CCL_NAMESPACE_BEGIN 28 29 class Device; 30 class DeviceScene; 31 class Scene; 32 33 typedef enum FilterType { 34 FILTER_BOX, 35 FILTER_GAUSSIAN, 36 FILTER_BLACKMAN_HARRIS, 37 38 FILTER_NUM_TYPES, 39 } FilterType; 40 41 class Pass : public Node { 42 public: 43 NODE_DECLARE 44 45 Pass(); 46 47 PassType type; 48 int components; 49 bool filter; 50 bool exposure; 51 PassType divide_type; 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: 61 NODE_DECLARE 62 63 float exposure; 64 bool denoising_data_pass; 65 bool denoising_clean_pass; 66 bool denoising_prefiltered_pass; 67 int denoising_flags; 68 float pass_alpha_threshold; 69 70 PassType display_pass; 71 int pass_stride; 72 int denoising_data_offset; 73 int denoising_clean_offset; 74 75 FilterType filter_type; 76 float filter_width; 77 size_t filter_table_offset; 78 79 float mist_start; 80 float mist_depth; 81 float mist_falloff; 82 83 bool use_light_visibility; 84 CryptomatteType cryptomatte_passes; 85 int cryptomatte_depth; 86 87 bool use_adaptive_sampling; 88 89 bool need_update; 90 91 Film(); 92 ~Film(); 93 94 /* add default passes to scene */ 95 static void add_default(Scene *scene); 96 97 void device_update(Device *device, DeviceScene *dscene, Scene *scene); 98 void device_free(Device *device, DeviceScene *dscene, Scene *scene); 99 100 bool modified(const Film &film); 101 void tag_passes_update(Scene *scene, const vector<Pass> &passes_, bool update_passes = true); 102 void tag_update(Scene *scene); 103 104 int get_aov_offset(Scene *scene, string name, bool &is_color); 105 }; 106 107 CCL_NAMESPACE_END 108 109 #endif /* __FILM_H__ */ 110