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

◆ execute_image_write()

bool MayaFlux::IO::Detail::execute_image_write ( const std::string &  filepath,
const ImageData &  data,
const ImageWriteOptions &  options 
)

Definition at line 182 of file IOTransitions.cpp.

186{
187 auto writer = ImageWriterRegistry::instance().create_writer(filepath);
188 if (!writer) {
189 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
190 "save_image task: no writer registered for '{}'", filepath);
191 return false;
192 }
193 const bool ok = writer->write(filepath, data, options);
194 if (!ok) {
195 MF_ERROR(Journal::Component::IO, Journal::Context::FileIO,
196 "save_image task: writer failed for '{}': {}",
197 filepath, writer->get_last_error());
198 } else {
199 MF_INFO(Journal::Component::IO, Journal::Context::FileIO,
200 "save_image task: wrote '{}'", filepath);
201 }
202 return ok;
203}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)

References MayaFlux::IO::WriterRegistry< Writer >::create_writer(), MayaFlux::Journal::FileIO, MayaFlux::IO::WriterRegistry< Writer >::instance(), MayaFlux::Journal::IO, MF_ERROR, and MF_INFO.

Referenced by MayaFlux::IO::IOManager::save_image(), and MayaFlux::IO::IOManager::save_image().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: