Esempio n. 1
0
        // object owning data should be locked
        private static void UpdateData(RawIrPlugin2DViewSettings pluginViewSettings, EventTypePluginData data)
        {
            Debug.Assert(data != null);

            if ((pluginViewSettings != null) && (data.depthMap != null) && (data.depthTexture != null) && (data.irTexture != null))
            {
                switch (pluginViewSettings.ViewType)
                {
                case RawIrPlugin2DViewSettings.RawIr2DViewType.DepthColor:
                    data.depthMap.RampConversion(data.depthTexture, viz.DepthRampMode.Color);
                    break;

                case RawIrPlugin2DViewSettings.RawIr2DViewType.DepthGrey:
                    data.depthMap.RampConversion(data.depthTexture, viz.DepthRampMode.Grey);
                    break;

                case RawIrPlugin2DViewSettings.RawIr2DViewType.Ir:
                    data.irTexture.RampConversion(data.rawIrTexture, pluginViewSettings.RampTexture);
                    break;

                default:
                    Debug.Assert(false);
                    break;
                }
            }
        }
        private RawIrPlugin2DViewSettings(RawIrPlugin2DViewSettings source)
            : base(source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            this.viewType = source.viewType;
        }
Esempio n. 3
0
        public IPluginViewSettings Add2DView(EventType eventType, Panel hostControl)
        {
            IPluginViewSettings pluginViewSettings = null;

            switch (eventType)
            {
            case EventType.Monitor:
                // no raw IR monitoring
                break;

            case EventType.Inspection:
                pluginViewSettings = new RawIrPlugin2DViewSettings(this.pluginService, eventType);
                break;
            }

            return(pluginViewSettings);
        }
Esempio n. 4
0
        private viz.Texture GetTexture(IPluginViewSettings pluginViewSettings, EventTypePluginData data)
        {
            Debug.Assert(data != null);

            viz.Texture value = null;

            lock (this.lockObj)
            {
                RawIrPlugin2DViewSettings raw2DSettingsViewSettings = pluginViewSettings as RawIrPlugin2DViewSettings;
                if (raw2DSettingsViewSettings != null)
                {
                    RawIrPlugin.UpdateData(raw2DSettingsViewSettings, data);

                    if (raw2DSettingsViewSettings.ViewType == RawIrPlugin2DViewSettings.RawIr2DViewType.Ir)
                    {
                        value = data.irTexture;
                    }
                    else
                    {
                        value = data.depthTexture;
                    }
                }
                else
                {
                    RawIrPlugin3DViewSettings raw3DSettingsViewSettings = pluginViewSettings as RawIrPlugin3DViewSettings;
                    if (raw3DSettingsViewSettings != null)
                    {
                        if (raw3DSettingsViewSettings.ViewType == RawIrPlugin3DViewSettings.RawIr3DViewType.Ir)
                        {
                            value = data.irTexture;
                        }
                    }
                }
            }

            return(value);
        }
        // object owning data should be locked 
        private static void UpdateData(RawIrPlugin2DViewSettings pluginViewSettings, EventTypePluginData data)
        {
            Debug.Assert(data != null);

            if ((pluginViewSettings != null) && (data.depthMap != null) && (data.depthTexture != null) && (data.irTexture != null))
            {
                switch (pluginViewSettings.ViewType)
                {
                    case RawIrPlugin2DViewSettings.RawIr2DViewType.DepthColor:
                        data.depthMap.RampConversion(data.depthTexture, viz.DepthRampMode.Color);
                        break;

                    case RawIrPlugin2DViewSettings.RawIr2DViewType.DepthGrey:
                        data.depthMap.RampConversion(data.depthTexture, viz.DepthRampMode.Grey);
                        break;

                    case RawIrPlugin2DViewSettings.RawIr2DViewType.Ir:
                        data.irTexture.RampConversion(data.rawIrTexture, pluginViewSettings.RampTexture);
                        break;

                    default:
                        Debug.Assert(false);
                        break;
                }
            }
        }
        public IPluginViewSettings Add2DView(EventType eventType, Panel hostControl)
        {
            IPluginViewSettings pluginViewSettings = null;

            switch (eventType)
            {
                case EventType.Monitor:
                    // no raw IR monitoring
                    break;

                case EventType.Inspection:
                    pluginViewSettings = new RawIrPlugin2DViewSettings(this.pluginService, eventType);
                    break;
            }

            return pluginViewSettings;
        }
        private RawIrPlugin2DViewSettings(RawIrPlugin2DViewSettings source)
            :base(source)
        {
            if (source == null)
            {
                throw new ArgumentNullException("source");
            }

            this.viewType = source.viewType;
        }