#include "Context.h"
#include <GLFW/glfw3.h>
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "glm/gtx/transform.hpp"
#include "GeometryHandler.h"
#include "Visualizer.h"
Go to the source code of this file.
Data Structures | |
class | Glyph |
Glyph object - 2D matrix shape. More... | |
struct | Shader |
OpenGL Shader data structure. More... | |
struct | Colormap |
RGB color map. More... | |
class | Visualizer |
Class for visualization of simulation results. More... | |
Functions | |
bool | validateTextureFile (const std::string &texture_file, bool pngonly=false) |
Validates the given texture file. | |
void | mouseCallback (GLFWwindow *window, int button, int action, int mods) |
Callback function for mouse button presses. | |
void | cursorCallback (GLFWwindow *window, double x, double y) |
Callback function for mouse cursor movements. | |
void | scrollCallback (GLFWwindow *window, double xoffset, double yoffset) |
Callback function for mouse scroll. | |
int | read_JPEG_file (const char *filename, std::vector< unsigned char > &texture, uint &height, uint &width) |
Reads a JPEG file and extracts its pixel data. | |
int | write_JPEG_file (const char *filename, uint width, uint height, bool print_messages) |
Writes an image to a JPEG file. | |
int | write_JPEG_file (const char *filename, uint width, uint height, const std::vector< helios::RGBcolor > &data, bool print_messages) |
Writes image data to a JPEG file. | |
void | read_png_file (const char *filename, std::vector< unsigned char > &texture, uint &height, uint &width) |
Reads a PNG file and extracts its pixel data. | |
glm::vec3 | glm_vec3 (const helios::vec3 &v) |
int | checkerrors () |
void | check_opengl_errors_safe (const std::string &context) |
Safe error checking that throws exceptions instead of using assert. | |
Visualizer header.
Copyright (C) 2016-2025 Brian Bailey
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Definition in file Visualizer.h.
#define APIENTRY |
Definition at line 24 of file Visualizer.h.
#define GLM_FORCE_RADIANS |
Definition at line 22 of file Visualizer.h.
void check_opengl_errors_safe | ( | const std::string & | context | ) |
Safe error checking that throws exceptions instead of using assert.
Definition at line 1839 of file VisualizerRendering.cpp.
int checkerrors | ( | ) |
Definition at line 1824 of file VisualizerRendering.cpp.
void cursorCallback | ( | GLFWwindow * | window, |
double | x, | ||
double | y | ||
) |
Callback function for mouse cursor movements.
Definition at line 1489 of file VisualizerRendering.cpp.
|
inline |
Definition at line 1465 of file Visualizer.h.
void mouseCallback | ( | GLFWwindow * | window, |
int | button, | ||
int | action, | ||
int | mods | ||
) |
Callback function for mouse button presses.
Definition at line 1463 of file VisualizerRendering.cpp.
int read_JPEG_file | ( | const char * | filename, |
std::vector< unsigned char > & | texture, | ||
uint & | height, | ||
uint & | width | ||
) |
Reads a JPEG file and extracts its pixel data.
This function reads a JPEG file from the specified path, decodes it into RGB pixel data, and populates the provided texture vector with RGBA (Red, Green, Blue, Alpha) values. Each pixel in the texture is represented as four unsigned bytes, with the alpha channel always set to 255 (opaque). The function also outputs the height and width of the image.
[in] | filename | The path to the JPEG file to read. |
[out] | texture | Vector that will be populated with the decoded RGBA pixel data. |
[out] | height | Reference to store the height of the read image. |
[out] | width | Reference to store the width of the read image. |
Definition at line 30 of file VisualizerCore.cpp.
void read_png_file | ( | const char * | filename, |
std::vector< unsigned char > & | texture, | ||
uint & | height, | ||
uint & | width | ||
) |
Reads a PNG file and extracts its pixel data.
This function loads a PNG file and processes its pixel data into a texture format. It also retrieves the dimensions of the image.
[in] | filename | Path to the PNG file to be read. |
[out] | texture | Vector to store the extracted RGBA pixel data as unsigned char values. |
[out] | height | Variable to store the height (in pixels) of the loaded image. |
[out] | width | Variable to store the width (in pixels) of the loaded image. |
Definition at line 85 of file VisualizerCore.cpp.
void scrollCallback | ( | GLFWwindow * | window, |
double | xoffset, | ||
double | yoffset | ||
) |
Callback function for mouse scroll.
Definition at line 1504 of file VisualizerRendering.cpp.
bool validateTextureFile | ( | const std::string & | texture_file, |
bool | pngonly = false |
||
) |
Validates the given texture file.
This function checks whether the provided texture file can be used for loading a texture. If the pngonly flag is set to true, the function specifically validates for PNG file formats.
[in] | texture_file | The path to the texture file to validate. |
[in] | pngonly | [optional] If true, only validates the file for PNG format. Defaults to false. |
Definition at line 997 of file VisualizerCore.cpp.
Writes an image to a JPEG file.
This function captures the current framebuffer content, converts it into a JPEG-compatible data structure, and writes it to the specified file.
[in] | filename | The path to the output JPEG file. |
[in] | width | The width of the image to be written. |
[in] | height | The height of the image to be written. |
[in] | print_messages | [optional] If true, outputs status messages to the console. Defaults to false. |
Definition at line 47 of file VisualizerCore.cpp.
int write_JPEG_file | ( | const char * | filename, |
uint | width, | ||
uint | height, | ||
const std::vector< helios::RGBcolor > & | data, | ||
bool | print_messages | ||
) |
Writes image data to a JPEG file.
This function saves the given image data as a JPEG file to the specified filename, with the provided width and height. Optionally, it can print status messages to the console during the process.
[in] | filename | The name of the file where the image will be saved. |
[in] | width | The width of the image in pixels. |
[in] | height | The height of the image in pixels. |
[in] | data | A vector containing the RGB color data for the image. |
[in] | print_messages | [optional] Whether to print status messages to the console. Defaults to false. |