8#include <opencv2/core.hpp>
71 ,
pos{value[0], value[1], value[2]}
72 ,
normal{value[3], value[4], value[5]}
84 using Pointer = std::shared_ptr<PerPixelMap>;
94 template <
typename... Args>
97 return std::make_shared<PerPixelMap>(std::forward<Args>(args)...);
110 auto operator()(std::
size_t y, std::
size_t x) const -> const cv::Vec6d&;
113 auto operator()(std::
size_t y, std::
size_t x) -> cv::Vec6d&;
116 [[nodiscard]] auto
getMapping(std::
size_t y, std::
size_t x) const
127 [[nodiscard]] auto
hasMapping(std::
size_t y, std::
size_t x) const ->
bool;
196 [[nodiscard]] auto
width() const -> std::
size_t;
199 [[nodiscard]] auto
height() const -> std::
size_t;
204 [[nodiscard]] auto
mask() const -> cv::Mat;
225 [[nodiscard]] auto
cellMap() const -> cv::Mat;
A raster of a UVMap that provides a per-pixel mapping between a Volume and a Texture generated from t...
PerPixelMap(std::size_t height, std::size_t width)
Constructor with width and height parameters.
static auto ReadPPM(const filesystem::path &path) -> PerPixelMap
Read a PerPixelMap from disk.
static auto New(Args... args) -> Pointer
auto cellMap() const -> cv::Mat
Get the cell map image.
auto hasMapping(std::size_t y, std::size_t x) const -> bool
Return whether there is a mapping for the pixel at x, y.
static void WritePPM(const filesystem::path &path, const PerPixelMap &map)
Write a PerPixelMap to disk.
void setHeight(std::size_t h)
Set the height of the map.
std::shared_ptr< PerPixelMap > Pointer
auto mask() const -> cv::Mat
Get the pixel mask.
auto getMapping(std::size_t y, std::size_t x) const -> const cv::Vec6d &
Get the mapping for a pixel by x, y coordinate.
auto getMappings() const -> std::vector< PixelMap >
Get a list of valid pixel mappings.
auto initialized() const -> bool
Return whether the PerPixelMap has been initialized.
auto numMappings() const -> std::size_t
Get the number of valid mappings.
auto height() const -> std::size_t
Get the height of the map.
auto getMappingCoords() const -> std::vector< Coord2D >
Get a list of pixel coordinates with valid mappings.
void setCellMap(const cv::Mat &m)
Set the cell map image.
OrderedPointSet< cv::Vec6d > map_
void setDimensions(std::size_t h, std::size_t w)
Set the dimensions of the map.
auto getAsPixelMap(std::size_t y, std::size_t x) -> PixelMap
Get the mapping for a pixel as a PixelMap.
void setWidth(std::size_t w)
Set the width of the map.
PerPixelMap()=default
Default constructor.
static auto Crop(const PerPixelMap &map, std::size_t originY, std::size_t originX, std::size_t height, std::size_t width) -> PerPixelMap
Create a cropped PPM.
void setMask(const cv::Mat &m)
Set the pixel mask.
auto width() const -> std::size_t
Get the width of the map.
Volume Cartographer library
Coord2D(std::size_t y, std::size_t x)
PixelMap(std::size_t y, std::size_t x, cv::Vec6d value)