MayaFlux 0.3.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 420 of file ImageReader.cpp.

421{
422 auto image_data = load(path, 4);
423 if (!image_data) {
424 return nullptr;
425 }
426
428 auto texture = mgr.create_2d(
429 image_data->width,
430 image_data->height,
431 image_data->format,
432 image_data->pixels.data());
433
434 if (texture) {
436 "Created GPU texture from image: {}", path);
437 }
438
439 return texture;
440}
#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: