OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp} Namespace Reference

Functions

void push_slim_scrollbar_style (float width, bool dark)
void pop_slim_scrollbar_style ()
std::string ellipsize (std::string s, float max_w, float font_size=0.f)
bool point_in_triangle_coplanar (const Vec3f &p, const std::array< Vec3f, 3 > &t)
TriangleSelector::TriangleSplittingData remap_texture_paint_spatial (const TriangleMesh &src_mesh, const TriangleSelector::TriangleSplittingData &src_data, const AABBTreeIndirect::Tree3f &src_tree, const TriangleMesh &dst_mesh, const Vec3f &dst_to_src)
std::vector< std::string > mixed_slot_signature (const DynamicPrintConfig &project_config)
bool same_palette (const std::vector< PrintableColor > &l, const std::vector< PrintableColor > &r)
static Vec3f srgb_to_lab (const Vec3f &c)
static Vec3f lab_to_srgb (const Vec3f &lab)
std::unique_ptr< GLTexture > upload_height_thumbnail (const DecodedHeightTexture &decoded, int max_px=THUMBNAIL_MAX_PX)
std::unique_ptr< GLTexture > upload_color_texture (const DecodedHeightTexture &decoded, int max_px)
bool ray_plane_hit (const Camera &camera, const Vec2d &mouse_pos, const Transform3d &trafo, const Vec3f &plane_point_local, const Vec3f &plane_normal_local, Vec3d &out_world_hit)

Variables

constexpr float ImGuiLogSlider = float(ImGuiSliderFlags_Logarithmic)
constexpr int THUMBNAIL_MAX_PX = 128
constexpr int HEIGHT_TEX_MAX_PX = 2048
constexpr int ADJUST_PREVIEW_MAX_PX = 384
constexpr int PICKER_LOADS_PER_FRAME = 2
constexpr int BORDER_BAND_RINGS = 2
constexpr int PALETTE_LUT_EDGE = 24
constexpr int PALETTE_MAX_ENTRIES = 64
constexpr float PREFER_PURE_DE = 2.f
constexpr size_t MIX_TARGET_SAMPLES = size_t(1) << 20
constexpr size_t MIX_TARGET_BINS = 256
constexpr float MIN_MIX_GAIN = 0.05f

Function Documentation

◆ ellipsize()

std::string Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::ellipsize ( std::string s,
float max_w,
float font_size = 0.f )
128{
129 const auto text_width = [&](const std::string &text) {
130 return font_size > 0.f
131 ? ImGui::GetFont()->CalcTextSizeA(font_size, std::numeric_limits<float>::max(), 0.f, text.c_str()).x
132 : ImGui::CalcTextSize(text.c_str()).x;
133 };
134 if (text_width(s) <= max_w)
135 return s;
136 while (!s.empty() && text_width(s + "...") > max_w) {
137 unsigned char c;
138 do { // a whole code point at a time
139 c = static_cast<unsigned char>(s.back());
140 s.pop_back();
141 } while (!s.empty() && (c & 0xC0) == 0x80);
142 }
143 return s + "...";
144}

References ellipsize().

Referenced by ellipsize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lab_to_srgb()

Vec3f Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::lab_to_srgb ( const Vec3f & lab)
static
390{
391 const float fy = (lab.x() + 16.f) / 116.f, fx = lab.y() / 500.f + fy, fz = fy - lab.z() / 200.f;
392 const auto finv = [](float t) { return t > 0.206893f ? t * t * t : (t - 16.f / 116.f) / 7.787f; };
393 const float x = finv(fx) * 0.95047f, y = finv(fy), z = finv(fz) * 1.08883f;
394 const float r = 3.2406f * x - 1.5372f * y - 0.4986f * z;
395 const float g = -0.9689f * x + 1.8758f * y + 0.0415f * z;
396 const float b = 0.0557f * x - 0.2040f * y + 1.0570f * z;
397 const auto gam = [](float v) {
398 v = std::clamp(v, 0.f, 1.f);
399 return v > 0.0031308f ? 1.055f * std::pow(v, 1.f / 2.4f) - 0.055f : 12.92f * v;
400 };
401 return Vec3f(gam(r), gam(g), gam(b));
402}
Eigen::Matrix< float, 3, 1, Eigen::DontAlign > Vec3f
Definition Point.hpp:65

References lab_to_srgb().

Referenced by lab_to_srgb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mixed_slot_signature()

std::vector< std::string > Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::mixed_slot_signature ( const DynamicPrintConfig & project_config)
347{
348 std::vector<std::string> out;
349 const auto *is_mixed = project_config.option<ConfigOptionBools>("filament_is_mixed");
350 const auto *comps = project_config.option<ConfigOptionStrings>("filament_mixed_components");
351 const auto *ratios = project_config.option<ConfigOptionStrings>("filament_mixed_sublayer_ratios");
352 const auto *gradient = project_config.option<ConfigOptionBools>("filament_mixed_gradient");
353 if (is_mixed == nullptr || comps == nullptr || ratios == nullptr)
354 return out;
355 for (size_t i = 0; i < is_mixed->values.size(); ++i)
356 if (is_mixed->values[i])
357 out.push_back(std::to_string(i) + ':' + (i < comps->values.size() ? comps->values[i] : std::string()) + '|' +
358 (i < ratios->values.size() ? ratios->values[i] : std::string()) + '|' +
359 (gradient != nullptr && i < gradient->values.size() && gradient->values[i] ? "g" : ""));
360 return out;
361}
ConfigOption * option(const t_config_option_key &opt_key, bool create=false)
Definition Config.hpp:2768
Definition Config.hpp:1190
std::vector< unsigned char > values
Definition Config.hpp:418
ConfigOptionBoolsTempl< false > ConfigOptionBools
Definition Config.hpp:2066

References mixed_slot_signature(), Slic3r::ConfigBase::option(), Slic3r::ConfigOptionVector< T >::size(), Slic3r::ConfigOptionVector< T >::values, and Slic3r::ConfigOptionVector< unsigned char >::values.

Referenced by mixed_slot_signature().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ point_in_triangle_coplanar()

bool Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::point_in_triangle_coplanar ( const Vec3f & p,
const std::array< Vec3f, 3 > & t )
193{
194 const Vec3f n = (t[1] - t[0]).cross(t[2] - t[0]);
195 const float n2 = n.squaredNorm();
196 if (n2 < 1e-20f)
197 return false; // degenerate: it covers no area, so nothing is inside it
198 // A small negative tolerance, scaled by the triangle, keeps a centroid sitting exactly on a shared
199 // edge from falling through the gap between two neighbouring pieces.
200 const float eps = -1e-4f * n2;
201 return (t[1] - t[0]).cross(p - t[0]).dot(n) >= eps &&
202 (t[2] - t[1]).cross(p - t[1]).dot(n) >= eps &&
203 (t[0] - t[2]).cross(p - t[2]).dot(n) >= eps;
204}
T cross(const boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
Definition ExtrusionSimulator.cpp:168

References Slic3r::cross(), and point_in_triangle_coplanar().

Referenced by point_in_triangle_coplanar().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pop_slim_scrollbar_style()

void Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::pop_slim_scrollbar_style ( )
121{
122 ImGui::PopStyleColor(5);
123 ImGui::PopStyleVar(2);
124}

References pop_slim_scrollbar_style().

Referenced by pop_slim_scrollbar_style().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_slim_scrollbar_style()

void Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::push_slim_scrollbar_style ( float width,
bool dark )
109{
110 const ImVec4 grab = dark ? ImVec4(1.f, 1.f, 1.f, 0.26f) : ImVec4(0.f, 0.f, 0.f, 0.26f);
111 ImGui::PushStyleVar(ImGuiStyleVar_ScrollbarSize, width);
112 ImGui::PushStyleVar(ImGuiStyleVar_ScrollbarRounding, 0.5f * width);
113 ImGui::PushStyleColor(ImGuiCol_ScrollbarBg, ImVec4(0.f, 0.f, 0.f, 0.f));
114 ImGui::PushStyleColor(ImGuiCol_ScrollbarGrab, grab);
115 ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabHovered, ImVec4(grab.x, grab.y, grab.z, 0.45f));
116 ImGui::PushStyleColor(ImGuiCol_ScrollbarGrabActive, ImVec4(grab.x, grab.y, grab.z, 0.65f));
117 ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.f, 0.f, 0.f, 0.f));
118}

References push_slim_scrollbar_style().

Referenced by push_slim_scrollbar_style().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ray_plane_hit()

bool Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::ray_plane_hit ( const Camera & camera,
const Vec2d & mouse_pos,
const Transform3d & trafo,
const Vec3f & plane_point_local,
const Vec3f & plane_normal_local,
Vec3d & out_world_hit )
489{
490 Vec3d ray_origin, ray_dir;
491 CameraUtils::ray_from_screen_pos(camera, mouse_pos, ray_origin, ray_dir);
492
493 const Vec3d plane_point_world = trafo * plane_point_local.cast<double>();
494 const Vec3d plane_normal_world = (trafo.matrix().block(0, 0, 3, 3).inverse().transpose() * plane_normal_local.cast<double>()).normalized();
495
496 const double denom = ray_dir.dot(plane_normal_world);
497 if (std::abs(denom) < 1e-8)
498 return false;
499
500 const double t = (plane_point_world - ray_origin).dot(plane_normal_world) / denom;
501 if (t < 0.0)
502 return false;
503
504 out_world_hit = ray_origin + ray_dir * t;
505 return true;
506}
static void ray_from_screen_pos(const Camera &camera, const Vec2d &position, Vec3d &point, Vec3d &direction)
Create ray(point and direction) for screen coordinate.
Definition CameraUtils.cpp:95
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68
T dot(const boost::geometry::model::d2::point_xy< T > &v1, const boost::geometry::model::d2::point_xy< T > &v2)
Definition ExtrusionSimulator.cpp:154

References Slic3r::dot(), Slic3r::GUI::CameraUtils::ray_from_screen_pos(), and ray_plane_hit().

Referenced by ray_plane_hit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remap_texture_paint_spatial()

