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; }
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; })); }
//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); }
public void ShowImage(MyImage _image) { image = _image; image_viewer.Source = image.ToBitmapSource(); }