Blender V5.0
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_map.hh"
12
13#include "DNA_movieclip_types.h"
14
16#include "COM_result.hh"
17
18namespace blender::compositor {
19
20class Context;
21
22enum class DistortionType : uint8_t {
25};
26
27/* ------------------------------------------------------------------------------------------------
28 * Distortion Grid Key.
29 */
44
45bool operator==(const DistortionGridKey &a, const DistortionGridKey &b);
46
47/* -------------------------------------------------------------------------------------------------
48 * Distortion Grid.
49 *
50 * A cached resource that computes and caches a result containing the normalized coordinates after
51 * applying the camera distortion of a given movie clip tracking camera. See the constructor for
52 * more information. */
54 public:
56
57 /* The calibration size is the size of the image where the tracking camera was calibrated, this
58 * is the size of the movie clip in most cases. */
59 DistortionGrid(Context &context,
60 MovieClip *movie_clip,
61 int2 size,
62 DistortionType type,
63 int2 calibration_size);
64
66};
67
68/* ------------------------------------------------------------------------------------------------
69 * Distortion Grid Container.
70 */
72 private:
74
75 public:
76 void reset() override;
77
78 /* Check if there is an available DistortionGrid cached resource with the given parameters in the
79 * container, if one exists, return it, otherwise, return a newly created one and add it to the
80 * container. In both cases, tag the cached resource as needed to keep it cached for the next
81 * evaluation. */
82 Result &get(
83 Context &context, MovieClip *movie_clip, int2 size, DistortionType type, int frame_number);
84};
85
86} // 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