Skip to content

File ManagedDefs.h

File List > SpinnakerNET > ManagedDefs.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_MANAGED_DEFS_H
#define FLIR_SPINNAKER_MANAGED_DEFS_H

#include "ManagedCameraDefs.h"
#include "ManagedTransportLayerDefs.h"

using namespace ::System;

namespace SpinnakerNET
{
    public enum class ColorProcessingAlgorithm
    {
        NONE,
        NEAREST_NEIGHBOR,
        NEAREST_NEIGHBOR_AVG,
        BILINEAR,
        EDGE_SENSING,
        HQ_LINEAR,
        IPP,
        DIRECTIONAL_FILTER,
        RIGOROUS,
        WEIGHTED_DIRECTIONAL_FILTER
    };

    public enum class PolarizationQuadrant
    {
        QUADRANT_I0,
        QUADRANT_I45,
        QUADRANT_I90,
        QUADRANT_I135
    };

    public enum class HeatmapColor
    {
        HEATMAP_BLACK = 1,
        HEATMAP_BLUE = 2,
        HEATMAP_CYAN = 3,
        HEATMAP_GREEN = 4,
        HEATMAP_YELLOW = 5,
        HEATMAP_RED = 6,
        HEATMAP_WHITE = 7
    };

    public enum class ImageFileFormat
    {
        FromFileExtension = -1, 
        Pgm, 
        Ppm, 
        Bmp, 
        Jpeg, 
        Jpeg2000, 
        Tiff, 
        Png, 
        Raw, 
    };

    public enum class TLPixelFormatNamespace
    {
        TLPIXELFORMAT_NAMESPACE_UNKNOWN = 0,   /* GenTL v1.2 */
        TLPIXELFORMAT_NAMESPACE_GEV = 1,   /* GenTL v1.2 */
        TLPIXELFORMAT_NAMESPACE_IIDC = 2,   /* GenTL v1.2 */
        TLPIXELFORMAT_NAMESPACE_PFNC_16BIT = 3,   /* GenTL v1.4 */
        TLPIXELFORMAT_NAMESPACE_PFNC_32BIT = 4,   /* GenTL v1.4 */

        TLPIXELFORMAT_NAMESPACE_CUSTOM_ID = 1000
    };

    public enum class ImageStatus
    {
        IMAGE_UNKNOWN_ERROR = -1, 
        IMAGE_NO_ERROR = 0, 
        IMAGE_CRC_CHECK_FAILED = 1, 
        IMAGE_DATA_OVERFLOW = 2, 
        IMAGE_MISSING_PACKETS = 3, 
        IMAGE_LEADER_BUFFER_SIZE_INCONSISTENT = 4, 
        IMAGE_TRAILER_BUFFER_SIZE_INCONSISTENT = 5, 
        IMAGE_PACKETID_INCONSISTENT = 6, 
        IMAGE_MISSING_LEADER = 7, 
        IMAGE_MISSING_TRAILER = 8, 
        IMAGE_DATA_INCOMPLETE = 9, 
        IMAGE_INFO_INCONSISTENT = 10, 
        IMAGE_CHUNK_DATA_INVALID = 11, 
        IMAGE_NO_SYSTEM_RESOURCES = 12, 
        IMAGE_GENDC_DATA_INVALID = 13, 
        IMAGE_GENDC_PART_DATA_INVALID = 14 
    };

    public enum class StatisticsChannel
    {
        Grey,
        Red,
        Green,
        Blue,
        Hue,
        Saturation,
        Lightness,
        NumberOfStatisticsChannels
    };

    public enum class ManagedLoggingLevel
    {
        LOG_LEVEL_OFF = -1,     // Logging is off.
        LOG_LEVEL_FATAL = 0,    // Failures that are non-recoverable without user intervention.
        LOG_LEVEL_ALERT = 100,  // Not used by Spinnaker.
        LOG_LEVEL_CRIT = 200,   // Not used by Spinnaker.
        LOG_LEVEL_ERROR = 300,  // Failures that may or may not be recoverable without user intervention (use case dependent).
        LOG_LEVEL_WARN = 400,   // Failures that are recoverable without user intervention.
        LOG_LEVEL_NOTICE = 500, // Events such as camera arrival and removal, initialization and deinitialization, starting and stopping image acquisition, and feature modification.
        LOG_LEVEL_INFO = 600,   // Information about recurring events that are generated regularly such as information on individual images.
        LOG_LEVEL_DEBUG = 700,  // Information that can be used to troubleshoot the system.
        LOG_LEVEL_NOTSET = 800  // Logs everything.
    };

    public enum class  Error
    {
        SPINNAKER_ERR_SUCCESS = 0,
        SPINNAKER_ERR_ERROR = -1001,
        SPINNAKER_ERR_NOT_INITIALIZED = -1002,
        SPINNAKER_ERR_NOT_IMPLEMENTED = -1003,
        SPINNAKER_ERR_RESOURCE_IN_USE = -1004,
        SPINNAKER_ERR_ACCESS_DENIED = -1005,
        SPINNAKER_ERR_INVALID_HANDLE = -1006,
        SPINNAKER_ERR_INVALID_ID = -1007,
        SPINNAKER_ERR_NO_DATA = -1008,
        SPINNAKER_ERR_INVALID_PARAMETER = -1009,
        SPINNAKER_ERR_IO = -1010,
        SPINNAKER_ERR_TIMEOUT = -1011,
        SPINNAKER_ERR_ABORT = -1012,
        SPINNAKER_ERR_INVALID_BUFFER = -1013,
        SPINNAKER_ERR_NOT_AVAILABLE = -1014,
        SPINNAKER_ERR_INVALID_ADDRESS = -1015,
        SPINNAKER_ERR_BUFFER_TOO_SMALL = -1016,
        SPINNAKER_ERR_INVALID_INDEX = -1017,
        SPINNAKER_ERR_PARSING_CHUNK_DATA = -1018,
        SPINNAKER_ERR_INVALID_VALUE = -1019,
        SPINNAKER_ERR_RESOURCE_EXHAUSTED = -1020,
        SPINNAKER_ERR_OUT_OF_MEMORY = -1021,
        SPINNAKER_ERR_BUSY = -1022,
        SPINNAKER_ERR_IP_CONFLICT = -1023,
        SPINNAKER_ERR_INVALID_CAMERA = -1024,

        SPINNAKER_ERR_GENICAM_INVALID_ARGUMENT = -2001,
        SPINNAKER_ERR_GENICAM_OUT_OF_RANGE = -2002,
        SPINNAKER_ERR_GENICAM_PROPERTY = -2003,
        SPINNAKER_ERR_GENICAM_RUN_TIME = -2004,
        SPINNAKER_ERR_GENICAM_LOGICAL = -2005,
        SPINNAKER_ERR_GENICAM_ACCESS = -2006,
        SPINNAKER_ERR_GENICAM_TIMEOUT = -2007,
        SPINNAKER_ERR_GENICAM_DYNAMIC_CAST = -2008,
        SPINNAKER_ERR_GENICAM_GENERIC = -2009,

        SPINNAKER_ERR_IM_CONVERT = -3001,
        SPINNAKER_ERR_IM_COPY = -3002,
        SPINNAKER_ERR_IM_MALLOC = -3003,
        SPINNAKER_ERR_IM_NOT_SUPPORTED = -3004,
        SPINNAKER_ERR_IM_HISTOGRAM_RANGE = -3005,
        SPINNAKER_ERR_IM_HISTOGRAM_MEAN = -3006,
        SPINNAKER_ERR_IM_MIN_MAX = -3007,
        SPINNAKER_ERR_IM_COLOR_CONVERSION = -3008,
        SPINNAKER_ERR_IM_DECOMPRESSION = -3009,
        SPINNAKER_ERR_IM_INVALID_IMAGE_TYPE = -3010,

