OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
TexturePainting.cpp File Reference
#include "TexturePainting.hpp"
#include <algorithm>
#include <array>
#include <cmath>
#include <cstddef>
#include <cstring>
#include <map>
#include <opencv2/core/mat.hpp>
#include <opencv2/core/matx.hpp>
#include <set>
#include <string>
#include <utility>
#include <opencv2/core.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <boost/log/trivial.hpp>
#include <vector>
#include "Point.hpp"
#include "TextureToColor/Callbacks.hpp"
#include "TextureToColor/TextureToColor.hpp"
#include "TextureToColor/ColorUtils.hpp"
#include "Model.hpp"
#include "TextureDisplacement.hpp"
#include "TextureToColor/TriMesh.hpp"
#include "TriangleMesh.hpp"
#include "TriangleSelector.hpp"
#include "BoundingBox.hpp"
Include dependency graph for TexturePainting.cpp:

Go to the source code of this file.

Namespaces

namespace  Slic3r
 |/ Copyright (c) Prusa Research 2020 - 2023 Enrico Turri @enricoturri1966 |/ |/ PrusaSlicer is released under the terms of the AGPLv3 or higher |/

Functions

static cv::Mat Slic3r::decode_texture_image (const TextureImage &img)
static void Slic3r::build_tex2color_mesh (const TexturedMesh &textured, tex2color::TriMesh &mesh, std::vector< std::vector< Vec2f > > &uv_coords)
static void Slic3r::extract_painted_mesh (const tex2color::TriMesh &color_mesh, const std::vector< std::array< std::size_t, 3 > > &face_colors, PaintedMesh &painted)
static bool Slic3r::build_multi_texture_atlas (const TexturedMesh &textured, cv::Mat &out_atlas, std::vector< std::vector< Vec2f > > &out_uv_coords)
bool Slic3r::texture_to_painting (const TexturedMesh &textured, PaintedMesh &painted, const TexturePaintingSettings &settings, PaintProgressCallback progress, PaintCancelCallback cancel)
bool Slic3r::face_colors_to_painting (const TexturedMesh &mesh, PaintedMesh &painted, const TexturePaintingSettings &settings, PaintProgressCallback progress, PaintCancelCallback cancel)
double Slic3r::compute_delta_e (const std::array< std::size_t, 3 > &rgb1, const std::array< float, 4 > &rgba2)
std::vector< FilamentMatch > Slic3r::match_clusters_to_filaments (const std::vector< std::array< std::size_t, 3 > > &cluster_colors, const std::vector< std::array< float, 4 > > &filament_colors, const std::vector< std::string > &)
bool Slic3r::apply_painted_mesh_to_volume (const PaintedMesh &painted, const std::vector< FilamentMatch > &matches, ModelVolume &volume)
bool Slic3r::decode_texture_to_pixels (const TextureImage &img, std::vector< unsigned char > &out_pixels, int &out_w, int &out_h)
static std::array< std::size_t, 3 > Slic3r::sample_face_from_uvs (const cv::Mat &tex, const std::array< float, 2 > &uv0, const std::array< float, 2 > &uv1, const std::array< float, 2 > &uv2)
static std::array< std::size_t, 3 > Slic3r::sample_face_from_texture (const cv::Mat &tex, const std::vector< std::array< float, 2 > > &uvs, const std::array< int, 3 > &face)
bool Slic3r::sample_original_face_colors (const TexturedMesh &textured, std::vector< std::array< std::size_t, 3 > > &out_face_colors)