IDS peak IPL v1.17.0
Loading...
Searching...
No Matches
peak::ipl::ImageWriter Class Referencefinal

Writes an image to a file. More...

#include <peak_ipl/io/peak_ipl_image_writer.hpp>

Classes

struct  JPEGParameter
 The Parameter for the JPEG writes, e.g. compression quality. More...
 
struct  PNGParameter
 The parameter for the PNG writes, e.g. compression quality. More...
 

Public Member Functions

 ImageWriter ()=delete
 

Static Public Member Functions

static void WriteAsBMP (const std::string &filePath, const Image &imageToSave)
 Writes the specified image to the filesystem as BMP image.
 
static void WriteAsPNG (const std::string &filePath, const Image &imageToSave, const PNGParameter &parameter=PNGParameter())
 Writes the specified image to the filesystem as PNG image.
 
static void WriteAsJPG (const std::string &filePath, const Image &imageToSave, const JPEGParameter &parameter=JPEGParameter())
 Writes the specified image to the filesystem as JPEG image.
 
static void WriteAsRAW (const std::string &filePath, const Image &imageToSave)
 Writes the specified image to the filesystem as a raw binary image.
 
static void Write (const std::string &filePath, const Image &imageToSave)
 Writes the specified image to the filesystem. The type is specified by the given file ending in file name.
 

Detailed Description

Writes an image to a file.

Supported Formats are currently: JPEG, PNG and BMP and a simple RAW format

Constructor & Destructor Documentation

◆ ImageWriter()

peak::ipl::ImageWriter::ImageWriter ( )
delete

Member Function Documentation

◆ Write()

void peak::ipl::ImageWriter::Write ( const std::string & filePath,
const Image & imageToSave )
inlinestatic

Writes the specified image to the filesystem. The type is specified by the given file ending in file name.

Parameters
[in]filePathThe path of the file to store the image to as an UTF-8 encoded string.
[in]imageToSaveThe image to save.
Exceptions
ImageFormatNotSupportedExceptionA file type is not supported for this image pixel format
IOExceptionErrors during file access e.g. no permissions on this file
InvalidArgumentExceptionArguments passed are invalid
ExceptionAn internal error has occurred
Since
1.0
1.6 Defined character encoding UTF-8

◆ WriteAsBMP()

void peak::ipl::ImageWriter::WriteAsBMP ( const std::string & filePath,
const Image & imageToSave )
inlinestatic

Writes the specified image to the filesystem as BMP image.

Not all image formats can be written to a BMP file. Currently supported for: Mono8, Mono10, Mono12, RGB8, BGR8, RGBa8, BGRa8 Written as Mono: BayerGR8, BayerRG8, BayerGB8, BayerBG8, BayerGR10, BayerRG10, BayerGB10, BayerBG10, BayerGR12, BayerRG12, BayerGB12, BayerBG12 For all other formats an exception is thrown.

Parameters
[in]filePathThe path of the file to store the image to as an UTF-8 encoded string.
[in]imageToSaveThe image to save.
Exceptions
ImageFormatNotSupportedExceptionA file type isn't supported for this image pixel format
IOExceptionErrors during file access e.g. no permissions on this file
InvalidArgumentExceptionArguments passed are invalid
ExceptionAn internal error has occurred
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if imageToSave has a packed pixel format
1.6 Defined character encoding UTF-8

◆ WriteAsJPG()

void peak::ipl::ImageWriter::WriteAsJPG ( const std::string & filePath,
const Image & imageToSave,
const JPEGParameter & parameter = JPEGParameter() )
inlinestatic

Writes the specified image to the filesystem as JPEG image.

Not all image formats can be written to a JPEG file. Currently supported for: Mono8, RGB8, BGR8, RGBa8, BGRa8 Written as Mono: BayerGR8, BayerRG8, BayerGB8, BayerBG8 For all other formats an exception is thrown.

Parameters
[in]filePathThe path of the file to store the image to as an UTF-8 encoded string.
[in]imageToSaveThe image to save.
[in]parameterThe parameter for the JPEG image e.g. compression.
Exceptions
ImageFormatNotSupportedExceptionA file type isn't supported for this image pixel format
IOExceptionErrors during file access e.g. no permissions on this file
InvalidArgumentExceptionArguments passed are invalid
ExceptionAn internal error has occurred
Since
1.0
1.6 Defined character encoding UTF-8

◆ WriteAsPNG()

void peak::ipl::ImageWriter::WriteAsPNG ( const std::string & filePath,
const Image & imageToSave,
const PNGParameter & parameter = PNGParameter() )
inlinestatic

Writes the specified image to the filesystem as PNG image.

Not all image formats can be written to a PNG file. Currently supported for: Mono8, Mono10, Mono12, RGB8, RGB10, RGB12, RGBa8, RGBa10, RGBa12 Written as Mono: BayerGR8, BayerRG8, BayerGB8, BayerBG8, BayerGR10, BayerRG10, BayerGB10, BayerBG10, BayerGR12, BayerRG12, BayerGB12, BayerBG12 Written as RGB: BGR8, BGR10, BGR12, BGRa8, BGRa10, RGBa12 For all other formats an exception is thrown.

Parameters
[in]filePathThe path of the file to store the image to as an UTF-8 encoded string.
[in]imageToSaveThe image to save.
[in]parameterThe parameter for the PNG image e.g. compression.
Exceptions
ImageFormatNotSupportedExceptionA file type isn't supported for this image pixel format
IOExceptionErrors during file access e.g. no permissions on this file
InvalidArgumentExceptionArguments passed are invalid
ExceptionAn internal error has occurred
Since
1.0
1.6 Defined character encoding UTF-8

◆ WriteAsRAW()

void peak::ipl::ImageWriter::WriteAsRAW ( const std::string & filePath,
const Image & imageToSave )
inlinestatic

Writes the specified image to the filesystem as a raw binary image.

This is supported for all non-packed pixel formats.

Parameters
[in]filePathThe path of the file to store the image to as an UTF-8 encoded string.
[in]imageToSaveThe image to save.
Exceptions
ImageFormatNotSupportedExceptionA file type isn't supported for this image pixel format
IOExceptionErrors during file access e.g. no permissions on this file
InvalidArgumentExceptionArguments passed are invalid
ExceptionAn internal error has occurred
Since
1.0
1.2 Will throw ImageFormatNotSupportedException if imageToSave has a packed pixel format
1.6 Defined character encoding UTF-8

The documentation for this class was generated from the following file: