MayaFlux 0.4.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 636 of file ImageReader.cpp.

637{
638 auto image_data = load(path, 4);
639 if (!image_data) {
640 return nullptr;
641 }
642
644 auto texture = mgr.create_2d(
645 image_data->width,
646 image_data->height,
647 image_data->format,
648 image_data->data());
649
650 if (texture) {
652 "Created GPU texture from image: {}", path);
653 }
654
655 return texture;
656}
#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: