Skip to content

File IManagedImage.h

File List > SpinnakerNET > IManagedImage.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_IMANAGED_IMAGE_H
#define FLIR_SPINNAKER_IMANAGED_IMAGE_H

#include "Image.h"
#include "ManagedChunkData.h"
#include "ManagedDefs.h"
#include "ManagedException.h"
#include "Translate.h"

using namespace ::System;
using namespace ::System::Runtime::InteropServices;
#using "WindowsBase.dll"
using namespace ::System::Windows::Media;
using namespace ::System::Windows::Media::Imaging;


namespace SpinnakerNET
{
    ref class ManagedImage;

    public interface class IManagedImage : IDisposable
    {
        property ManagedChunkData^ ChunkData
        {
            ManagedChunkData^ get();
        }

        property unsigned char* NativeData
        {
            unsigned char* get();
        }

        property unsigned char* PrivateData
        {
            unsigned char* get();
        }

        virtual property IntPtr DataPtr
        {
            IntPtr get();
        }

        property array<byte>^ ManagedData
        {
            array<byte>^ get();
        }

        property ::System::UInt64 ID
        {
            ::System::UInt64 get();
        }

        property ::System::UInt64 StreamIndex
        {
            ::System::UInt64 get();
        }

        property ::System::String ^ SerialNumber
        { 
            ::System::String ^ get();
        }

        property unsigned int Width
        {
            unsigned int get();
        }

        property unsigned int Height
        {
            unsigned int get();
        }

        property unsigned int Stride
        {
            unsigned int get();
        }

        property unsigned int BitsPerPixel
        {
            unsigned int get();
        }

        property unsigned int OffsetX
        {
            unsigned int get();
        }

        property unsigned int OffsetY
        {
            unsigned int get();
        }

        property unsigned int XPadding
        {
            unsigned int get();
        }

        property unsigned int YPadding
        {
            unsigned int get();
        }

        property ::System::UInt64 FrameID
        {
            ::System::UInt64 get();
        }

        property SpinnakerNET::ImagePayloadType ImagePayloadType
        {
            SpinnakerNET::ImagePayloadType get();
        }

        property unsigned int PayloadType
        {
            unsigned int get();
        }

        property unsigned int TLPayloadType
        {
            unsigned int get();
        }

        property unsigned int ValidPayloadSize
        {
            unsigned int get();
        }

        property ::System::UInt64 ChunkLayoutID
        {
            ::System::UInt64 get();
        }

        property ::System::UInt64 TimeStamp
        {
            ::System::UInt64 get();
        }

        property ::System::UInt64 TLPixelFormat
        {
            ::System::UInt64 get();
        }

        property ::System::Drawing::Bitmap^ bitmap
        {
            ::System::Drawing::Bitmap^ get();
        }

        property ::System::Windows::Media::Imaging::BitmapSource^ bitmapsource
        {
            ::System::Windows::Media::Imaging::BitmapSource^ get();
        }

        property ::System::Windows::Media::Imaging::WriteableBitmap^ writeableBitmap
        {
            ::System::Windows::Media::Imaging::WriteableBitmap^ get();
        }

        property ::System::String^ PixelFormatName
        {
            ::System::String^ get();
        }

        property SpinnakerNET::PixelFormatEnums PixelFormat
        {
            SpinnakerNET::PixelFormatEnums get();
        }

        property bool IsIncomplete
        {
            bool get();
        }

        property unsigned int BufferSize
        {
            unsigned int get();
        }

        property SpinnakerNET::ImageStatus ImageStatus
        {
            SpinnakerNET::ImageStatus get();
        }

        property bool HasChunkData
        {
            bool get();
        }

        property bool HasCRC
        {
            bool get();
        }

        property bool CheckCRC
        {
            bool get();
        }

        property bool IsInUse
        {
            bool get();
        }

        property unsigned int ImageSize
        {
            unsigned int get();
        }

        SpinnakerNET::ColorProcessingAlgorithm GetColorProcessing();

        void Release();

        unsigned int GetBufferSize();

        void DeepCopy(IManagedImage^ srcImage);

        void Save(
            ::System::String^ fileName);

        void Save(
            ::System::String^ fileName,
            ImageFileFormat format);

        void Save(
            ::System::String^ fileName,
            PngOption^ option);

        void Save(
            ::System::String^ fileName,
            PpmOption^ option);

        void Save(
            ::System::String^ fileName,
            PgmOption^ option);

        void Save(
            ::System::String^ fileName,
            TiffOption^ option);

        void Save(
            ::System::String^ fileName,
            JpegOption^ option);

        void Save(
            ::System::String^ fileName,
            Jpg2Option^ option);

        void Save(
            ::System::String^ fileName,
            BmpOption^ option);

        void ConvertToBitmapSource(SpinnakerNET::PixelFormatEnums format, IManagedImage^ destImage);
        void ConvertToWriteAbleBitmap(SpinnakerNET::PixelFormatEnums format, IManagedImage^ destImage);

        void ConvertToBitmapSource(SpinnakerNET::PixelFormatEnums format, IManagedImage^ destImage, SpinnakerNET::ColorProcessingAlgorithm algorithm);
        void ConvertToWriteAbleBitmap(SpinnakerNET::PixelFormatEnums format, IManagedImage^ destImage, SpinnakerNET::ColorProcessingAlgorithm algorithm);

        void CalculateStatistics(ManagedImageStatistics^ statistics);

        void ResetImage(unsigned int width, unsigned int height, unsigned int offsetX, unsigned int offsetY, SpinnakerNET::PixelFormatEnums pixelFormat);
        void ResetImage(unsigned int width, unsigned int height, unsigned int offsetX, unsigned int offsetY, SpinnakerNET::PixelFormatEnums pixelFormat, void* pData);
    };
}

#endif // FLIR_SPINNAKER_IMANAGED_IMAGE_H