        SPINNAKER_ERR_GPU_DECOMPRESSION = -3100,
        SPINNAKER_ERR_GPU_NOT_SUPPORTED = -3101,

        SPINNAKER_ERR_STEREO_INVALID_PIXEL_FORMAT = -3200,
        SPINNAKER_ERR_STEREO_RESOLUTION_MISMATCH = -3201,
        SPINNAKER_ERR_STEREO_INVALID_FILENAME = -3202,
        SPINNAKER_ERR_STEREO_INVALID_PLY_FILE = -3203,
        SPINNAKER_ERR_STEREO_MALLOC = -3204,
        SPINNAKER_ERR_STEREO_SPECKLE_FILTER = -3205,

        SPINNAKER_ERR_CUSTOM_ID = -10000
    };

    /* Image payload types supported by the Spinnaker Image class*/
    public enum class ImagePayloadType
    {
        IMAGE_PAYLOAD_TYPE_UNKNOWN = -1,
        IMAGE_PAYLOAD_TYPE_IMAGE,
        IMAGE_PAYLOAD_TYPE_EXTENDED_CHUNK,
        IMAGE_PAYLOAD_TYPE_JPEG,
        IMAGE_PAYLOAD_TYPE_LOSSLESS_COMPRESSED,
        IMAGE_PAYLOAD_TYPE_LOSSY_COMPRESSED,
        IMAGE_PAYLOAD_TYPE_JPEG_LOSSLESS_COMPRESSED,
        IMAGE_PAYLOAD_TYPE_RAW_SENSOR1,
        IMAGE_PAYLOAD_TYPE_RAW_SENSOR2,
        IMAGE_PAYLOAD_TYPE_RECTIFIED_SENSOR1,
        IMAGE_PAYLOAD_TYPE_RECTIFIED_SENSOR2,
        IMAGE_PAYLOAD_TYPE_DISPARITY_SENSOR1,
        IMAGE_PAYLOAD_TYPE_GENDC_GENERIC,             // GenDC generic payload type if no other types match
        IMAGE_PAYLOAD_TYPE_RANGE_SENSOR1,
        IMAGE_PAYLOAD_TYPE_RANGE_SENSOR2
    };

    public enum class TLPayloadType
    {
        TLPAYLOAD_TYPE_UNKNOWN = 0,     /* GenTL v1.2 */
        TLPAYLOAD_TYPE_IMAGE = 1,           /* GenTL v1.2 */
        TLPAYLOAD_TYPE_RAW_DATA = 2,        /* GenTL v1.2 */
        TLPAYLOAD_TYPE_FILE = 3,            /* GenTL v1.2 */
        TLPAYLOAD_TYPE_CHUNK_DATA = 4,  /* GenTL v1.2, Deprecated in GenTL 1.5*/
        TLPAYLOAD_TYPE_JPEG = 5,            /* GenTL v1.4 */
        TLPAYLOAD_TYPE_JPEG2000 = 6,        /* GenTL v1.4 */
        TLPAYLOAD_TYPE_H264 = 7,            /* GenTL v1.4 */
        TLPAYLOAD_TYPE_CHUNK_ONLY = 8,  /* GenTL v1.4 */
        TLPAYLOAD_TYPE_DEVICE_SPECIFIC = 9,   /* GenTL v1.4 */
        TLPAYLOAD_TYPE_MULTI_PART = 10, /* GenTL v1.5 */

        TLPAYLOAD_TYPE_CUSTOM_ID = 1000, /* Starting value for GenTL Producer custom IDs*/
        TLPAYLOAD_TYPE_LOSSLESS_COMPRESSED = TLPAYLOAD_TYPE_CUSTOM_ID + 1,
        TLPAYLOAD_TYPE_LOSSY_COMPRESSED = TLPAYLOAD_TYPE_CUSTOM_ID + 2,
        TLPAYLOAD_TYPE_JPEG_LOSSLESS_COMPRESSED = TLPAYLOAD_TYPE_CUSTOM_ID + 3
    };

    public enum class ActionCommandStatus
    {
        ACTION_COMMAND_STATUS_OK = 0,               /* The device acknowledged the command.*/
        ACTION_COMMAND_STATUS_NO_REF_TIME = 0x8013, /* The device is not synchronized to a master clock to be used as time reference. Typically used when scheduled action commands cannot be scheduled for a future time since the reference time coming from IEEE 1588 is not locked. */
        ACTION_COMMAND_STATUS_OVERFLOW = 0x8015,    /* Returned when the scheduled action commands queue is full and the device cannot accept the additional request. */
        ACTION_COMMAND_STATUS_ACTION_LATE = 0x8016, /* The requested scheduled action command was requested at a point in time that is in the past. */
        ACTION_COMMAND_STATUS_ERROR = 0x8FFF        /* Generic Error. Try enabling the Extended Status Code 2.0 bit on gvcp configuration register in order to receive more meaningful/detailed acknowledge messages from the device. */
    };

    public enum class TIFFCompressionMethod
    {
        None = 1, 
        PackBits, 
        Deflate, 
        AdobeDeflate, 
        CcittFax3,
        CcittFax4,
        Lzw, 
        Jpeg
    };

    public enum class BufferOwnership
    {
        BUFFER_OWNERSHIP_SYSTEM, /* Buffers are owned and managed by the library */
        BUFFER_OWNERSHIP_USER    /* Buffers are owned and managed by the user */
    };

    public enum class InferenceBoundingBoxType
    {
        RECTANGLE = 0,
        CIRCLE = 1,
        ROTATED_RECTANGLE = 2
    };

    public enum class  CCMColorTemperature
    {
        INCANDESCENT_2765K,
        TUNGSTEN_2800K,
        WARM_FLUORESCENT_3000K,
        HALOGEN_3188K,
        COOL_FLUORESCENT_4000K,
        LED_4649K,
        LED_H_AND_E_4649K,     /* for samples stained with H&E */
        FLUORESCENT_4665K,
        SUNNY_5000K,
        DAYLIGHT_5034K,
        DAYLIGHT_H_AND_E_5034K, /* for samples stained with H&E */
        CLOUDY_6500K,
        SHADE_8000K,
        GENERAL,
        NUM_CCM_COLOR_TEMPERATURE
    };

    public enum class CCMType
    {
        LINEAR,
        ADVANCED,
        NUM_CCM_TYPE
    };

    public enum class  CCMSensor
    {
        /* Pregius Gen 2 */
        IMX226,
        IMX249,
        IMX250,
        IMX252,
        IMX253,
        IMX255,
        IMX264,
        IMX265,
        IMX267,
        IMX273,
        IMX287,
        IMX296,
        IMX297,
        IMX304,
        IMX327,
        IMX334,
        IMX342,
        IMX367,
        IMX387,
        IMX392,
        /* Pregius Gen 3 */
        IMX420,
        IMX421,
        IMX422,
        IMX425,
        IMX428,
        IMX429,
        IMX430,
        /* Onsemi */
        AR0521,
        NUM_CCM_SENSOR
    };

    public enum class CCMColorSpace
    {
        OFF,
        SRGB,
        NUM_CCM_COLOR_SPACE
    };

    public enum class CCMApplication
    {
        GENERIC,
        MICROSCOPY,
        NUM_CCM_APPLICATION
    };

    public enum class DisparityProcessingMethod
    {
        NONE,

        HIGH_DENSITY,

        BALANCED,

        HIGH_PERFORMANCE
    };

