Blender V4.3
COM_keying_screen.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include <cstdint>
8#include <memory>
9#include <string>
10
11#include "BLI_map.hh"
13
14#include "GPU_shader.hh"
15#include "GPU_texture.hh"
16
17#include "DNA_movieclip_types.h"
18#include "DNA_tracking_types.h"
19
21
23
24class Context;
25
26/* ------------------------------------------------------------------------------------------------
27 * Keying Screen Key.
28 */
30 public:
33
34 KeyingScreenKey(int frame, float smoothness);
35
36 uint64_t hash() const;
37};
38
39bool operator==(const KeyingScreenKey &a, const KeyingScreenKey &b);
40
41/* -------------------------------------------------------------------------------------------------
42 * Keying Screen.
43 *
44 * A cached resource that computes and caches a GPU texture containing the keying screen computed
45 * by interpolating the markers of the given movie tracking object in the given movie clip. */
47 private:
48 GPUTexture *texture_ = nullptr;
49
50 public:
51 KeyingScreen(Context &context,
52 MovieClip *movie_clip,
53 MovieTrackingObject *movie_tracking_object,
54 float smoothness);
55
57
58 void bind_as_texture(GPUShader *shader, const char *texture_name) const;
59
60 void unbind_as_texture() const;
61
62 GPUTexture *texture() const;
63};
64
65/* ------------------------------------------------------------------------------------------------
66 * Keying Screen Container.
67 */
69 private:
71
72 public:
73 void reset() override;
74
75 /* Check if the given movie clip ID has changed since the last time it was retrieved through its
76 * recalculate flag, and if so, invalidate its corresponding cached keying screens and reset the
77 * recalculate flag to ready it to track the next change. Then, check if there is an available
78 * KeyingScreen cached resource with the given parameters in the container, if one exists, return
79 * it, otherwise, return a newly created one and add it to the container. In both cases, tag the
80 * cached resource as needed to keep it cached for the next evaluation. */
81 KeyingScreen &get(Context &context,
82 MovieClip *movie_clip,
83 MovieTrackingObject *movie_tracking_object,
84 float smoothness);
85};
86
87} // namespace blender::realtime_compositor
struct GPUShader GPUShader
KeyingScreen & get(Context &context, MovieClip *movie_clip, MovieTrackingObject *movie_tracking_object, float smoothness)
KeyingScreenKey(int frame, float smoothness)
KeyingScreen(Context &context, MovieClip *movie_clip, MovieTrackingObject *movie_tracking_object, float smoothness)
void bind_as_texture(GPUShader *shader, const char *texture_name) const
local_group_size(16, 16) .push_constant(Type b
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
unsigned __int64 uint64_t
Definition stdint.h:90