IDS peak IPL v1.11.0
Loading...
Searching...
No Matches
peak::ipl::ImageReader Class Referencefinal

Reads an image from a file. More...

#include <peak_ipl/io/peak_ipl_image_reader.hpp>

Public Member Functions

 ImageReader ()=delete
 

Static Public Member Functions

static Image Read (const std::string &filePath)
 Returns a new created image which is read from the file with the given file path.
 
static Image Read (const std::string &filePath, const peak::ipl::PixelFormat &pixelFormat)
 Returns a new created image which is read from the file with the given file path.
 

Detailed Description

Reads an image from a file.

Supported Formats are currently: JPEG, PNG and BMP

Constructor & Destructor Documentation

◆ ImageReader()

peak::ipl::ImageReader::ImageReader ( )
delete

Member Function Documentation

◆ Read() [1/2]

Image peak::ipl::ImageReader::Read ( const std::string &  filePath)
inlinestatic

Returns a new created image which is read from the file with the given file path.

The format is specified by the file ending.

Parameters
[in]filePathThe path to the file to read as an UTF-8 encoded string.
Exceptions
ImageFormatNotSupportedExceptionAn image format of this file isn't supported
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

◆ Read() [2/2]

peak::ipl::Image peak::ipl::ImageReader::Read ( const std::string &  filePath,
const peak::ipl::PixelFormat &  pixelFormat 
)
inlinestatic

Returns a new created image which is read from the file with the given file path.

The Pixel format to use is specified manually here. The function tries to interpret the file with the given format. If this isn't possible, an exception is thrown. Explicit conversion of image formats must be done manually.

Parameters
[in]filePathThe path to the file to read as an UTF-8 encoded string.
[in]pixelFormatThe Pixel format the retrieved image should have afterwards.
Exceptions
ImageFormatInterpretationExceptionCan't interpret this file with the given pixel format
ImageFormatNotSupportedExceptionAn image format of this file isn't supported
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 pixelFormat is a packed pixel format
1.6 Defined character encoding UTF-8

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