Blender V5.3
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
25
26/* ------------------------------------------------------------------------------------------------
27 * Image Coordinates Key.
28 */
30 public:
35
36 ImageCoordinatesKey(const Domain &domain, const CoordinatesType type);
37
38 uint64_t hash() const;
39};
40
42
43/* -------------------------------------------------------------------------------------------------
44 * Image Coordinates.
45 *
46 * A cached resource that computes and caches a result containing the coordinates of the pixels of
47 * an image with the given domain. The transformations of the domain are ignored to improve cache
48 * hits, the caller is expected to restore the transformation if needed. */
50 public:
52
53 ImageCoordinates(Context &context, const Domain &domain, const CoordinatesType type);
54
56
57 private:
58 void compute_gpu(Context &context, const CoordinatesType type);
59
60 void compute_cpu(const CoordinatesType type);
61};
62
63/* ------------------------------------------------------------------------------------------------
64 * Image Coordinates Container.
65 */
67 private:
69
70 public:
71 void reset() override;
72
73 /* Check if there is an available ImageCoordinates cached resource with the given parameters in
74 * the container, if one exists, return it, otherwise, return a newly created one and add it to
75 * the container. In both cases, tag the cached resource as needed to keep it cached for the next
76 * evaluation. */
77 Result &get(Context &context, const Domain &domain, const CoordinatesType type);
78};
79
80} // namespace blender::compositor
Result & get(Context &context, const Domain &domain, const CoordinatesType type)
ImageCoordinatesKey(const Domain &domain, const CoordinatesType type)
ImageCoordinates(Context &context, const Domain &domain, const CoordinatesType type)
bool operator==(const BokehKernelKey &a, const BokehKernelKey &b)
unsigned __int64 uint64_t
Definition BKE_text.h:91
unsigned char uint8_t
Definition BKE_text.h:79