Volume Cartographer 2.27.0
PPMGenerator.hpp
Go to the documentation of this file.
1#pragma once
2
5#include <cstddef>
6
11
12namespace volcart::texturing
13{
29{
30public:
33 enum class Shading {
35 Flat = 0,
40 Smooth
41 };
42
44 PPMGenerator() = default;
45
47 PPMGenerator(std::size_t h, std::size_t w);
52 void setMesh(const ITKMesh::Pointer& m);
53
55 void setUVMap(const UVMap::Pointer& u);
60 void setDimensions(std::size_t h, std::size_t w);
61
73 [[nodiscard]] auto getPPM() const -> PerPixelMap::Pointer;
77 [[nodiscard]] auto progressIterations() const -> std::size_t override;
78
79private:
83 UVMap::Pointer uvMap_;
84
88 PerPixelMap::Pointer ppm_;
92 std::size_t width_{0};
94 std::size_t height_{0};
95};
96
112 const ITKMesh::Pointer& mesh,
113 const UVMap::Pointer& uv,
114 std::size_t height,
115 std::size_t width) -> cv::Mat;
116
117} // namespace volcart::texturing
A raster of a UVMap that provides a per-pixel mapping between a Volume and a Texture generated from t...
Definition: PerPixelMap.hpp:50
std::shared_ptr< PerPixelMap > Pointer
Definition: PerPixelMap.hpp:84
Stores per-vertex UV mappings.
Definition: UVMap.hpp:52
std::shared_ptr< UVMap > Pointer
Definition: UVMap.hpp:55
Generates a PerPixelMap from an ITKMesh and a UVMap.
void setShading(Shading s)
Set the normal shading method.
PPMGenerator(std::size_t h, std::size_t w)
void setUVMap(const UVMap::Pointer &u)
Set the input UV map.
auto progressIterations() const -> std::size_t override
Returns the maximum progress value.
auto compute() -> PerPixelMap::Pointer
Compute the PerPixelMap.
Shading
Pixel normal shading method.
@ Smooth
Each pixel's normal is a linear interpolation of the face's vertex normals. This is similar to Phong ...
void setDimensions(std::size_t h, std::size_t w)
Set the dimensions of the output PPM.
void setMesh(const ITKMesh::Pointer &m)
Set the input mesh.
auto getPPM() const -> PerPixelMap::Pointer
Get the generated PerPixelMap.
Texturing and parameterization algorithms and utilities library.
auto GenerateCellMap(const ITKMesh::Pointer &mesh, const UVMap::Pointer &uv, std::size_t height, std::size_t width) -> cv::Mat
Generate a cell map image.
itk::Mesh< ITKPixel, 3, ITKMeshTraits > ITKMesh
Definition: ITKMesh.hpp:22
Mixin type for classes which report their progress.
Definition: Mixins.hpp:13