MxEngine
Public Types | Static Public Member Functions | List of all members
MxEngine::ImageLoader Class Reference

#include <ImageLoader.h>

Public Types

using ImageArray = std::array< Array2D< unsigned char >, 6 >
 

Static Public Member Functions

static Image LoadImage (const MxString &filepath, bool flipImage=true)
 
static ImageArray CreateCubemap (const Image &image)
 

Detailed Description

ImageLoader class is used to load images from disk. Also it contains methods to create cubemaps from their scans

Member Function Documentation

§ CreateCubemap()

ImageLoader::ImageArray MxEngine::ImageLoader::CreateCubemap ( const Image image)
static

creates cubemap projections from its scan: X XXXX X

Parameters
imageimage from which cubemap will be created
Returns
6 2d arrays of raw image data (can be passed as individual images to OpenGL)

§ LoadImage()

Image MxEngine::ImageLoader::LoadImage ( const MxString &  filepath,
bool  flipImage = true 
)
static

loads image from disk. As OpenGL treats images differently as expected, all images are flipped automatically

Parameters
filepathpath to an image on disk
flipImageshould the image be vertically flipped. As MxEngine uses primarily OpenGL, usually you want to do this
Returns
Image object if image file exists or nullptr data and width = height = channels = 0 if not

The documentation for this class was generated from the following files: