MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ load_texture()

std::shared_ptr< Core::VKImage > MayaFlux::IO::ImageReader::load_texture ( const std::string &  path)
static

Load image directly into GPU texture (static utility)

Parameters
pathImage file path
Returns
Initialized VKImage or nullptr on failure

Definition at line 376 of file ImageReader.cpp.

377{
378 auto image_data = load(path, 4);
379 if (!image_data) {
380 return nullptr;
381 }
382
384 auto texture = mgr.create_2d(
385 image_data->width,
386 image_data->height,
387 image_data->format,
388 image_data->pixels.data());
389
390 if (texture) {
392 "Created GPU texture from image: {}", path);
393 }
394
395 return texture;
396}
#define MF_INFO(comp, ctx,...)
static std::optional< ImageData > load(const std::string &path, int desired_channels=4)
Load image from file (static utility)
@ FileIO
Filesystem I/O operations.
@ IO
Networking, file handling, streaming.
MAYAFLUX_API TextureLoom & get_texture_manager()
Get the global texture manager instance.

References MayaFlux::Journal::FileIO, MayaFlux::Portal::Graphics::get_texture_manager(), MayaFlux::Journal::IO, load(), and MF_INFO.

+ Here is the call graph for this function: