#include <peak_icv/io/peak_icv_image_writer.hpp>
|
| void | Write (const std::string &filePath, const Image &image) const |
| | Writes the specified image to the filesystem. The type is specified by the given file ending in file name.
|
| |
Writes an image to a file.
- Since
- 1.0
Definition at line 28 of file peak_icv_image_writer.hpp.
◆ Write()
| void Write |
( |
const std::string & | filePath, |
|
|
const Image & | image ) const |
|
inline |
Writes the specified image to the filesystem. The type is specified by the given file ending in file name.
The following image formats are supported:
- Portable Network Graphics (PNG)
- Bitmap (BMP)
- Joint Photographic Experts Group (JPEG)
- Tag Image File Format (TIFF)
- Raw Binary Format (RAW)
- The compression settings for PNG and JPEG images are as follows: For JPEG, the image quality is set to 75%, and for PNG, the image quality is set to 100%.
- Note
- The file extension for the given file name must match the specified image format when an image is saved. Otherwise an error will occur when saving an image. The file extensions are:
- PNG: .png
- BMP: .bmp
- JPEG: .jpeg
- TIFF: .tiff
- RAW: .raw
Supported image and pixel formats
Bitmap
Not all image formats can be written to a Bitmap file. Supported image formats are:
- Mono8
- Mono10
- Mono12
- Mono16
- RGB8
- BGR8
- RGBa8
- BGRa8
PNG
Not all image formats can be written to a PNG file. Supported image formats are:
- Mono8
- Mono10
- Mono12
- Mono16
- RGB8
- RGBa8
Written as RGB:
- BGR8
- BGRa8
TIFF
Not all image formats can be written to a TIFF file. Supported image formats are:
- Mono8
- Mono10
- Mono12
- Mono16
- RGB8
- Coord3D_C32f
- Coord3D_ABC32f
JPEG
Not all image formats can be written to a JPEG file. Supported image formats are:
- Mono8
- RGB8
- BGR8
- RGBa8
- BGRa8
RAW
Not all image formats can be written to a TIFF file. Supported image formats are:
- Mono8
- Mono10
- Mono12
- Mono16
- RGB8
- BGR8
- RGBa8
- BGRa8
- Parameters
-
| [in] | filePath | The path of the file to store the image to as an UTF-8 encoded string. |
| [in] | image | The image to save. |
- Exceptions
-
| NotSupportedException | The file ending or the pixel format is not supported to write to file. |
| IOException | If the specified file path is invalid or you lack the necessary permissions. |
- Since
- 1.0
Definition at line 129 of file peak_icv_image_writer.hpp.