IDS peak ICV v1.2.0
Loading...
Searching...
No Matches
ImageWriter Class Reference

#include <peak_icv/io/peak_icv_image_writer.hpp>

Public Member Functions

void Write (const std::string &filePath, const Image &image) const
 Saves the specified image to a file.
 

Detailed Description

Provides functionality to write images to files in various supported formats.

Since
ids_peak_icv 1.0

Definition at line 30 of file peak_icv_image_writer.hpp.

Member Function Documentation

◆ Write()

void Write ( const std::string & filePath,
const Image & image ) const
inline

Saves the specified image to a file.

The file format is determined by the specified file extension of the file name.

Supported image formats (with required file extensions):

  • PNG (.png) – Portable Network Graphics
  • BMP (.bmp) – Bitmap
  • JPEG (.jpeg) – Joint Photographic Experts Group
  • TIFF (.tiff) – Tag Image File Format
  • RAW (.raw) – Raw Binary Format
Note
The file extension of the specified file name must match the chosen image format. Mismatched extensions will cause an error on saving.

Compression settings:

  • JPEG: 75% quality
  • PNG: 100% quality

Supported pixel formats per image format

BMP:

  • Mono8
  • Mono10
  • Mono12
  • Mono16
  • RGB8
  • RGBa8
  • RGB10p32
  • BGR8
  • BGRa8
  • BGR10p32
  • BayerRG8
  • BayerRG10
  • BayerRG12
  • BayerGR8
  • BayerGR10
  • BayerGR12
  • BayerBG8
  • BayerBG10
  • BayerBG12
  • BayerGB8
  • BayerGB10
  • BayerGB12
  • Confidence8
  • Confidence16
  • Coord3D_C8
  • Coord3D_C16

JPEG:

  • Mono8
  • RGB8
  • RGBa8
  • BGR8
  • BGRa8
  • BayerRG8
  • BayerGR8
  • BayerBG8
  • BayerGB8

PNG:

  • Mono8
  • Mono10
  • Mono12
  • Mono16
  • RGB8
  • RGB10
  • RGB12
  • RGBa8
  • RGBa10
  • RGBa12
  • BGR8
  • BGR10
  • BGRa8
  • BGR12
  • BGRa10
  • BGRa12
  • BayerRG8
  • BayerRG10
  • BayerRG12
  • BayerGR8
  • BayerGR10
  • BayerGR12
  • BayerBG8
  • BayerBG10
  • BayerBG12
  • BayerGB8
  • BayerGB10
  • BayerGB12
  • Confidence8
  • Confidence16
  • Coord3D_C8
  • Coord3D_C16

TIFF:

  • BayerGR8
  • BayerGR10
  • BayerGR12
  • BayerRG8
  • BayerRG10
  • BayerRG12
  • BayerGB8
  • BayerGB10
  • BayerGB12
  • BayerBG8
  • BayerBG10
  • BayerBG12
  • Mono8
  • Mono10
  • Mono12
  • Mono16
  • Confidence8
  • Confidence16
  • Coord3D_C8
  • Coord3D_C16
  • Coord3D_C32f
  • Coord3D_ABC32f
  • RGB8
  • RGB10
  • RGB12
  • Mono32fIDS
  • RGB32fIDS

RAW:

  • BayerGR8
  • BayerGR10
  • BayerGR12
  • BayerRG8
  • BayerRG10
  • BayerRG12
  • BayerGB8
  • BayerGB10
  • BayerGB12
  • BayerBG8
  • BayerBG10
  • BayerBG12
  • Mono8
  • Mono10
  • Mono12
  • Mono16
  • Confidence8
  • Confidence16
  • Coord3D_C8
  • Coord3D_C16
  • Coord3D_C32f
  • Coord3D_ABC32f
  • YUV420_8_YY_UV_SemiplanarIDS
  • YUV420_8_YY_VU_SemiplanarIDS
  • YUV422_8_UYVY
  • RGB8
  • RGB10
  • RGB12
  • BGR8
  • BGR10
  • BGR12
  • RGBa8
  • RGBa10
  • RGBa12
  • BGRa8
  • BGRa10
  • BGRa12
  • BayerBG10p
  • BayerBG12p
  • BayerGB10p
  • BayerGB12p
  • BayerGR10p
  • BayerGR12p
  • BayerRG10p
  • BayerRG12p
  • Mono10p
  • Mono12p
  • RGB10p32
  • BGR10p32
  • BayerRG10g40IDS
  • BayerGB10g40IDS
  • BayerGR10g40IDS
  • BayerBG10g40IDS
  • BayerRG12g24IDS
  • BayerGB12g24IDS
  • BayerGR12g24IDS
  • BayerBG12g24IDS
  • Mono10g40IDS
  • Mono12g24IDS

See the Pixel and Pixel Format Specifications for a detailed description of the pixel formats.

Parameters
[in]filePathThe path of the file to write to, as a UTF-8 encoded string.
[in]imageThe image to save.
Exceptions
NotSupportedExceptionThe specified file extension or pixel format is not supported.
IOExceptionThe specified file path is invalid or lacks write permissions.
Since
ids_peak_icv 1.0

Definition at line 320 of file peak_icv_image_writer.hpp.