#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/BitmapCache.hpp>
Public Member Functions | |
| BitmapCache () | |
| ~BitmapCache () | |
| void | clear () |
| double | scale () |
| wxBitmap * | find (const std::string &name) |
| const wxBitmap * | find (const std::string &name) const |
| wxBitmap * | insert (const std::string &name, size_t width, size_t height) |
| wxBitmap * | insert (const std::string &name, const wxBitmap &bmp) |
| wxBitmap * | insert (const std::string &name, const wxBitmap &bmp, const wxBitmap &bmp2) |
| wxBitmap * | insert (const std::string &name, const wxBitmap &bmp, const wxBitmap &bmp2, const wxBitmap &bmp3) |
| wxBitmap * | insert (const std::string &name, const std::vector< wxBitmap > &bmps) |
| wxBitmap * | insert (const std::string &name, const wxBitmap *begin, const wxBitmap *end) |
| wxBitmap * | insert_raw_rgba (const std::string &bitmap_key, unsigned width, unsigned height, const unsigned char *raw_data, const bool grayscale=false) |
| wxBitmap * | load_png (const std::string &bitmap_key, unsigned width=0, unsigned height=0, const bool grayscale=false, const float scale_in_center=0.f) |
| wxBitmap * | load_svg (const std::string &bitmap_key, unsigned width=0, unsigned height=0, const bool grayscale=false, const bool dark_mode=false, const std::string &new_color="", const float scale_in_center=0.f) |
| wxBitmap * | load_svg2 (const std::string &bitmap_key, unsigned width=0, unsigned height=0, const bool grayscale=false, const bool dark_mode=false, const std::vector< std::string > &array_new_color=std::vector< std::string >(), const float scale_in_center=0.0f) |
| wxBitmap | mksolid (size_t width, size_t height, unsigned char r, unsigned char g, unsigned char b, unsigned char transparency, bool suppress_scaling=false, size_t border_width=0, bool dark_mode=false) |
| wxBitmap | mksolid (size_t width, size_t height, const unsigned char rgb[3], bool suppress_scaling=false, size_t border_width=0, bool dark_mode=false) |
| wxBitmap | mksolid (size_t width, size_t height, const ColorRGB &rgb, bool suppress_scaling=false, size_t border_width=0, bool dark_mode=false) |
| wxBitmap | mkclear (size_t width, size_t height) |
Static Public Member Functions | |
| static NSVGimage * | nsvgParseFromFileWithReplace (const char *filename, const char *units, float dpi, const std::map< std::string, std::string > &replaces) |
| static bool | parse_color (const std::string &scolor, unsigned char *rgb_out) |
| static bool | parse_color4 (const std::string &scolor, unsigned char *rgba_out) |
| static bool | load_from_svg_file_change_color (const std::string &filename, unsigned width, unsigned height, ImTextureID &texture_id, const char *hexColor) |
Private Attributes | |
| std::map< std::string, wxBitmap * > | m_map |
| double | m_gs = 0.2 |
| double | m_scale = 1.0 |
| Slic3r::GUI::BitmapCache::BitmapCache | ( | ) |
References m_scale, and Slic3r::GUI::mac_max_scaling_factor().
Referenced by find().
|
inline |
| void Slic3r::GUI::BitmapCache::clear | ( | ) |
References m_map.
Referenced by ~BitmapCache().
|
inline |
References m_map.
Referenced by Slic3r::GUI::PresetComboBox::get_bmp(), Slic3r::GUI::PresetComboBox::get_bmp(), Slic3r::GUI::PresetComboBox::get_bmp(), get_default_extruder_color_icon(), get_extruder_color_icon(), and get_extruder_color_icon().
|
inline |
References BitmapCache(), and find().
Referenced by find().
|
inline |
| wxBitmap * Slic3r::GUI::BitmapCache::insert | ( | const std::string & | name, |
| const wxBitmap & | bmp ) |
| wxBitmap * Slic3r::GUI::BitmapCache::insert | ( | const std::string & | name, |
| const wxBitmap & | bmp, | ||
| const wxBitmap & | bmp2 ) |
| wxBitmap * Slic3r::GUI::BitmapCache::insert | ( | const std::string & | name, |
| const wxBitmap & | bmp, | ||
| const wxBitmap & | bmp2, | ||
| const wxBitmap & | bmp3 ) |
| wxBitmap * Slic3r::GUI::BitmapCache::insert | ( | const std::string & | name, |
| const wxBitmap * | begin, | ||
| const wxBitmap * | end ) |
References insert(), and Slic3r::GUI::wxImage_to_wxBitmap_with_alpha().
| wxBitmap * Slic3r::GUI::BitmapCache::insert | ( | const std::string & | name, |
| size_t | width, | ||
| size_t | height ) |
References m_map, and m_scale.
Referenced by Slic3r::GUI::PresetComboBox::get_bmp(), Slic3r::GUI::PresetComboBox::get_bmp(), Slic3r::GUI::PresetComboBox::get_bmp(), get_default_extruder_color_icon(), get_extruder_color_icon(), get_extruder_color_icon(), insert(), insert(), insert(), insert_raw_rgba(), and load_png().
| wxBitmap * Slic3r::GUI::BitmapCache::insert_raw_rgba | ( | const std::string & | bitmap_key, |
| unsigned | width, | ||
| unsigned | height, | ||
| const unsigned char * | raw_data, | ||
| const bool | grayscale = false ) |
References insert(), m_gs, m_scale, and Slic3r::GUI::wxImage_to_wxBitmap_with_alpha().
Referenced by load_svg().
|
static |
References GL_LINEAR, GL_RGBA, GL_TEXTURE_2D, GL_TEXTURE_BINDING_2D, GL_TEXTURE_MAG_FILTER, GL_TEXTURE_MIN_FILTER, GL_UNPACK_ROW_LENGTH, GL_UNSIGNED_BYTE, glBindTexture, glGenTextures, glGetIntegerv, glPixelStorei, glsafe, glTexImage2D, glTexParameteri, Slic3r::nsvgParseFromFile(), and scale().
Referenced by Slic3r::GUI::ImGuiWrapper::filament_group().
| wxBitmap * Slic3r::GUI::BitmapCache::load_png | ( | const std::string & | bitmap_key, |
| unsigned | width = 0, | ||
| unsigned | height = 0, | ||
| const bool | grayscale = false, | ||
| const float | scale_in_center = 0.f ) |
References Slic3r::GUI::from_u8(), insert(), m_gs, m_map, Slic3r::var(), and Slic3r::GUI::wxImage_to_wxBitmap_with_alpha().
Referenced by create_scaled_bitmap(), and Slic3r::GUI::StatusBasePanel::init_bitmaps().
| wxBitmap * Slic3r::GUI::BitmapCache::load_svg | ( | const std::string & | bitmap_key, |
| unsigned | width = 0, | ||
| unsigned | height = 0, | ||
| const bool | grayscale = false, | ||
| const bool | dark_mode = false, | ||
| const std::string & | new_color = "", | ||
| const float | scale_in_center = 0.f ) |
References Slic3r::float_to_string_decimal_point(), insert_raw_rgba(), m_map, m_scale, nsvgParseFromFileWithReplace(), and Slic3r::var().
Referenced by Slic3r::GUI::SplashScreen::SplashScreen(), create_scaled_bitmap(), get_extruder_color_icon(), Slic3r::GUI::ColorPanel::OnPaint(), and Slic3r::GUI::anonymous_namespace{UVEditorCanvas.cpp}::pane_icon().
| wxBitmap * Slic3r::GUI::BitmapCache::load_svg2 | ( | const std::string & | bitmap_key, |
| unsigned | width = 0, | ||
| unsigned | height = 0, | ||
| const bool | grayscale = false, | ||
| const bool | dark_mode = false, | ||
| const std::vector< std::string > & | array_new_color = std::vector<std::string>(), | ||
| const float | scale_in_center = 0.0f ) |
References m_gs, m_scale, nsvgParseFromFileWithReplace(), Slic3r::var(), and Slic3r::GUI::wxImage_to_wxBitmap_with_alpha().
Referenced by create_scaled_bitmap2().
|
inline |
References mksolid().
|
inline |
References Slic3r::ColorRGB::b_uchar(), Slic3r::ColorRGB::g_uchar(), mksolid(), and Slic3r::ColorRGB::r_uchar().
Referenced by mksolid().
|
inline |
| wxBitmap Slic3r::GUI::BitmapCache::mksolid | ( | size_t | width, |
| size_t | height, | ||
| unsigned char | r, | ||
| unsigned char | g, | ||
| unsigned char | b, | ||
| unsigned char | transparency, | ||
| bool | suppress_scaling = false, | ||
| size_t | border_width = 0, | ||
| bool | dark_mode = false ) |
References m_scale, scale(), and Slic3r::GUI::wxImage_to_wxBitmap_with_alpha().
Referenced by Slic3r::GUI::ModelNode::get_bitmap(), and mkclear().
|
static |
References Slic3r::nsvgParse().
Referenced by load_svg(), Slic3r::GUI::ImGuiWrapper::load_svg(), and load_svg2().
|
static |
References Slic3r::GUI::hex_digit_to_int(), and parse_color4().
|
static |
References Slic3r::GUI::hex_digit_to_int().
Referenced by Slic3r::GUI::ImGuiWrapper::filament_group(), Slic3r::GUI::SyncAmsInfoDialog::generate_override_fix_ams_list(), Slic3r::GUI::Plater::get_extruders_colors(), parse_color(), Slic3r::GUI::SelectMachineDialog::reset_and_sync_ams_list(), Slic3r::GUI::SyncAmsInfoDialog::reset_and_sync_ams_list(), Slic3r::CLI::run(), and Slic3r::GUI::SendMultiMachinePage::sync_ams_list().
|
inline |
References m_scale.
Referenced by load_from_svg_file_change_color(), and mksolid().
|
private |
Referenced by insert_raw_rgba(), load_png(), and load_svg2().
|
private |
Referenced by clear(), find(), insert(), insert(), load_png(), and load_svg().
|
private |
Referenced by BitmapCache(), insert(), insert_raw_rgba(), load_svg(), load_svg2(), mksolid(), and scale().