private void ShowCalculated() { if (calculated != null) { HDRImage.Source = calculated.GetBitmapImage(); } }
//Loads overexposed image private async void LoadOverExp(object sender, TappedRoutedEventArgs e) { overExp = new LDRImage(); await overExp.Load(); if (overExp.GetBitmapImage() != null) { OverExp.Source = overExp.GetBitmapImage(); OverExpText.Opacity = 0.0; //activates the HDR rendering button if the other two images are loaded as well if (regExp != null && underExp != null) { HDRButton.IsEnabled = true; } } }
// Show the regular old HDR private void ViewHDR(object sender, TappedRoutedEventArgs e) { SaveButton.IsEnabled = true; RecalculateButton.IsEnabled = true; BlenderSlider.IsEnabled = true; // Loads HDR Preview from cache HDRImage.Source = HDRPreview.GetBitmapImage(); }
//Called when the play button is pressed private async void Recalculate(object sender, TappedRoutedEventArgs e) { //Re-renders the HDR image based on the new slider value HDRI = Blending.Blend(sliderValue / 100f, underExp, regExp, overExp); //Creates and displays a preview LDR image based off of the HDR image HDRPreview = new LDRImage(); await HDRPreview.LoadFromBytes(HDRI.Transform(), HDRI.Width, HDRI.Height); HDRImage.Source = HDRPreview.GetBitmapImage(); RecalculateButton.IsEnabled = false; }