TriangleSelector::TriangleSplittingData Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::remap_texture_paint_spatial ( const TriangleMesh & src_mesh,
const TriangleSelector::TriangleSplittingData & src_data,
const AABBTreeIndirect::Tree3f & src_tree,
const TriangleMesh & dst_mesh,
const Vec3f & dst_to_src )
225{
226 const indexed_triangle_set &src = src_mesh.its;
227 const indexed_triangle_set &dst = dst_mesh.its;
228 const size_t ntri = src.indices.size();
229 if (src_data.bitstream.empty() || ntri == 0 || dst.indices.empty() || src_tree.empty())
230 return {};
231
232 // The painted patch, split into per-source-triangle pieces - the same shape
233 // collect_paint_region() builds, and for the same reason: a source triangle the brush only
234 // partly covered has to answer "is this point painted" geometrically rather than be rounded to
235 // painted-or-not, which leaves a ragged fringe along any curved brush boundary.
236 TriangleSelector src_sel(src_mesh);
237 src_sel.deserialize(src_data, false);
238 std::vector<int> piece_src;
239 const indexed_triangle_set patch = src_sel.get_facets_strict(EnforcerBlockerType::ENFORCER, &piece_src);
240 if (patch.indices.empty())
241 return {};
242
243 const auto tri_area2 = [](const Vec3f &a, const Vec3f &b, const Vec3f &c) {
244 return (b - a).cross(c - a).norm();
245 };
246 std::vector<float> src_area2(ntri, 0.f), covered2(ntri, 0.f);
247 for (size_t i = 0; i < ntri; ++i)
248 src_area2[i] = tri_area2(src.vertices[size_t(src.indices[i][0])], src.vertices[size_t(src.indices[i][1])],
249 src.vertices[size_t(src.indices[i][2])]);
250 for (size_t j = 0; j < patch.indices.size() && j < piece_src.size(); ++j) {
251 if (size_t(piece_src[j]) >= ntri)
252 continue;
253 const stl_triangle_vertex_indices &t = patch.indices[j];
254 covered2[size_t(piece_src[j])] += tri_area2(patch.vertices[size_t(t[0])], patch.vertices[size_t(t[1])],
255 patch.vertices[size_t(t[2])]);
256 }
257 std::vector<uint8_t> full(ntri, 0);
258 for (size_t i = 0; i < ntri; ++i)
259 full[i] = (src_area2[i] > 0.f && covered2[i] >= 0.999f * src_area2[i]) ? 1 : 0;
260
261 // CSR pieces, kept for partly covered sources only - a full one answers every query "painted".
262 std::vector<int> part_start(ntri + 1, 0);
263 for (size_t j = 0; j < patch.indices.size() && j < piece_src.size(); ++j)
264 if (size_t(piece_src[j]) < ntri && !full[size_t(piece_src[j])])
265 ++part_start[size_t(piece_src[j]) + 1];
266 for (size_t i = 0; i < ntri; ++i)
267 part_start[i + 1] += part_start[i];
268 std::vector<std::array<Vec3f, 3>> part;
269 part.resize(size_t(part_start[ntri])); // not a constructor call: `vector<T> p(size_t(x[n]));` parses
270 // as a function declaration, and every use of `part` below
271 // then fails with something that does not mention the cause.
272 {
273 std::vector<int> fill(part_start.begin(), part_start.begin() + ntri);
274 for (size_t j = 0; j < patch.indices.size() && j < piece_src.size(); ++j) {
275 const size_t S = size_t(piece_src[j]);
276 if (S >= ntri || full[S])
277 continue;
278 const stl_triangle_vertex_indices &t = patch.indices[j];
279 part[size_t(fill[S]++)] = { patch.vertices[size_t(t[0])], patch.vertices[size_t(t[1])],
280 patch.vertices[size_t(t[2])] };
281 }
282 }
283
284 // Classify in parallel, then write the mask serially - TriangleSelector is not thread safe.
285 std::vector<uint8_t> painted(dst.indices.size(), 0);
286 tbb::parallel_for(tbb::blocked_range<size_t>(0, dst.indices.size()),
287 [&](const tbb::blocked_range<size_t> &range) {
288 for (size_t i = range.begin(); i < range.end(); ++i) {
289 const stl_triangle_vertex_indices &t = dst.indices[i];
290 const Vec3f centroid = (dst.vertices[size_t(t[0])] + dst.vertices[size_t(t[1])] +
291 dst.vertices[size_t(t[2])]) / 3.f + dst_to_src;
292 size_t hit = 0;
293 Vec3f hit_pos = Vec3f::Zero();
294 if (AABBTreeIndirect::squared_distance_to_indexed_triangle_set(src.vertices, src.indices, src_tree,
295 centroid, hit, hit_pos) < 0.f ||
296 hit >= ntri)
297 continue;
298 if (full[hit]) {
299 painted[i] = 1;
300 continue;
301 }
302 for (int k = part_start[hit]; k < part_start[hit + 1]; ++k)
303 if (point_in_triangle_coplanar(hit_pos, part[size_t(k)])) {
304 painted[i] = 1;
305 break;
306 }
307 }
308 });
309
310 TriangleSelector dst_sel(dst_mesh);
311 for (size_t i = 0; i < painted.size(); ++i)
312 if (painted[i])
313 dst_sel.set_facet(int(i), EnforcerBlockerType::ENFORCER);
314 return dst_sel.serialize();
315}
bool empty() const
Definition AABBTreeIndirect.hpp:111
indexed_triangle_set its
Definition TriangleMesh.hpp:164
Definition TriangleSelector.hpp:75
auto range(Cont &&cont)
Definition libslic3r.h:405
@ ENFORCER
Definition TriangleSelector.hpp:27
std::vector< bool > bitstream
Definition TriangleSelector.hpp:291

References Slic3r::TriangleSelector::TriangleSplittingData::bitstream, Slic3r::TriangleSelector::deserialize(), Slic3r::AABBTreeIndirect::Tree< ANumDimensions, ACoordType >::empty(), Slic3r::ENFORCER, Slic3r::TriangleSelector::get_facets_strict(), Slic3r::TriangleMesh::its, Slic3r::range(), and remap_texture_paint_spatial().

Referenced by remap_texture_paint_spatial().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ same_palette()

bool Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::same_palette ( const std::vector< PrintableColor > & l,
const std::vector< PrintableColor > & r )
365{
366 return std::equal(l.begin(), l.end(), r.begin(), r.end(), [](const PrintableColor &x, const PrintableColor &y) {
367 return x.a == y.a && x.b == y.b && x.num == y.num && x.den == y.den && x.rgb == y.rgb;
368 });
369}
Definition TextureDisplacement.hpp:623

References same_palette().

Referenced by same_palette().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ srgb_to_lab()

Vec3f Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::srgb_to_lab ( const Vec3f & c)
static
378{
379 const auto lin = [](float v) { return v > 0.04045f ? std::pow((v + 0.055f) / 1.055f, 2.4f) : v / 12.92f; };
380 const float r = lin(c.x()), g = lin(c.y()), b = lin(c.z());
381 const float x = (0.4124f * r + 0.3576f * g + 0.1805f * b) / 0.95047f;
382 const float y = (0.2126f * r + 0.7152f * g + 0.0722f * b);
383 const float z = (0.0193f * r + 0.1192f * g + 0.9505f * b) / 1.08883f;
384 const auto f = [](float t) { return t > 0.008856f ? std::cbrt(t) : 7.787f * t + 16.f / 116.f; };
385 const float fx = f(x), fy = f(y), fz = f(z);
386 return Vec3f(116.f * fy - 16.f, 500.f * (fx - fy), 200.f * (fy - fz));
387}
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124

References Slic3r::f(), and srgb_to_lab().

Referenced by srgb_to_lab().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ upload_color_texture()

std::unique_ptr< GLTexture > Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::upload_color_texture ( const DecodedHeightTexture & decoded,
int max_px )
451{
452 if (!decoded.has_color())
453 return nullptr;
454
455 const int scale = std::max(1, (std::max(decoded.width, decoded.height) + max_px - 1) / max_px);
456 const int w = std::max(1, decoded.width / scale);
457 const int h = std::max(1, decoded.height / scale);
458
459 std::vector<unsigned char> rgba(size_t(w) * size_t(h) * 4);
460 for (int y = 0; y < h; ++y)
461 for (int x = 0; x < w; ++x) {
462 const int x0 = x * decoded.width / w, x1 = std::max(x0 + 1, (x + 1) * decoded.width / w);
463 const int y0 = y * decoded.height / h, y1 = std::max(y0 + 1, (y + 1) * decoded.height / h);
464 unsigned int sum[3] = { 0, 0, 0 };
465 unsigned int n = 0;
466 for (int sy = y0; sy < y1 && sy < decoded.height; ++sy)
467 for (int sx = x0; sx < x1 && sx < decoded.width; ++sx, ++n) {
468 const size_t si = (size_t(sy) * size_t(decoded.width) + size_t(sx)) * 3;
469 for (int c = 0; c < 3; ++c)
470 sum[c] += decoded.rgb[si + size_t(c)];
471 }
472 const size_t di = (size_t(y) * size_t(w) + size_t(x)) * 4;
473 for (int c = 0; c < 3; ++c)
474 rgba[di + size_t(c)] = (n > 0) ? static_cast<unsigned char>(sum[size_t(c)] / n) : 0;
475 rgba[di + 3] = 255;
476 }
477
478 auto texture = std::make_unique<GLTexture>();
479 if (!texture->load_from_raw_data(std::move(rgba), (unsigned int) w, (unsigned int) h, false, false))
480 return nullptr;
481 return texture;
482}
int scale(const int val)
Definition WipeTowerDialog.cpp:58
std::vector< uint8_t > rgb
Definition TextureDisplacement.hpp:537
int width
Definition TextureDisplacement.hpp:538
int height
Definition TextureDisplacement.hpp:539
bool has_color() const
Definition TextureDisplacement.hpp:542

References Slic3r::DecodedHeightTexture::has_color(), Slic3r::DecodedHeightTexture::height, Slic3r::DecodedHeightTexture::rgb, scale(), upload_color_texture(), and Slic3r::DecodedHeightTexture::width.

Referenced by upload_color_texture().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ upload_height_thumbnail()

