The buffer class encapsulates a Genicam buffer that is provided by a stream. More...
#include <buffer.h>
Public Member Functions | |
Buffer (const std::shared_ptr< const GenTLWrapper > &gentl, Stream *parent) | |
Constructs a buffer class as wrapper around a buffer handle. | |
void * | getBase (std::uint32_t part) const |
Returns the base address of the specified part of the multi-part buffer. | |
uint64_t | getChunkLayoutID () const |
Returns the chunk layout id, which serves as an indicator that the chunk layout has changed and the application should parse the chunk layout again. | |
bool | getContainsChunkdata () const |
Returns if the buffer contains chunk data. | |
bool | getDataLargerThanBuffer () const |
Signals if the memory that was allocated for this buffer is too small. | |
size_t | getDataSize () const |
Returns the size of data intended to the written to the buffer the last time it has been filled. | |
size_t | getDeliveredChunkPayloadSize () const |
Returnes the delivered chung payload size. | |
size_t | getDeliveredImageHeight (std::uint32_t part) const |
Returns the number of lines that are delivered in this buffer. | |
std::string | getFilename () const |
Returns the filename in case the payload contains a file. | |
uint64_t | getFrameID () const |
Returns the sequentially incremented number of the frame. | |
void * | getGlobalBase () const |
Returns the global base address of the buffer memory. | |
size_t | getGlobalSize () const |
Returns the global size of the buffer. | |
void * | getHandle () const |
Get internal stream handle. | |
size_t | getHeight (std::uint32_t part) const |
Returns the height of the image in pixel. | |
bool | getImagePresent (std::uint32_t part) const |
Returns if a 2D, 3D or confidence image is present in the specified part. | |
bool | getIsAcquiring () const |
Signals if the buffer is currently being filled with data. | |
bool | getIsIncomplete () const |
Signals if the buffer is incomplete due to an error. | |
bool | getIsQueued () const |
Signals if the buffer is associated to the input or output queue. | |
bool | getNewData () const |
Returns if the buffer contains new data. | |
std::uint32_t | getNumberOfParts () const |
Returns the number of parts, excluding chunk data. | |
size_t | getPartDataType (uint32_t part) const |
Returns the data type id of the specified part as defined in PARTDATATYPE_IDS. | |
uint64_t | getPartSourceID (std::uint32_t part) const |
Returns the source id of the specified part. | |
size_t | getPayloadType () const |
Returns the payload type according to PAYLOADTYPE_INFO_IDS. | |
uint64_t | getPixelFormat (std::uint32_t part) const |
Returns the pixel format of the specified part as defined in the PFNC. | |
uint64_t | getPixelFormatNamespace (std::uint32_t part) const |
Returns the pixel format namespace, which preferably should be PIXELFORMAT_NAMESPACE_PFNC_32BIT. | |
size_t | getSize (std::uint32_t part) const |
Returns the size of the specified part of the mult-part buffer. | |
size_t | getSizeFilled () const |
Returns the number of bytes written into the buffer last time it has been filled. | |
uint64_t | getTimestamp () const |
Returns the timestamp of the buffer. | |
uint64_t | getTimestampNS () const |
Returns the acquisition timestamp of the data in this buffer in ns. | |
std::string | getTLType () const |
Returns the type the used transport layer. | |
void * | getUserPtr () const |
Returns the private data pointer of the GenTL Consumer. | |
size_t | getWidth (std::uint32_t part) const |
Returns the width of the image in pixel. | |
size_t | getXOffset (std::uint32_t part) const |
Returns the horizontal offset of the data in the buffer in pixels from the image origin to handle areas of interest. | |
size_t | getXPadding (std::uint32_t part) const |
Returns horizontal padding of the data in the buffer in bytes. | |
size_t | getYOffset (std::uint32_t part) const |
Returns the vertical offset of the data in the buffer in lines from the image origin to handle areas of interest. | |
size_t | getYPadding () const |
Returns vertical padding of the data in the buffer in bytes. | |
bool | isBigEndian () const |
Returns if the data is given as big or little endian. | |
void | setHandle (void *handle) |
Set the buffer handle that this object should manage. | |
Private Member Functions | |
Buffer (class Buffer &) | |
Buffer & | operator= (const Buffer &) |
Private Attributes | |
void * | buffer |
std::shared_ptr< const GenTLWrapper > | gentl |
bool | multipart |
Stream * | parent |
The buffer class encapsulates a Genicam buffer that is provided by a stream.
A multi-part buffer with one image can be treated like a "normal" buffer.
NOTE: A GenTLException is thrown in case of a severe error.
rcg::Buffer::Buffer | ( | const std::shared_ptr< const GenTLWrapper > & | gentl, |
Stream * | parent | ||
) |
rcg::Buffer::Buffer | ( | class Buffer & | ) | [private] |
void * rcg::Buffer::getBase | ( | std::uint32_t | part | ) | const |
uint64_t rcg::Buffer::getChunkLayoutID | ( | ) | const |
bool rcg::Buffer::getContainsChunkdata | ( | ) | const |
bool rcg::Buffer::getDataLargerThanBuffer | ( | ) | const |
size_t rcg::Buffer::getDataSize | ( | ) | const |
Returns the size of data intended to the written to the buffer the last time it has been filled.
If the buffer is incomplete, the number reports the full size of the original data including the lost parts. If the buffer is complete, the number equals getSizeFilled().
size_t rcg::Buffer::getDeliveredChunkPayloadSize | ( | ) | const |
size_t Buffer::getDeliveredImageHeight | ( | std::uint32_t | part | ) | const |
Returns the number of lines that are delivered in this buffer.
For areea cameras, this is typically the same as the specified image height. For linescan cameras it can be less.
part | Part index, which is ignored if the buffer is not multi-part. |
std::string rcg::Buffer::getFilename | ( | ) | const |
uint64_t rcg::Buffer::getFrameID | ( | ) | const |
Another important change is to use the new method Buffer::getGlobalBase | ( | ) | const |
size_t rcg::Buffer::getGlobalSize | ( | ) | const |
void * rcg::Buffer::getHandle | ( | ) | const |
size_t Buffer::getHeight | ( | std::uint32_t | part | ) | const |
bool Buffer::getImagePresent | ( | std::uint32_t | part | ) | const |
bool rcg::Buffer::getIsAcquiring | ( | ) | const |
bool rcg::Buffer::getIsIncomplete | ( | ) | const |
bool rcg::Buffer::getIsQueued | ( | ) | const |
bool rcg::Buffer::getNewData | ( | ) | const |
Roboception GenICam Convenience changing their configuration and streaming images Although the tools are meant to be useful when working in a shell or in a their main purpose is to serve as example on how to use the API for reading and setting streaming and synchronizing images API changes in version Version introduced some API changes that require minor changes of programs that use the classes Image and ImageList An object of class Buffer can now represents a single buffer as well as a multipart buffer depending on the availability of multipart support in the used GenTL producer and the GigE vision device Multipart buffers can contain more than one image For simplicity of the interface non multipart buffers are now treated like multipart buffers with just one image For writing code that is able to support multipart after grabbing the buffer the number of parts must be requested with the method Buffer::getNumberOfParts | ( | ) | const |
size_t Buffer::getPartDataType | ( | uint32_t | part | ) | const |
uint64_t Buffer::getPartSourceID | ( | std::uint32_t | part | ) | const |
Returns the source id of the specified part.
Images with the same source id are supposed to belong pixelwise together.
part | Part index, which is ignored if the buffer is not multi-part. |
size_t rcg::Buffer::getPayloadType | ( | ) | const |
uint64_t Buffer::getPixelFormat | ( | std::uint32_t | part | ) | const |
Returns the pixel format of the specified part as defined in the PFNC.
The pixel formats are defined in pixel_formats.h and PFNC.h if getPixelFormatNamespace() returns PIXELFORMAT_NAMESPACE_PFNC_32BIT.
part | Part index, which is ignored if the buffer is not multi-part. |
uint64_t Buffer::getPixelFormatNamespace | ( | std::uint32_t | part | ) | const |
size_t rcg::Buffer::getSize | ( | std::uint32_t | part | ) | const |
size_t rcg::Buffer::getSizeFilled | ( | ) | const |
uint64_t rcg::Buffer::getTimestamp | ( | ) | const |
uint64_t rcg::Buffer::getTimestampNS | ( | ) | const |
std::string rcg::Buffer::getTLType | ( | ) | const |
void * rcg::Buffer::getUserPtr | ( | ) | const |
size_t Buffer::getWidth | ( | std::uint32_t | part | ) | const |
size_t Buffer::getXOffset | ( | std::uint32_t | part | ) | const |
size_t Buffer::getXPadding | ( | std::uint32_t | part | ) | const |
size_t Buffer::getYOffset | ( | std::uint32_t | part | ) | const |
size_t rcg::Buffer::getYPadding | ( | ) | const |
bool rcg::Buffer::isBigEndian | ( | ) | const |
void rcg::Buffer::setHandle | ( | void * | handle | ) |
void* rcg::Buffer::buffer [private] |
std::shared_ptr<const GenTLWrapper> rcg::Buffer::gentl [private] |
bool rcg::Buffer::multipart [private] |
Stream* rcg::Buffer::parent [private] |