#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <ft2build.h>
#include <FT_FREETYPE_H>
#include "Visualizer.h"
Go to the source code of this file.
Functions | |
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) |
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. | |
bool | validateTextureFile (const std::string &texture_file, bool pngonly) |
Validates the given texture file. | |
Visualizer core functions including constructors, initialization, and utility functions.
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 VisualizerCore.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.
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 | ||
) |
Definition at line 76 of file VisualizerCore.cpp.