std::unique_ptr< GLTexture > Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::upload_height_thumbnail ( const DecodedHeightTexture & decoded,
int max_px = THUMBNAIL_MAX_PX )
405{
406 if (decoded.empty())
407 return nullptr;
408
409 // Preserve aspect; never upscale a texture that is already small.
410 const int scale = std::max(1, (std::max(decoded.width, decoded.height) + max_px - 1) / max_px);
411 const int w = std::max(1, decoded.width / scale);
412 const int h = std::max(1, decoded.height / scale);
413
414 // A colour texture is shown in colour, so it can be told apart from its grey neighbours in the picker; its
415 // height is the luminance of those same colours, so nothing about the relief is hidden by that.
416 const bool color = decoded.has_color();
417 std::vector<unsigned char> rgba(size_t(w) * size_t(h) * 4);
418 for (int y = 0; y < h; ++y)
419 for (int x = 0; x < w; ++x) {
420 // Average the source block this destination pixel covers.
421 const int x0 = x * decoded.width / w, x1 = std::max(x0 + 1, (x + 1) * decoded.width / w);
422 const int y0 = y * decoded.height / h, y1 = std::max(y0 + 1, (y + 1) * decoded.height / h);
423 unsigned int sum[3] = { 0, 0, 0 };
424 unsigned int n = 0;
425 for (int sy = y0; sy < y1 && sy < decoded.height; ++sy)
426 for (int sx = x0; sx < x1 && sx < decoded.width; ++sx, ++n) {
427 const size_t si = size_t(sy) * size_t(decoded.width) + size_t(sx);
428 for (int c = 0; c < 3; ++c)
429 sum[c] += color ? decoded.rgb[si * 3 + size_t(c)] : decoded.pixels[si];
430 }
431
432 const size_t di = (size_t(y) * size_t(w) + size_t(x)) * 4;
433 for (int c = 0; c < 3; ++c)
434 rgba[di + size_t(c)] = (n > 0) ? static_cast<unsigned char>(sum[c] / n) : 0;
435 rgba[di + 3] = 255;
436 }
437
438 auto texture = std::make_unique<GLTexture>();
439 if (!texture->load_from_raw_data(std::move(rgba), (unsigned int) w, (unsigned int) h, false, /* use_mipmaps */ false))
440 return nullptr;
441 return texture;
442}
std::vector< uint8_t > pixels
Definition TextureDisplacement.hpp:532
bool empty() const
Definition TextureDisplacement.hpp:541

References Slic3r::DecodedHeightTexture::empty(), Slic3r::DecodedHeightTexture::has_color(), Slic3r::DecodedHeightTexture::height, Slic3r::DecodedHeightTexture::pixels, Slic3r::DecodedHeightTexture::rgb, scale(), THUMBNAIL_MAX_PX, upload_height_thumbnail(), and Slic3r::DecodedHeightTexture::width.

Referenced by upload_height_thumbnail().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ADJUST_PREVIEW_MAX_PX

int Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::ADJUST_PREVIEW_MAX_PX = 384
constexpr

◆ BORDER_BAND_RINGS

int Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::BORDER_BAND_RINGS = 2
constexpr

◆ HEIGHT_TEX_MAX_PX

int Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::HEIGHT_TEX_MAX_PX = 2048
constexpr

◆ ImGuiLogSlider

float Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::ImGuiLogSlider = float(ImGuiSliderFlags_Logarithmic)
constexpr

◆ MIN_MIX_GAIN

float Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::MIN_MIX_GAIN = 0.05f
constexpr

◆ MIX_TARGET_BINS

size_t Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::MIX_TARGET_BINS = 256
constexpr

◆ MIX_TARGET_SAMPLES

size_t Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::MIX_TARGET_SAMPLES = size_t(1) << 20
constexpr

◆ PALETTE_LUT_EDGE

int Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::PALETTE_LUT_EDGE = 24
constexpr

◆ PALETTE_MAX_ENTRIES

int Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::PALETTE_MAX_ENTRIES = 64
constexpr

◆ PICKER_LOADS_PER_FRAME

int Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::PICKER_LOADS_PER_FRAME = 2
constexpr

◆ PREFER_PURE_DE

float Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::PREFER_PURE_DE = 2.f
constexpr

◆ THUMBNAIL_MAX_PX

int Slic3r::GUI::anonymous_namespace{GLGizmoTextureDisplacement.cpp}::THUMBNAIL_MAX_PX = 128
constexpr

Referenced by upload_height_thumbnail().