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

◆ save_image() [1/2]

MAYAFLUX_API bool MayaFlux::save_image ( const std::shared_ptr< Buffers::TextureBuffer > &  buffer,
const std::string &  suggested_name,
const IO::ImageWriteOptions options 
)

Present a native save-file dialog filtered to image formats and save buffer to the chosen path via IOManager::save_image().

Blocks until the user confirms or cancels. The encode task is queued asynchronously. Returns false on cancellation, backend error, or if Portal::System is not initialized.

Parameters
bufferSource TextureBuffer to encode.
suggested_nameFilename pre-filled in the dialog name field.
optionsFormat-specific writer options forwarded to IOManager.

Definition at line 230 of file Depot.cpp.

234{
235 if (!require_portal("save_image"))
236 return false;
237
238 auto iom = get_io_manager();
239 if (!iom) {
240 MF_ERROR(Journal::Component::API, Journal::Context::Runtime,
241 "save_image: IOManager unavailable");
242 return false;
243 }
244
245 return Portal::System::Dialog::save_file<bool>(
246 [&iom, &buffer, &options](const fs::path& p) {
247 return iom->save_image(buffer, p.string(), options);
248 },
249 [](Core::SystemDialogError) { },
250 suggested_name,
251 k_image_save_filters);
252}
#define MF_ERROR(comp, ctx,...)
std::shared_ptr< IO::IOManager > get_io_manager()
Retrieves the global IOManager instance for file loading and buffer management.
Definition Depot.cpp:256

References MayaFlux::Journal::API, get_io_manager(), MF_ERROR, and MayaFlux::Journal::Runtime.

+ Here is the call graph for this function: