Wayverb
postprocess.h
1 #pragma once
2 
3 #include "raytracer/attenuator.h"
4 #include "raytracer/cl/structs.h"
5 #include "raytracer/histogram.h"
6 
7 #include "core/attenuator/hrtf.h"
8 #include "core/attenuator/microphone.h"
9 #include "core/cl/common.h"
10 #include "core/cl/traits.h"
11 #include "core/cl/iterator.h"
12 #include "core/mixdown.h"
13 #include "core/pressure_intensity.h"
14 #include "core/scene_data.h"
15 
16 #include "utilities/map_to_vector.h"
17 
18 namespace wayverb {
19 namespace raytracer {
20 namespace image_source {
21 
22 template <typename InputIt, typename Method>
23 auto postprocess(InputIt b,
24  InputIt e,
25  const Method& method,
26  const glm::vec3& position,
27  double speed_of_sound,
28  double sample_rate) {
29  const auto make_iterator = [&](auto it) {
30  return make_histogram_iterator(
31  make_attenuator_iterator(std::move(it), method, position),
32  speed_of_sound);
33  };
34  auto hist = histogram(make_iterator(b),
35  make_iterator(e),
36  sample_rate,
37  sinc_sum_functor{});
38  return core::multiband_filter_and_mixdown(
39  begin(hist), end(hist), sample_rate, [](auto it, auto index) {
40  return core::make_cl_type_iterator(std::move(it), index);
41  });
42 }
43 
44 } // namespace image_source
45 } // namespace raytracer
46 } // namespace wayverb
Definition: pressure.h:22
Definition: capsule_base.h:9