Skip to content

File CameraBase.h

File List > include > CameraBase.h

Go to the documentation of this file

//=============================================================================
// Copyright (c) 2026 FLIR Integrated Imaging Solutions, Inc. All Rights Reserved.
//
// This software is the confidential and proprietary information of FLIR
// Integrated Imaging Solutions, Inc. ("Confidential Information"). You
// shall not disclose such Confidential Information and shall use it only in
// accordance with the terms of the license agreement you entered into
// with FLIR Integrated Imaging Solutions, Inc. (FLIR).
//
// FLIR MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
// SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE, OR NON-INFRINGEMENT. FLIR SHALL NOT BE LIABLE FOR ANY DAMAGES
// SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
// THIS SOFTWARE OR ITS DERIVATIVES.
//=============================================================================

#ifndef FLIR_SPINNAKER_CAMERABASE_H
#define FLIR_SPINNAKER_CAMERABASE_H

#include "Interface/ICameraBase.h"
#include "Interface/IImageList.h"

namespace Spinnaker
{
    class ImagePtr;
    class DeviceEventHandler;
    class ImageEventHandler;

    class SPINNAKER_API CameraBase : public ICameraBase
    {
      public:
        virtual ~CameraBase(void);

        void Init();

        void DeInit();

        bool IsInitialized();

        bool IsValid();

        GenApi::INodeMap& GetNodeMap() const;

        GenApi::INodeMap& GetTLDeviceNodeMap() const;

        GenApi::INodeMap& GetTLStreamNodeMap(uint64_t streamIndex = 0) const;

        ProducerPtr GetProducer() const;

        GenApi::EAccessMode GetAccessMode() const;

        void ReadPort(uint64_t iAddress, void* pBuffer, size_t iSize);

        void WritePort(uint64_t iAddress, const void* pBuffer, size_t iSize);

        void BeginAcquisition();

        void EndAcquisition();

        BufferOwnership GetBufferOwnership() const;

        void SetBufferOwnership(const BufferOwnership mode);

        uint64_t GetUserBufferCount() const;

        uint64_t GetUserBufferSize() const;

        uint64_t GetUserBufferTotalSize() const;

        void SetUserBuffers(void* const pMemBuffers, uint64_t totalSize);

        void SetUserBuffers(void** const ppMemBuffers, const uint64_t bufferCount, const uint64_t bufferSize);

        ImagePtr GetNextImage(uint64_t grabTimeout = EVENT_TIMEOUT_INFINITE, uint64_t streamIndex = 0);

        ImageList GetNextImageSync(uint64_t grabTimeout = EVENT_TIMEOUT_INFINITE);

        GenICam::gcstring GetDeviceID();

        GenICam::gcstring GetDeviceSerialNumber();

        DEPRECATED_FUNC("Use GetDeviceID() instead.", GenICam::gcstring GetUniqueID(););

        bool IsStreaming() const;

        GenICam::gcstring GetGuiXml() const;

        void RegisterEventHandler(EventHandler& evtHandlerToRegister);

        DEPRECATED_FUNC(
            "Use GenApi::Register() and GenApi::Unregister() for handling device node callbacks instead.",
            void RegisterEventHandler(DeviceEventHandler& evtHandlerToRegister, const GenICam::gcstring& eventName));

        void RegisterEventHandler(ImageEventHandler& evtHandlerToRegister, uint64_t streamIndex);

        void UnregisterEventHandler(EventHandler& evtHandlerToUnregister);

        void UnregisterAllLoggingEventHandlers();

        unsigned int GetNumImagesInUse();

        unsigned int GetActiveNumDataStreams();

        unsigned int GetNumDataStreams();

        unsigned int DiscoverMaxPacketSize();

        void ForceIP();

      protected:
        CameraBase(void);

        CameraBase(const CameraBase& /*cam*/);

        CameraBase& operator=(const CameraBase& /*cam*/);

        friend class InterfaceImpl;

      private:
        bool IsValidEventHandlerType(EventType type);
    };

} // namespace Spinnaker

#endif // FLIR_SPINNAKER_CAMERABASE_H