film.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. #ifndef __FILM_H__
  17. #define __FILM_H__
  18. #include "util/util_string.h"
  19. #include "util/util_vector.h"
  20. #include "kernel/kernel_types.h"
  21. #include "graph/node.h"
  22. CCL_NAMESPACE_BEGIN
  23. class Device;
  24. class DeviceScene;
  25. class Scene;
  26. typedef enum FilterType {
  27. FILTER_BOX,
  28. FILTER_GAUSSIAN,
  29. FILTER_BLACKMAN_HARRIS,
  30. FILTER_NUM_TYPES,
  31. } FilterType;
  32. class Pass {
  33. public:
  34. PassType type;
  35. int components;
  36. bool filter;
  37. bool exposure;
  38. PassType divide_type;
  39. string name;
  40. static void add(PassType type, vector<Pass> &passes, const char *name = NULL);
  41. static bool equals(const vector<Pass> &A, const vector<Pass> &B);
  42. static bool contains(const vector<Pass> &passes, PassType);
  43. };
  44. class Film : public Node {
  45. public:
  46. NODE_DECLARE
  47. float exposure;
  48. vector<Pass> passes;
  49. bool denoising_data_pass;
  50. bool denoising_clean_pass;
  51. bool denoising_prefiltered_pass;
  52. int denoising_flags;
  53. float pass_alpha_threshold;
  54. int pass_stride;
  55. int denoising_data_offset;
  56. int denoising_clean_offset;
  57. FilterType filter_type;
  58. float filter_width;
  59. size_t filter_table_offset;
  60. float mist_start;
  61. float mist_depth;
  62. float mist_falloff;
  63. bool use_light_visibility;
  64. bool use_sample_clamp;
  65. CryptomatteType cryptomatte_passes;
  66. int cryptomatte_depth;
  67. bool need_update;
  68. Film();
  69. ~Film();
  70. void device_update(Device *device, DeviceScene *dscene, Scene *scene);
  71. void device_free(Device *device, DeviceScene *dscene, Scene *scene);
  72. bool modified(const Film &film);
  73. void tag_passes_update(Scene *scene, const vector<Pass> &passes_);
  74. void tag_update(Scene *scene);
  75. };
  76. CCL_NAMESPACE_END
  77. #endif /* __FILM_H__ */