Skip to content


Contains a class that makes the data for one grabbed buffer available.


Contains definitions of pylon types.


class Pylon::CGrabResultData
Makes the data for one grabbed buffer available.

Source code#

//  Basler pylon SDK
//  Copyright (c) 2010-2022 Basler AG
//  Author:  Andreas Gau

#include <pylon/Platform.h>

#ifdef _MSC_VER
#   pragma pack(push, PYLON_PACKING)
#endif /* _MSC_VER */

#include <pylon/PylonBase.h>
#include <pylon/PixelType.h>
#include <pylon/PayloadType.h>
#include <GenApi/GenApiDll.h> // [temporary] namespace alias
#include <GenICamFwd.h>

namespace Pylon
    // Forward declaration
    class CPylonDataContainer;
    class CPylonDataComponent;

    class PYLONBASE_API CGrabResultData
        bool GrabSucceeded() const;

        String_t GetErrorDescription() const;

        uint32_t GetErrorCode() const;

        EPayloadType GetPayloadType() const;

        EPixelType GetPixelType() const;

        uint32_t GetWidth() const;

        uint32_t GetHeight() const;

        uint32_t GetOffsetX() const;

        uint32_t GetOffsetY() const;

        uint32_t GetPaddingX() const;

        uint32_t GetPaddingY() const;

        void* GetBuffer() const;

        size_t GetPayloadSize() const;

        size_t GetBufferSize() const;

        uint64_t GetBlockID() const;

        uint64_t GetTimeStamp() const;

            Uses Pylon::ComputeStride to compute the stride from the result data.

        \return The stride in byte.

        \pre The preconditions of Pylon::ComputeStride must be met.

            Throws an exception if the stride value cannot be computed from the result data.
        bool GetStride( size_t& strideBytes ) const;

            Uses Pylon::ComputeBufferSize to compute the stride from the result data.
            PaddingY is not taken into account.

        \return The buffer size in byte.

        \pre The preconditions of Pylon::ComputeBufferSize must be met.

            Throws an exception if the buffer size cannot be computed from the result data.
        size_t GetImageSize() const;

        intptr_t GetCameraContext() const;

        int64_t GetID() const;

        int64_t GetImageNumber() const;

        int64_t GetNumberOfSkippedImages() const;

        bool IsChunkDataAvailable() const;

        GenApi::INodeMap& GetChunkDataNodeMap() const;

        /* The chunk feature must be supported and activated, otherwise false is returned. */
        bool HasCRC() const;

            Throws an exception if GetHasCRC() is false and chunks are activated.
        bool CheckCRC() const;

        intptr_t GetBufferContext() const;

        CPylonDataContainer GetDataContainer() const;

        size_t GetDataComponentCount() const;

        CPylonDataComponent GetDataComponent( size_t index );

        class CGrabResultDataImpl;
        CGrabResultDataImpl* GetGrabResultDataImpl();
        virtual ~CGrabResultData();

        CGrabResultData( const CGrabResultData& );
        void operator = ( const CGrabResultData& );

        friend class CInstantCamera;

        virtual void Destroy();
        virtual void Initialize();

        // Internal use only. Subject to change without notice.
        friend class CGrabResultDataFactory;
        CGrabResultDataImpl* m_pImpl;

        // The grab result data
        const void*& m_pBuffer;
        size_t& m_bufferSize;
        bool& m_grabSucceeded;
        EPayloadType& m_payloadType;
        EPixelType& m_pixelType;
        uint64_t& m_timeStamp;
        uint32_t& m_width;
        uint32_t& m_height;
        uint32_t& m_offsetX;
        uint32_t& m_offsetY;
        uint32_t& m_paddingX;
        uint32_t& m_paddingY;
        uint64_t& m_payloadSize;
        uint32_t& m_errorCode;
        String_t& m_errorDescription;
        intptr_t& m_cameraContext;
        int64_t& m_ID;
        int64_t& m_imageNumber;
        int64_t& m_skippedImageCount;
        intptr_t& m_bufferContext;
        uint64_t& m_blockId;


#ifdef _MSC_VER
#   pragma pack(pop)
#endif /* _MSC_VER */

#endif /* INCLUDED_GRABRESULTDATA_H_1758952 */

Updated on 5 July 2022 at 15:30:01