Go to the source code of this file.
|
template<typename T > |
void | save_numpy (std::string *path, int nx, int ny, std::vector< T > *data) |
|
template void | save_numpy< float > (std::string *path, int nx, int ny, std::vector< float > *data) |
|
template void | save_numpy< std::complex< float > > (std::string *path, int nx, int ny, std::vector< std::complex< float >> *data) |
|
void | save_image (std::string *path, SDL_Surface *sdl_srf) |
|
void | v_splitter (float thickness, float &size0, const float &min_h, const float &max_h, const float &offset) |
|
void | SDL_Utils::draw_pixel (SDL_Surface *surface, int x, int y, float val, int col_map) |
|
void | SDL_Utils::draw_pixel (SDL_Surface *surface, int x, int y, float ang, float mag, int col_map) |
|
◆ save_image()
void save_image |
( |
std::string * |
path, |
|
|
SDL_Surface * |
sdl_srf |
|
) |
| |
Definition at line 30 of file GuiUtils.cpp.
32 std::string ext = std::filesystem::path(*path).extension().string();
33 if ((ext !=
".png") && (ext !=
".PNG"))
37 IMG_SavePNG(sdl_srf, path->c_str());
◆ save_numpy()
template<typename T >
void save_numpy |
( |
std::string * |
path, |
|
|
int |
nx, |
|
|
int |
ny, |
|
|
std::vector< T > * |
data |
|
) |
| |
Definition at line 17 of file GuiUtils.cpp.
19 std::string ext = std::filesystem::path(*path).extension().string();
24 const std::vector<long unsigned> shape{
static_cast<long unsigned>(ny),
static_cast<long unsigned>(nx)};
25 npy::SaveArrayAsNumpy(path->c_str(),
false, shape.size(), shape.data(), *data);
◆ save_numpy< float >()
template void save_numpy< float > |
( |
std::string * |
path, |
|
|
int |
nx, |
|
|
int |
ny, |
|
|
std::vector< float > * |
data |
|
) |
| |
◆ save_numpy< std::complex< float > >()
template void save_numpy< std::complex< float > > |
( |
std::string * |
path, |
|
|
int |
nx, |
|
|
int |
ny, |
|
|
std::vector< std::complex< float >> * |
data |
|
) |
| |
◆ v_splitter()
void v_splitter |
( |
float |
thickness, |
|
|
float & |
size0, |
|
|
const float & |
min_h, |
|
|
const float & |
max_h, |
|
|
const float & |
offset |
|
) |
| |
Definition at line 41 of file GuiUtils.cpp.
44 ImGui::PushStyleColor(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_ScrollbarGrab]);
45 ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImGui::GetStyle().Colors[ImGuiCol_ScrollbarGrabHovered]);
46 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImGui::GetStyle().Colors[ImGuiCol_ScrollbarGrabActive]);
47 ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, ImGui::GetStyle().ScrollbarRounding);
48 ImGui::Button(
"v", ImVec2(-1, thickness));
49 ImGui::PopStyleColor(3);
50 ImGui::PopStyleVar(1);
51 if (ImGui::IsItemHovered() || ImGui::IsItemActive())
53 ImGui::SetMouseCursor(ImGuiMouseCursor_ResizeNS);
56 if (ImGui::IsItemActive())
58 float d = ImGui::GetMousePos().y - offset;