Elaztek Developer Hub
Blamite Game Engine - Strings  00430.01.19.25.2136.blamite
A library containing general purpose utilities and classes for use in multiple projects.
BlamStrings::Utils::Image Namespace Reference

Utilities relating to working with images. More...

Functions

STRINGS_API bool LoadImageFromFile (std::string file_path, SailPixelFormat pixel_format, void **address, int *data_size, int *bytes_per_line=nullptr, int *size_x=nullptr, int *size_y=nullptr)
 Attempts to load an image file's pixel data into memory. More...
 

Detailed Description

Utilities relating to working with images.

Function Documentation

◆ LoadImageFromFile()

bool BlamStrings::Utils::Image::LoadImageFromFile ( std::string  file_path,
SailPixelFormat  pixel_format,
void **  address,
int *  data_size,
int *  bytes_per_line = nullptr,
int *  size_x = nullptr,
int *  size_y = nullptr 
)

Attempts to load an image file's pixel data into memory.

Parameters
file_path- The file path of the image to load.
pixel_format- The desired pixel format. The loaded image data will be converted to this format if needed.
address- Output parameter. Will be set to the address of the loaded pixel data if loading is successful.
data_size- Optional output parameter. The size of the pixel data, in bytes.
bytes_per_line- Optional output parameter. The number of bytes per row of pixels within the image data.
size_x- Optional output parameter. The width of the image, in pixels.
size_y- Optional output parameter. The height of the image, in pixels.
Returns
true if the image was loaded successfully, otherwise returns false.
+ Here is the call graph for this function: