CGVIS Utils
Loading...
Searching...
No Matches
ImageLoader Namespace Reference

Classes

class  Exception
 Exception type thrown by ImageLoader on failures. More...

Functions

Image load (const std::string &filename, bool flipY=true)
 Load an image file using stb_image.

Function Documentation

◆ load()

Image ImageLoader::load ( const std::string & filename,
bool flipY = true )

Load an image file using stb_image.

Parameters
filenamePath to the image file (formats supported by stb_image).
flipYIf true, flip rows vertically on load (default: true).
Returns
Image with width/height/componentCount set and data copied.
Exceptions
ExceptionIf the file cannot be read/decoded.

The loader preserves the component count reported by stb_image (e.g., 1/2/3/4). On success, pixel bytes are copied into the returned Image and the temporary buffer is freed.

Here is the call graph for this function: