Cycles: Added Cryptomatte output.
[blender.git] / intern / cycles / render / coverage.h
1 /*
2  * Copyright 2018 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 #include "render/buffers.h"
18 #include "kernel/kernel_compat_cpu.h"
19 #include "kernel/split/kernel_split_data.h"
20 #include "kernel/kernel_globals.h"
21 #include "util/util_map.h"
22 #include "util/util_vector.h"
23
24 #ifndef __COVERAGE_H__
25 #define __COVERAGE_H__
26
27 CCL_NAMESPACE_BEGIN
28
29 class Coverage {
30 public:
31         Coverage(KernelGlobals *kg_, RenderTile &tile_) : kg(kg_), tile(tile_) { }
32         void init_path_trace();
33         void init_pixel(int x, int y);
34         void finalize();
35 private:
36         vector<CoverageMap>coverage_object;
37         vector<CoverageMap>coverage_material;
38         vector<CoverageMap>coverage_asset;
39         KernelGlobals *kg;
40         RenderTile &tile;
41         void finalize_buffer(vector<CoverageMap>&coverage, const int pass_offset);
42         void flatten_buffer(vector<CoverageMap>&coverage, const int pass_offset);
43         void sort_buffer(const int pass_offset);
44 };
45
46
47 CCL_NAMESPACE_END
48
49 #endif /* __COVERAGE_H__ */