Lagrange
Loading...
Searching...
No Matches
texture_compositing.h
1/*
2 * Copyright 2025 Adobe. All rights reserved.
3 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License. You may obtain a copy
5 * of the License at http://www.apache.org/licenses/LICENSE-2.0
6 *
7 * Unless required by applicable law or agreed to in writing, software distributed under
8 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9 * OF ANY KIND, either express or implied. See the License for the specific language
10 * governing permissions and limitations under the License.
11 */
12#pragma once
13
14#include <lagrange/SurfaceMesh.h>
15#include <lagrange/image/Array3D.h>
16#include <lagrange/image/View3D.h>
17
18#include <string_view>
19
20namespace lagrange::texproc {
21
24
29{
31 double value_weight = 1e3;
32
34 unsigned int quadrature_samples = 6;
35
37 double jitter_epsilon = 1e-4;
38
43
46 {
48 unsigned int num_multigrid_levels = 4;
49
52
54 unsigned int num_v_cycles = 5;
55 } solver;
56};
57
61template <typename ValueType>
63{
65 image::experimental::View3D<const ValueType> texture;
66
69 image::experimental::View3D<const float> weights;
70};
71
85template <typename Scalar, typename Index, typename ValueType>
86image::experimental::Array3D<ValueType> texture_compositing(
88 std::vector<ConstWeightedTextureView<ValueType>> textures,
89 const CompositingOptions& options = {});
90
92
93} // namespace lagrange::texproc
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
image::experimental::Array3D< ValueType > texture_compositing(const SurfaceMesh< Scalar, Index > &mesh, std::vector< ConstWeightedTextureView< ValueType > > textures, const CompositingOptions &options={})
Composite multiple textures into a single texture.
Definition texture_compositing.cpp:244
Multigrid solver options.
Definition texture_compositing.h:46
unsigned int num_gauss_seidel_iterations
Number of Gauss-Seidel iterations per multigrid level.
Definition texture_compositing.h:51
unsigned int num_multigrid_levels
Number of multigrid levels.
Definition texture_compositing.h:48
unsigned int num_v_cycles
Number of V-cycles to perform.
Definition texture_compositing.h:54
Options for texture compositing.
Definition texture_compositing.h:29
double value_weight
The weight for fitting the values of the signal.
Definition texture_compositing.h:31
bool smooth_low_weight_areas
Whether to smooth pixels with a low total weight (< 1).
Definition texture_compositing.h:42
unsigned int quadrature_samples
The number of quadrature samples to use for integration (in {1, 3, 6, 12, 24, 32}).
Definition texture_compositing.h:34
double jitter_epsilon
Jitter amount per texel (0 to deactivate).
Definition texture_compositing.h:37
A view of a texture with weights associated with each texel.
Definition texture_compositing.h:63
image::experimental::View3D< const ValueType > texture
Texture data for a specific view.
Definition texture_compositing.h:65
image::experimental::View3D< const float > weights
Confidence weights for each texel.
Definition texture_compositing.h:69