OrcaSlicer/src/libslic3r/ObjColorUtils.cpp
zhou.xu c333cb58d9 ENH:Obj import supports up to 32 colors
jira: STUDIO-10927
Change-Id: I46b2c63a625f91d0caafa78cf47bf0fc8589015b
(cherry picked from commit 9e2bfb7d7e56d886a85c0ee8c0e90dbc6ccfa932)
2025-09-18 16:10:27 +08:00

15 lines
No EOL
612 B
C++

#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,
int max_cluster)
{
QuantKMeans quant(10);
quant.apply(input_colors, cluster_colors_from_algo, cluster_labels_from_algo, (int) cluster_number, max_cluster);
if (cluster_number == -1) {
return false;
}
return true;
}