Esempio n. 1
0
 public void RemoveSenderList(Transporter Sender)
 {
     this.m_SenderList.Remove(Sender);
 }
Esempio n. 2
0
 public void AddSenderList(Transporter Sender)
 {
     this.m_SenderList.Add(Sender);
 }
Esempio n. 3
0
        /// <summary>
        /// transporterから呼ばれるが,自動的にすべてのUpdateImageがきたときのみ呼ばれる
        /// </summary>
        /// <param name="Sender"></param>
        public void UpdateImage(Transporter Sender)
        {
            if (m_SenderList == null)
            {
                return;
            }
            if (Sender != this.m_SenderList.Last())
            {
                return;
            }
            if (this.m_WritableBitmap == null)
            {
                this.m_WritableBitmap = new WriteableBitmap(m_ProjectionImageMatrix.Width, m_ProjectionImageMatrix.Height, 96, 96, PixelFormats.Bgr24, null);
                this.Image_Main.Source = this.m_WritableBitmap;
                this.m_ProjectorWindow.Image_Project.Source = this.m_WritableBitmap;
                this.Grid_Image.Width = m_ProjectionImageMatrix.Width;
                this.Grid_Image.Height = m_ProjectionImageMatrix.Height;
            }
            foreach (var p in this.m_AdaptedImageProcesserList)
            {
                p.ImageProcess(ref this.m_ProjectionImageMatrix, ref this.m_ProjectionImageMatrix);
            }

            this.m_WritableBitmap.WritePixels(new Int32Rect(0, 0, m_ProjectionImageMatrix.Width, m_ProjectionImageMatrix.Height), m_ProjectionImageMatrix.Data, m_ProjectionImageMatrix.Width * m_ProjectionImageMatrix.Height * m_ProjectionImageMatrix.Type().Channels, m_ProjectionImageMatrix.Width * m_ProjectionImageMatrix.Type().Channels);
            this.m_ProjectionImageMatrix.Dispose();
#if USE_GC
            GC.Collect();
#endif
        }
Esempio n. 4
0
        public void InitImage(Transporter Sender, Mat mat)
        {
            if (m_SenderList == null)
            {
                return;
            }
            if (Sender != this.m_SenderList[0])
            {
                return;
            }

            this.m_ProjectionImageMatrix = mat.Clone();
            this.m_ProjectionImageMatrix.SetTo(black);
        }
Esempio n. 5
0
        private void Button_Create_Click(object sender, RoutedEventArgs e)
        {
            if (this.ListBox_ResourcePanels.SelectedIndex < 0)
            {
                return;
            }
            if (this.ListBox_ProjectionPanel.SelectedIndex < 0)
            {
                return;
            }

            var item = new Transporter(
                    this.Dictionary_ResourceImage.ElementAt(this.ListBox_ResourcePanels.SelectedIndex).Value,
                    Grid.GetColumn(this.Dictionary_ResourceImage.ElementAt(this.ListBox_ResourcePanels.SelectedIndex).Key),
                    base.m_MainWindow.GetPanels<ProjectionPanel>()[this.ListBox_ProjectionPanel.SelectedIndex]
                );

            this.List_Transporter.Add(item);
            TextBlock _item = new TextBlock();
            _item.Text = item.ToString();
            _item.Foreground = new SolidColorBrush(item.MainColor);
            this.ListBox_Transporters.Items.Add(_item);
            this.ListBox_Transporters.SelectedIndex = this.ListBox_Transporters.Items.Count - 1;
        }