IDS peak genericC++  v1.6.1
peak Namespace Reference

The "peak" namespace directly contains convenience functionality like the DeviceManager as well as the global Library::Initialize() / Library::Close() functions, which must be called before/after usage of the library. More...

Namespaces

 core
 The "core" namespace contains the direct GenAPI and GenTL wrapper.
 
 dynamic
 

Classes

class  DeviceManager
 The global DeviceManager (singleton) searches all installed producer libraries (*.cti) and enumerates the modules contained in them. More...
 
class  Library
 A collection of global library functions. More...
 

Functions

template<>
peak::ipl::Image BufferTo< peak::ipl::Image > (const std::shared_ptr< peak::core::Buffer > &buffer)
 Converts a core::Buffer into a peak::ipl::Image. More...
 
template<class OutType >
OutType BufferTo (const std::shared_ptr< peak::core::Buffer > &buffer)
 Converts a core::Buffer into a different type. More...
 

Detailed Description

The "peak" namespace directly contains convenience functionality like the DeviceManager as well as the global Library::Initialize() / Library::Close() functions, which must be called before/after usage of the library.

Function Documentation

◆ BufferTo()

template<class OutType >
OutType peak::BufferTo ( const std::shared_ptr< peak::core::Buffer > &  buffer)

Converts a core::Buffer into a different type.

This function converts the buffer into the format requested as template argument. Implement a template specialization for your custom data type yourself. For an example, have a look at the implementation to convert the buffer to a peak::ipl::Image, i.e. see file converters/peak_buffer_converter_ipl.hpp.

Usage:

auto image = peak::BufferTo<CustomImageType>(buffer);
Parameters
[in]bufferA core::Buffer that contains image data.
Returns
Image data in the requested image container/class.
Since
1.0
Exceptions
InvalidArgumentExceptionThe given buffer is invalid.
InternalErrorExceptionAn internal error has occurred.

◆ BufferTo< peak::ipl::Image >()

template<>
peak::ipl::Image peak::BufferTo< peak::ipl::Image > ( const std::shared_ptr< peak::core::Buffer > &  buffer)
inline

Converts a core::Buffer into a peak::ipl::Image.

This creates a peak::ipl::Image as a shallow copy of the buffer (i.e. using the same memory). Remember that the buffer's memory is only under your control until you re-queue the buffer.

Note
To use this method, this file needs to be included explicitly:
#include <peak/converters/peak_buffer_converter_peak_ipl_.hpp>