Lagrange
Loading...
Searching...
No Matches
texture_filtering.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/View3D.h>
16
17#include <optional>
18#include <string_view>
19#include <utility>
20
21namespace lagrange::texproc {
22
25
30{
32 double value_weight = 1e3;
33
39 double gradient_weight = 1.;
40
43 double gradient_scale = 1.;
44
46 unsigned int quadrature_samples = 6;
47
49 double jitter_epsilon = 1e-4;
50
53
55 std::optional<std::pair<double, double>> clamp_to_range = std::nullopt;
56};
57
69template <typename Scalar, typename Index, typename ValueType>
72 image::experimental::View3D<ValueType> texture,
73 const FilteringOptions& options = {});
74
76
77} // namespace lagrange::texproc
A general purpose polygonal mesh class.
Definition SurfaceMesh.h:66
void texture_filtering(const SurfaceMesh< Scalar, Index > &mesh, image::experimental::View3D< ValueType > texture, const FilteringOptions &options={})
Smooth or sharpen a texture image associated with a mesh.
Definition texture_filtering.cpp:153
Options for texture filtering (smoothing or sharpening).
Definition texture_filtering.h:30
double gradient_scale
The gradient modulation weight.
Definition texture_filtering.h:43
double stiffness_regularization_weight
Regularize the stiffness matrix using a combinatorial Laplacian energy.
Definition texture_filtering.h:52
std::optional< std::pair< double, double > > clamp_to_range
Clamp out-of-range texels to the given range (nullopt to disable).
Definition texture_filtering.h:55
double value_weight
The weight for fitting the values of the signal.
Definition texture_filtering.h:32
unsigned int quadrature_samples
The number of quadrature samples to use for integration (in {1, 3, 6, 12, 24, 32}).
Definition texture_filtering.h:46
double gradient_weight
The weight for fitting the modulated gradients of the signal.
Definition texture_filtering.h:39
double jitter_epsilon
Jitter amount per texel (0 to deactivate).
Definition texture_filtering.h:49