All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
Pylon::IChunkParser Interface Referenceabstract

Low Level API: The interface for chunk parsers analyzing a data stream consisting of chunks. More...

#include <pylon/ChunkParser.h>

Inheritance diagram for Pylon::IChunkParser:
Inheritance graph
[legend]

Public Member Functions

virtual void AttachBuffer (const void *pBuffer, int64_t BufferLength, GenApi::AttachStatistics_t *pAttachStatistics=NULL)=0
 Pass in a buffer and let the chunk parser analyze it. More...
 
virtual void DetachBuffer ()=0
 Detaches a buffer from the chunk parser. The buffer will no longer accessed by the chunk parser. More...
 
virtual void UpdateBuffer (const void *pBaseAddress)=0
 Pass in a buffer and let the chunk parser update the camera object's parameters. More...
 
virtual bool HasCRC () const =0
 Checks if buffer has a CRC attached. More...
 
virtual bool CheckCRC () const =0
 Checks CRC sum of buffer. More...
 

Detailed Description

Low Level API: The interface for chunk parsers analyzing a data stream consisting of chunks.

When chunk data is enabled in the camera the stream sends additional data along with the image. This data needs to be extracted with help of a chunk parser. These are created using the camera's member function IPylonDevice::CreateChunkParser().

When an image buffer containing chunked data is passed to a chunk parser, the camera's chunk related parameters are updated. After changing the data layout either by changing the AOI or enabling/disabling chunk features the parser needs to be reinitialized by calling IChunkParser::AttachBuffer(). Thereafter buffers with the same layout are processed with the IChunkParser::UpdateBuffer() method. Chunk related properties remain unchanged until a new buffer is passed in.

After usage return the chunk parser with a call of the camera's IPylonDevice::DestroyChunkParser() member function.

The code snippet below demonstrates the usage of a chunk parser. A complete program is found in the sample AcquireSingleFrame_ChunkImage.

Note
Check the payload type of the GrabResult_t before attaching or updating the buffer.
IChunkParser &ChunkParser = *Camera.CreateChunkParser();
// enable Frame Counter chunk
Camera.ChunkModeActive.SetValue( true );
Camera.ChunkSelector.SetValue( ChunkSelector_Framecounter );
Camera.ChunkEnable.SetValue( true );
// retrieve data from the chunk
GrabResult Result;
if (StreamGrabber.RetrieveResult( Result ) &&
Result.Succeeded() &&
Result.PayloadType() == PayloadType_ChunkData)
{
ChunkParser.AttachBuffer( Result.Buffer(), Result.GetPayloadSize() );
int64_t frameCounter = Camera.ChunkFramecounter.GetValue();
}

Member Function Documentation

virtual void Pylon::IChunkParser::AttachBuffer ( const void *  pBuffer,
int64_t  BufferLength,
GenApi::AttachStatistics_t pAttachStatistics = NULL 
)
pure virtual

Pass in a buffer and let the chunk parser analyze it.

Corresponding parameters of the camera object reflecting the chunked data will be updated.

Parameters
pBufferPointer to the new buffer
BufferLengthSize of the new buffer in bytes
pAttachStatistics(optional) Pointer to a record taking statistic data of the analyzed buffer

Implemented in Pylon::CChunkParser.

virtual bool Pylon::IChunkParser::CheckCRC ( ) const
pure virtual

Checks CRC sum of buffer.

Returns
true if the contained CRC equals the computed value.
virtual void Pylon::IChunkParser::DetachBuffer ( )
pure virtual

Detaches a buffer from the chunk parser. The buffer will no longer accessed by the chunk parser.

An attached buffer must be detached before freeing it. When attaching a new buffer, the previous one gets detached automatically.

Implemented in Pylon::CChunkParser.

virtual bool Pylon::IChunkParser::HasCRC ( ) const
pure virtual

Checks if buffer has a CRC attached.

Returns
true if the buffer contains CRC value.
virtual void Pylon::IChunkParser::UpdateBuffer ( const void *  pBaseAddress)
pure virtual

Pass in a buffer and let the chunk parser update the camera object's parameters.

This method can be used when the layout of the chunk data hasn't changed since a previous buffer has been attached to the chunk parser. In this case UpdateBuffer is slightly faster then AttachBuffer, because the buffer's layout is remembered.

Parameters
pBaseAddressPointer to the new buffer

Implemented in Pylon::CChunkParser.


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

pylon 5.0.9
Copyright © 2006-2017 Basler AG (Tue May 30 2017 17:24:58)