Blender V4.5
COM_distortion_grid.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
10#include "BLI_array.hh"
11#include "BLI_map.hh"
13
14#include "DNA_movieclip_types.h"
15
17#include "COM_result.hh"
18
19namespace blender::compositor {
20
21class Context;
22
23enum class DistortionType : uint8_t {
26};
27
28/* ------------------------------------------------------------------------------------------------
29 * Distortion Grid Key.
30 */
45
46bool operator==(const DistortionGridKey &a, const DistortionGridKey &b);
47
48/* -------------------------------------------------------------------------------------------------
49 * Distortion Grid.
50 *
51 * A cached resource that computes and caches a result containing the normalized coordinates after
52 * applying the camera distortion of a given movie clip tracking camera. See the constructor for
53 * more information. */
55 private:
56 Array<float2> distortion_grid_;
57
58 public:
60
61 /* The calibration size is the size of the image where the tracking camera was calibrated, this
62 * is the size of the movie clip in most cases. */
63 DistortionGrid(Context &context,
64 MovieClip *movie_clip,
65 int2 size,
66 DistortionType type,
67 int2 calibration_size);
68
70};
71
72/* ------------------------------------------------------------------------------------------------
73 * Distortion Grid Container.
74 */
76 private:
78
79 public:
80 void reset() override;
81
82 /* Check if there is an available DistortionGrid cached resource with the given parameters in the
83 * container, if one exists, return it, otherwise, return a newly created one and add it to the
84 * container. In both cases, tag the cached resource as needed to keep it cached for the next
85 * evaluation. */
86 Result &get(
87 Context &context, MovieClip *movie_clip, int2 size, DistortionType type, int frame_number);
88};
89
90} // namespace blender::compositor
unsigned long long int uint64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
Result & get(Context &context, MovieClip *movie_clip, int2 size, DistortionType type, int frame_number)
DistortionGridKey(const MovieTrackingCamera &camera, int2 size, DistortionType type, int2 calibration_size)
DistortionGrid(Context &context, MovieClip *movie_clip, int2 size, DistortionType type, int2 calibration_size)
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
VecBase< int32_t, 2 > int2