示例#1
0
 public MyImage(byte[] _data, MyImage template)
 {
     data    = _data;
     height  = template.height; width = template.width;
     stride  = template.stride;
     dpi_x   = template.dpi_x; dpi_y = template.dpi_y;
     format  = template.format;
     palette = template.palette;
 }
示例#2
0
        public async Task <MyImage> ProcessImage(List <MyImage> images)
        {
            HDRSolver hdr = null;

            foreach (var p in radio_HDR)
            {
                if (p.Key.IsChecked == true)
                {
                    hdr = p.Value(); break;
                }
            }
            if (hdr == null)
            {
                LogPanel.Log("No HDR selected."); return(null);
            }
            ToneMappingSolver tone = null;

            foreach (var p in radio_ToneMapping)
            {
                if (p.Key.IsChecked == true)
                {
                    tone = p.Value(); break;
                }
            }
            if (tone == null)
            {
                LogPanel.Log("No Tone-Mapping selected."); return(null);
            }
            return(await Task.Run(() =>
            {
                LogPanel.Log("Running HDR...");
                foreach (var image in images)
                {
                    hdr.AddImage(image);
                }
                MyImageD heat_map = hdr.RunHDR();
                LogPanel.Log("Running Tone Mapping...");
                MyImage ans = tone.RunToneMapping(heat_map);
                LogPanel.Log("OK.");
                return ans;
            }));
        }
示例#3
0
 //protected double dpi_x { get; private set; }
 //protected double dpi_y { get; private set; }
 //protected PixelFormat format { get; private set; }
 //protected BitmapPalette palette { get; private set; }
 public void AddImage(MyImage image)
 {
     images.Add(image);
 }
示例#4
0
 public void ShowImage(MyImage _image)
 {
     image = _image;
     image_viewer.Source = image.ToBitmapSource();
 }