mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-11 11:07:40 +00:00
NEW:active "import obj color" in command line
jira: none Change-Id: I8bc5d4a1eea116305037b8194ff1d2e8aab83ce9 (cherry picked from commit 7df9f9d27d174b30a54ed27756d4a4a157557019) (cherry picked from commit b97d44dae4854c342b835d3fd5265a22aec5d174)
This commit is contained in:
@@ -243,6 +243,7 @@ set(lisbslic3r_sources
|
||||
Arrange.cpp
|
||||
NormalUtils.cpp
|
||||
NormalUtils.hpp
|
||||
ObjColorUtils.cpp
|
||||
ObjColorUtils.hpp
|
||||
Orient.hpp
|
||||
Orient.cpp
|
||||
|
||||
14
src/libslic3r/ObjColorUtils.cpp
Normal file
14
src/libslic3r/ObjColorUtils.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "ObjColorUtils.hpp"
|
||||
|
||||
bool obj_color_deal_algo(std::vector<Slic3r::RGBA> & input_colors,
|
||||
std::vector<Slic3r::RGBA> & cluster_colors_from_algo,
|
||||
std::vector<int> & cluster_labels_from_algo,
|
||||
char & cluster_number)
|
||||
{
|
||||
QuantKMeans quant(10);
|
||||
quant.apply(input_colors, cluster_colors_from_algo, cluster_labels_from_algo, (int) cluster_number);
|
||||
if (cluster_number == -1) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <ctime>
|
||||
|
||||
#include "opencv2/opencv.hpp"
|
||||
|
||||
#include "libslic3r/Color.hpp"
|
||||
class QuantKMeans
|
||||
{
|
||||
public:
|
||||
@@ -260,3 +260,8 @@ public:
|
||||
return image8UC3;
|
||||
}
|
||||
};
|
||||
|
||||
bool obj_color_deal_algo(std::vector<Slic3r::RGBA> &input_colors,
|
||||
std::vector<Slic3r::RGBA>& cluster_colors_from_algo,
|
||||
std::vector<int>& cluster_labels_from_algo,
|
||||
char & cluster_number);
|
||||
Reference in New Issue
Block a user