IDS peak IPL  v1.4.0
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. More...
 
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. More...
 

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.
Exceptions
ImageFormatNotSupportedExceptionAn image format of this file is not supported
IOExceptionErrors during file access e.g. no permissions on this file
InvalidArgumentExceptionArguments passed are invalid
ExceptionAn internal error has occurred
Since
1.0

◆ 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 is not possible an exception is thrown. Explicit conversion of image formats must be done manually.

Parameters
[in]filePathThe path to the file to read.
[in]pixelFormatThe Pixel format the retrieved image should have afterwards.
Exceptions
ImageFormatInterpretationExceptionCan not interpret this file with the given pixel format
ImageFormatNotSupportedExceptionAn image format of this file is not 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 packed pixel format

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