Blender V5.0
GEO_reverse_uv_sampler.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
8#include "BLI_span.hh"
9
10namespace blender::geometry {
11
18 public:
19 struct LookupGrid;
20
21 private:
22 Span<float2> uv_map_;
23 Span<int3> corner_tris_;
24 int resolution_;
25 std::unique_ptr<LookupGrid> lookup_grid_;
26
27 public:
28 ReverseUVSampler(Span<float2> uv_map, Span<int3> corner_tris);
30
31 enum class ResultType {
35 };
36
42
43 Result sample(const float2 &query_uv) const;
44 void sample_many(Span<float2> query_uvs, MutableSpan<Result> r_results) const;
45};
46
47} // namespace blender::geometry
ReverseUVSampler(Span< float2 > uv_map, Span< int3 > corner_tris)
ReverseUVSampler(Span< float2 > uv_map, Span< int3 > corner_tris)
void sample_many(Span< float2 > query_uvs, MutableSpan< Result > r_results) const
VecBase< float, 2 > float2
VecBase< float, 3 > float3