Back to Aurora Vision Library website

You are here: Start » Function Reference » Image » Image IO » SaveImage_Asynchronous

SaveImage_Asynchronous


Header: AVL.h
Namespace: avl
Module: FoundationLite

Saves an image to a file in the background thread.

Syntax

C++
C#
 
void avl::SaveImage_Asynchronous
(
	SaveImageState& ioState,
	int inThreadQueueSize,
	const avl::Image& inImage,
	atl::Optional<avl::ImageFileFormat::Type> inImageFileFormat,
	const atl::File& inFile,
	bool inIgnoreErrors
)

Parameters

Name Type Range Default Description
Input will be modified ioState SaveImageState& Object used to maintain state of the function.
Input value inThreadQueueSize int 1 - 3 Number of incoming frames that can be buffered before the thread is able to process them
Input value inImage const Image& An image to be saved
Input value inImageFileFormat Optional<ImageFileFormat::Type> NIL If Nil the format will be chosen on the basis of extension
Input value inFile const File& Path to a file
Input value inIgnoreErrors bool If false the error will be reported as soon as the filter instance is again executed

Description

The operation saves an image to file encoded in one of the standard image file formats. Currently the filter supports the following formats:

  • BMP (*.bmp)
  • JPEG (*.jpg, *jpeg)
  • PNG (*.png),
  • PNM (*.pbm, *.pgm, *.ppm, *.pnm),
  • TIFF (*.tif, *.tiff).

Because of the limitations of the standard image formats, the filter is capable of saving three-channel images of UInt8 pixel type for all formats, and UInt16 for supported formats only (PNG, TIFF). To alter the format of an image one can use the filters contained in the Image Conversions category.

The inImageFileFormat input can be used to explicitly select the file format to be used. When inImageFileFormat is set to Auto the recognition of the desired image file format is based on the extension of the file being written, so it is essential that the extension is present and accurate. When extension of the file is not specified, it will be appended according to inImageFileFormat.

If the selected file does not exist, it will be created on filter execution. If the selected file does exist, it will be overwritten.

Remarks

This filter is executed in the background thread. Execution errors may be reported with a delay or ignored. Stopping of the program may be delayed, because of waiting for background work to complete.

Errors

List of possible exceptions:

Error type Description
DomainError Unsupported pixel type in SaveImage_Asynchronous.

See Also

  • LoadImage – Loads a single image from a file.