    public ref struct PngOption
    {
        property bool interlaced;
        property unsigned int compressionLevel;

        PngOption()
        {
            compressionLevel = 6;
        }
    };


    public ref struct PpmOption
    {
        property bool binaryFile;

        PpmOption()
        {
            binaryFile = true;
        }
    };

    public ref struct PgmOption
    {
        property bool binaryFile;

        PgmOption()
        {
            binaryFile = true;
        }
    };

    public ref struct TiffOption
    {
        property TIFFCompressionMethod compression;

        TiffOption()
        {
            compression = TIFFCompressionMethod::Lzw;
        }
    };

    public ref struct JpegOption
    {
        property bool progressive;
        property unsigned int quality;

        JpegOption()
        {
            quality = 75;
        }

    };

    public ref struct Jpg2Option
    {
        property unsigned int quality;

        Jpg2Option()
        {
            quality = 16;
        }

    };

    public ref struct BmpOption
    {
        property bool indexedColor_8bit;
        BmpOption()
        {
            indexedColor_8bit = false;
        }
    };

    public ref struct AviOption
    {
        property float frameRate;

        property int width;

        property int height;

        AviOption()
        {
            frameRate = 15.0;
            width = 0;
            height = 0;
        }
    };

    public ref struct MJPGOption
    {
        property float frameRate;

        property int quality;

        property int width;

        property int height;

        MJPGOption()
        {
            frameRate = 15.0;
            quality = 75;
            width = 0;
            height = 0;
        }
    };

    public ref struct H264Option
    {
        property float frameRate;

        property int width;

        property int height;

        property int bitrate;

        bool useMP4;

        /* Crf values range from 1 to 51 */
        unsigned int crf;

        H264Option()
        {
            frameRate = 15.0;
            width = 0;
            height = 0;
            bitrate = 1000000;
            useMP4 = true;
            crf = 23;
        }
    };

    public ref struct LibraryVersion
    {
        property int major;

        property int minor;

        property int type;

        property int build;
    };

    public ref struct ActionCommandResult
    {
        /* IP Address of device that responded to Action Command */
        property unsigned int DeviceAddress;

        /* Action Command status return from device */
        property ActionCommandStatus Status;

        ActionCommandResult()
        {
            DeviceAddress = 0;
        }
    };

    public ref struct CCMSettings
    {
        CCMApplication Application;           /* Informs Spinnaker to use the CCM optimized for specific application.
                                                 Ignored when CustomCCMCode is not empty. */
        CCMType Type;                         /* The type of CCM affects the color accuracy and conversion speed.
                                                 Ignored when CustomCCMCode is not empty. */
        CCMSensor Sensor;                     /* Informs Spinnaker to use the CCM calibrated for this sensor.
                                                 Ignored when CustomCCMCode is not empty. */
        CCMColorTemperature ColorTemperature; /* Determines the tone of the color correction to be applied.
                                                 Ignored when CustomCCMCode is not empty. */
        CCMColorSpace ColorSpace;             /* Informs Spinnaker whether to apply gamma transformation. */
        String^ CustomCCMCode;                 /* Custom encrypted CCM provided by FLIR. */

        CCMSettings()
        {
            Application = CCMApplication::MICROSCOPY;
            Type = CCMType::LINEAR;
            Sensor = CCMSensor::IMX250;
            ColorTemperature = CCMColorTemperature::LED_4649K;
            ColorSpace = CCMColorSpace::SRGB;

            CustomCCMCode = "";
        }
    };

    public value struct ImagePixel
    {
        // u represents horizontal position (analogous to x in Cartesian coordinates, and j in image coordinates (i.e.
        // col, width))
        property unsigned int u; // u image coordinate
        // v represents vertical position (analogous to y in Cartesian coordinates, and i in image coordinates (i.e.
        // row, height))
        property unsigned int v; // v image coordinate
    };

    public value struct Stereo3DPoint
    {
        property float x;          // x world coordinate
        property float y;          // y world coordinate
        property float z;          // z world coordinate
        property unsigned char r;  // r color component
        property unsigned char g;  // g color component
        property unsigned char b;  // b color component
        ImagePixel pixel;          // Image coordinates
    };

    public ref struct PointCloudParameters
    {
        // Factor by which to reduce the resolution of the point cloud.
        // A decimation factor of 1 means no decimation (full resolution).
        property unsigned int decimationFactor;
        // The left boundary of the Region of Interest (ROI) in image coordinates.
        // This represents the minimum U-coordinate in the image (horizontal).
        property unsigned int ROIImageLeft;

        // The top boundary of the Region of Interest (ROI) in image coordinates.
        // This represents the minimum V-coordinate in the image (vertical).
        property unsigned int ROIImageTop;
        // The right boundary of the Region of Interest (ROI) in image coordinates.
        // This represents the maximum U-coordinate in the image (horizontal).
        property unsigned int ROIImageRight;
        // The bottom boundary of the Region of Interest (ROI) in image coordinates.
        // This represents the maximum V-coordinate in the image (vertical).
        property unsigned int ROIImageBottom;

        // The minimum X coordinate of the ROI in world space, representing the left boundary (in meters),
        // relative to Sensor 1's image center as the origin.
        property float ROIWorldCoordinatesXMin;
        // The maximum X coordinate of the ROI in world space, representing the right boundary (in meters),
        // relative to Sensor 1's image center as the origin.
        property float ROIWorldCoordinatesXMax;
        // The minimum Y coordinate of the ROI in world space, representing the bottom boundary (in meters),
        // relative to Sensor 1's image center as the origin.
        property float ROIWorldCoordinatesYMin;
        // The maximum Y coordinate of the ROI in world space, representing the top boundary (in meters),
        // relative to Sensor 1's image center as the origin.
        property float ROIWorldCoordinatesYMax;
        // The minimum Z coordinate of the ROI in world space, representing the near boundary (in meters),
        // relative to Sensor 1's image center as the origin.
        property float ROIWorldCoordinatesZMin;
        // The maximum Z coordinate of the ROI in world space, representing the far boundary (in meters),
        // relative to Sensor 1's image center as the origin.
        property float ROIWorldCoordinatesZMax;

        PointCloudParameters()
        {
            decimationFactor = 1;
            ROIImageLeft = 0;
            ROIImageTop = 0;
            ROIImageRight = 2048;
            ROIImageBottom = 1536;
            // Defines a 1km x 1km x 0.5km arbitrary region of interest to ensure sufficient coverage for a single-shot
            // point cloud.
            ROIWorldCoordinatesXMin = -500.0f;
            ROIWorldCoordinatesXMax = 500.0f;
            ROIWorldCoordinatesYMin = -500.0f;
            ROIWorldCoordinatesYMax = 500.0f;
            ROIWorldCoordinatesZMin = 0.0f;
            ROIWorldCoordinatesZMax = 500.0f;
        }
    };

    // Parameters related to the stereo camera's geometry and disparity calculations, such as baseline, focal length,
    // and principal point
    public ref struct StereoCameraParameters
    {
         property float coordinateOffset;
         property float baseline;
         property float focalLength;
         property float principalPointU;
         property float principalPointV;
         property float disparityScaleFactor;
         property float invalidDataValue;
         property bool invalidDataFlag;
         property unsigned int totalDisparity;

         StereoCameraParameters()
         {
            coordinateOffset = 0.0f;
            baseline = 0.24f;
            focalLength = 1300.0f;
            principalPointU = 1024.0f;
            principalPointV = 768.0f;
            disparityScaleFactor = 1 / 64.0f;
            invalidDataValue = 0;
            invalidDataFlag = true;
            totalDisparity = 256;
         }
    };
}

#endif // FLIR_SPINNAKER_MANAGED_DEFS_H