IDS peak ICV v1.3.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

Compression settings:

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

Supported pixel formats per image format

BMP:

  • Mono8
  • Mono10
  • Mono12
  • Mono16
  • RGB8
  • RGBa8
  • BGR8
  • BGRa8
  • 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
Note
When saving BGR formats to PNG, they are written as RGB.

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
Note
When saving floating‑point images to TIFF: Not all image viewers support displaying TIFF files that store floating‑point pixel data. The saved TIFF file is intended primarily as a data container that allows this library to reliably write and later re‑read the data.

RAW:

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

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 292 of file peak_icv_image_writer.hpp.