EGrabber Reference  9.5.2.131
Public Member Functions | List of all members
Buffer

Represents a GenTL buffer. More...

#include <EGrabber.h>

Public Member Functions

 Buffer (const NewBufferData &data)
 Create a Buffer object encapsulating a GenTL buffer. More...
 
void push (Internal::EGrabberBase &grabber)
 Push the GenTL buffer back to the data stream input fifo. More...
 
template<typename T >
getInfo (Internal::EGrabberBase &grabber, gc::BUFFER_INFO_CMD cmd)
 Get buffer information. More...
 
void * getUserPointer ()
 Get the user pointer provided when the GenTL buffer was announced (if any) More...
 
void saveToDisk (Internal::EGrabberBase &grabber, const std::string &filepath, int64_t index=-1, const ge::ImageSaveToDiskParams *params=0)
 Save the buffer content to disk. More...
 

Detailed Description

Represents a GenTL buffer.

See also
EGrabber<CallbackOnDemand>::pop()

Constructor & Destructor Documentation

Buffer ( const NewBufferData data)

Create a Buffer object encapsulating a GenTL buffer.

Parameters
datadata from the callback EGrabber::onNewBufferEvent

Member Function Documentation

void push ( Internal::EGrabberBase &  grabber)

Push the GenTL buffer back to the data stream input fifo.

Parameters
grabberthe grabber managing the underlying GenTL buffer to push back
T getInfo ( Internal::EGrabberBase &  grabber,
gc::BUFFER_INFO_CMD  cmd 
)

Get buffer information.

Template Parameters
TThe C++ type corresponding to the type (GenTL::INFO_DATATYPE_LIST) of data to get
Parameters
grabberthe grabber managing the underlying GenTL buffer to query
cmdcmd values belong to either GenTL::BUFFER_INFO_CMD_LIST or GenTL::EuresysCustomGenTL::BUFFER_INFO_CUSTOM_CMD_LIST
void* getUserPointer ( )

Get the user pointer provided when the GenTL buffer was announced (if any)

void saveToDisk ( Internal::EGrabberBase &  grabber,
const std::string &  filepath,
int64_t  index = -1,
const ge::ImageSaveToDiskParams params = 0 
)

Save the buffer content to disk.

Parameters
grabberthe grabber managing the underlying GenTL buffer to save to disk
filepathpath or path pattern
  • path of the new image file, the file extension determines the file format
  • path pattern where a group characters 'N' is replaced by the value of index:
    • if index is 5, N becomes 5
    • if index is 9, NN becomes 09
    • if index is 10, NN becomes 10
      for (size_t i = 0; i < 20; ++i) {
      buffer[i]->saveToDisk(grabber, "images/buffer.NNN.jpeg", i);
      }
index
  • if index >= 0, enable pattern substitution with given index value
  • if index < 0, disable pattern substitution
paramsoptional parameters (see GenTL::EuresysCustomGenTL::ImageSaveToDiskParams)
Precondition
the parent directory must exist
Note
buffer informations (address, width, height, format) are automatically queried
no buffer conversion will be applied before writing the image file, please use the RGBConverter if needed
See also
EuresysImage.h

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