Blender V5.0
COM_image_coordinates.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 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
14#include "COM_result.hh"
15
16namespace blender::compositor {
17
18class Context;
19
20enum class CoordinatesType : uint8_t {
24};
25
26/* ------------------------------------------------------------------------------------------------
27 * Image Coordinates Key.
28 */
38
40
41/* -------------------------------------------------------------------------------------------------
42 * Image Coordinates.
43 *
44 * A cached resource that computes and caches a result containing the coordinates of the pixels of
45 * an image with the given size. */
47 public:
49
50 ImageCoordinates(Context &context, const int2 &size, const CoordinatesType type);
51
53
54 private:
55 void compute_gpu(Context &context, const CoordinatesType type);
56
57 void compute_cpu(const CoordinatesType type);
58};
59
60/* ------------------------------------------------------------------------------------------------
61 * Image Coordinates Container.
62 */
64 private:
66
67 public:
68 void reset() override;
69
70 /* Check if there is an available ImageCoordinates cached resource with the given parameters in
71 * the container, if one exists, return it, otherwise, return a newly created one and add it to
72 * the container. In both cases, tag the cached resource as needed to keep it cached for the next
73 * evaluation. */
74 Result &get(Context &context, const int2 &size, const CoordinatesType type);
75};
76
77} // 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, const int2 &size, const CoordinatesType type)
ImageCoordinatesKey(const int2 &size, const CoordinatesType type)
ImageCoordinates(Context &context, const int2 &size, const CoordinatesType type)
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
VecBase< int32_t, 2 > int2