OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
TextureLibrary.cpp File Reference
#include "TextureLibrary.hpp"
#include <algorithm>
#include <atomic>
#include <boost/filesystem/operations.hpp>
#include <cstddef>
#include <boost/filesystem/directory.hpp>
#include <cstdint>
#include <fstream>
#include <ios>
#include <iterator>
#include <limits>
#include <string>
#include <optional>
#include <memory>
#include <unordered_map>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/filesystem.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/fstream.hpp>
#include <boost/system/error_code.hpp>
#include <vector>
#include <wx/app.h>
#include <wx/gdicmn.h>
#include <utility>
#include <wx/image.h>
#include <wx/mstream.h>
#include "libslic3r/PNGReadWrite.hpp"
#include "libslic3r/TextureDisplacement.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/AppConfig.hpp"
#include "slic3r/GUI/GUI.hpp"
#include "slic3r/GUI/GUI_App.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/plugin/PluginFsUtils.hpp"
#include "slic3r/plugin/host/PluginResourceTextures.hpp"
Include dependency graph for TextureLibrary.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 |/
namespace  Slic3r::GUI
namespace  Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}

Functions

bool Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::is_image_file (const boost::filesystem::path &path)
void Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::scan_dir (const boost::filesystem::path &dir, TextureSource source, std::vector< TextureLibraryEntry > &out)
void Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::scan_plugin_textures (std::vector< TextureLibraryEntry > &out)
bool Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::image_has_color (const wxImage &image)
bool Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::encode_color_png_bytes (const wxImage &image, std::vector< unsigned char > &out, std::string &error)
bool Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::encode_gray_png_bytes (const wxImage &image, std::vector< unsigned char > &out, std::string &error)
bool Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::encode_png_bytes (const wxImage &image, std::vector< unsigned char > &out, std::string &error)
wxImage Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::image_from_decoded (const DecodedHeightTexture &image, std::vector< unsigned char > &scratch)
std::vector< unsigned char > Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::read_file_bytes (const std::string &path)
bool Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::is_supported_height_map (const std::vector< unsigned char > &bytes)
std::optional< TextureLibraryEntry > Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::write_user_texture (const std::vector< unsigned char > &bytes, const std::string &stem, std::string &error)
std::vector< std::string > Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::recent_texture_names ()
void Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::store_recent_texture_names (std::vector< std::string > names)
void Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::sort_user_textures (std::vector< TextureLibraryEntry > &library)
bool Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::in_user_texture_dir (const std::string &path)
uint64_t Slic3r::GUI::texture_library_generation ()
void Slic3r::GUI::bump_texture_library_generation ()
std::string Slic3r::GUI::user_texture_dir ()
const std::vector< TextureLibraryEntry > & Slic3r::GUI::texture_library (bool force_rescan)
void Slic3r::GUI::touch_user_texture (const std::string &path)
bool Slic3r::GUI::remove_user_texture (const std::string &path, std::string &error)
std::optional< TextureLibraryEntry > Slic3r::GUI::import_texture_to_library (const std::string &source_path, std::string &error)
std::shared_ptr< std::vector< unsigned char > > Slic3r::GUI::load_texture_image_data (const std::string &path, std::string &error)
std::optional< TextureLibraryEntry > Slic3r::GUI::save_texture_to_library (const DecodedHeightTexture &image, const std::string &stem, std::string &error)

Variables

std::vector< TextureLibraryEntry > Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::g_library
bool Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::g_library_scanned = false
uint64_t Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::g_library_scan_generation = 0
std::atomic< uint64_t > Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::g_library_generation { 0 }
const char *const Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::RECENT_SECTION = "texture_displacement"
const char *const Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::RECENT_KEY = "recent_textures"
const size_t Slic3r::GUI::anonymous_namespace{TextureLibrary.cpp}::RECENT_MAX = 200