0.4.1
Loading...
Searching...
No Matches
ImPlot.hpp
Go to the documentation of this file.
1// This file is part of INSTINCT, the INS Toolkit for Integrated
2// Navigation Concepts and Training by the Institute of Navigation of
3// the University of Stuttgart, Germany.
4//
5// This Source Code Form is subject to the terms of the Mozilla Public
6// License, v. 2.0. If a copy of the MPL was not distributed with this
7// file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9/// @file ImPlot.hpp
10/// @brief ImPlot utilities
11/// @author T. Topp (topp@ins.uni-stuttgart.de)
12/// @date 2024-10-27
13
14#pragma once
15
16#include "implot.h"
17#include <vector>
18#include <cstdint>
19
20namespace NAV
21{
22
23/// @brief Loads the ImPlotStyle from a json file
24/// @param[in] path Path of the file
25/// @param[out] imPlotStyle Object to fill
26void loadImPlotStyleFromConfigFile(const char* path, ImPlotStyle& imPlotStyle);
27
28#ifdef IMGUI_IMPL_OPENGL_LOADER_GL3W
29
30/// Helper class for simple bitmap manipulation (not particularly efficient!)
31struct ImGuiScreenshotImageBuf
32{
33 /// @brief Creates an image from the current OpenGL buffer at the rectangle
34 /// @param[in] x X coordinate
35 /// @param[in] y Y coordinate
36 /// @param[in] w Width
37 /// @param[in] h Height
38 ImGuiScreenshotImageBuf(int x, int y, size_t w, size_t h);
39
40 /// @brief Save as fiel
41 /// @param[in] filename Filename to save as
42 void SaveFile(const char* filename);
43
44 private:
45 /// Removes the alpha channel
46 void RemoveAlpha();
47
48 /// Flip the image
49 void FlipVertical();
50
51 size_t Width = 0; ///< Width
52 size_t Height = 0; ///< Height
53 std::vector<uint32_t> Data; ///< Data buffer
54};
55
56#endif
57
58} // namespace NAV
void loadImPlotStyleFromConfigFile(const char *path, ImPlotStyle &imPlotStyle)
Loads the ImPlotStyle from a json file.
Definition ImPlot.cpp:28