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

◆ save_volume() [2/2]

bool MayaFlux::IO::save_volume ( const std::shared_ptr< Buffers::VolumeGridBuffer > &  volume,
const std::string &  filepath,
const VolumeWriteOptions options = {},
const std::vector< std::string > &  field_names = {} 
)

Save a volume directly to disk via the VolumeWriter registry.

Combines download_volume() with VolumeWriterRegistry::create_writer(). The file extension selects the writer. Whether a given writer can express a given field is the writer's responsibility: a format with no vector grid type rejects a vector field rather than dropping it.

Inherits download_volume's thread requirements.

Parameters
volumeVolume to save.
filepathDestination path with extension.
optionsFormat-specific writer options.
field_namesFields to save. Empty means every declared field.
Returns
True on success.

Definition at line 217 of file VolumeTransfer.cpp.

222{
223 auto data = download_volume(volume, field_names);
224 if (!data) {
225 return false;
226 }
227
228 return save_volume(*data, filepath, options);
229}
std::optional< Kakshya::VolumeData > download_volume(const std::shared_ptr< Buffers::VolumeGridBuffer > &volume, const std::vector< std::string > &field_names)
Download named fields from a GPU-resident volume into host VolumeData.
bool save_volume(const std::shared_ptr< Buffers::VolumeGridBuffer > &volume, const std::string &suggested_name)
Present a native save-file dialog filtered to volume formats and save volume to the chosen path via I...
Definition Depot.cpp:346

References download_volume(), and save_volume().

+ Here is the call graph for this function: