Ejemplo n.º 1
0
 private void InitForm()
 {
     MainPP3 = new PP3Values();
     MainPP3.Name = "Main";
     ProgressPulse = new PulseBar(ProgressBar);
     deleteThumbs();
     InitGraph();
     InitTable();
     InitBackgroundWorker();
     checkPrograms();
     SetSaveStatus(true);
 }
Ejemplo n.º 2
0
 public void InitPP3Curves(PP3Values PP3, int filecount)
 {
     crvs.Add(CurveName.Exposure_Clip.ToString(), new GCurve(CurveName.Exposure_Clip, 0, 0.99990000000000001, (float)PP3.Exposure.Clip, filecount));
     crvs.Add(CurveName.Exposure_Brightness.ToString(), new GCurve(CurveName.Exposure_Brightness, -100, 100, PP3.Exposure.Brightness, filecount));
     crvs.Add(CurveName.Exposure_Contrast.ToString(), new GCurve(CurveName.Exposure_Contrast, -100, 100, PP3.Exposure.Contrast, filecount));
     crvs.Add(CurveName.Exposure_Saturation.ToString(), new GCurve(CurveName.Exposure_Saturation, -100, 100, PP3.Exposure.Saturation, filecount));
     crvs.Add(CurveName.Exposure_Black.ToString(), new GCurve(CurveName.Exposure_Black, -16384, 32768, PP3.Exposure.Black, filecount));
     crvs.Add(CurveName.Exposure_HighlightCompr.ToString(), new GCurve(CurveName.Exposure_HighlightCompr, 0, 500, PP3.Exposure.HighlightCompr, filecount));
     crvs.Add(CurveName.Exposure_HighlightComprThreshold.ToString(), new GCurve(CurveName.Exposure_HighlightComprThreshold, 0, 100, PP3.Exposure.HighlightComprThreshold, filecount));
     crvs.Add(CurveName.Exposure_ShadowCompr.ToString(), new GCurve(CurveName.Exposure_ShadowCompr, 0, 100, PP3.Exposure.ShadowCompr, filecount));
     crvs.Add(CurveName.LuminanceCurve_Brightness.ToString(), new GCurve(CurveName.LuminanceCurve_Brightness, -100, 100, PP3.LuminanceCurve.Brightness, filecount));
     crvs.Add(CurveName.LuminanceCurve_Contrast.ToString(), new GCurve(CurveName.LuminanceCurve_Contrast, -100, 100, PP3.LuminanceCurve.Contrast, filecount));
     crvs.Add(CurveName.LuminanceCurve_Saturation.ToString(), new GCurve(CurveName.LuminanceCurve_Saturation, -100, 100, PP3.LuminanceCurve.Saturation, filecount));
     crvs.Add(CurveName.LuminanceCurve_SaturationLimit.ToString(), new GCurve(CurveName.LuminanceCurve_SaturationLimit, 0, 100, PP3.LuminanceCurve.SaturationLimit, filecount));
     crvs.Add(CurveName.Sharpening_Radius.ToString(), new GCurve(CurveName.Sharpening_Radius, 0.29999999999999999, 3, (float)PP3.Sharpening.Radius, filecount));
     crvs.Add(CurveName.Sharpening_Amount.ToString(), new GCurve(CurveName.Sharpening_Amount, 1, 1000, PP3.Sharpening.Amount, filecount));
     crvs.Add(CurveName.Sharpening_EdgedetectionRadius.ToString(), new GCurve(CurveName.Sharpening_EdgedetectionRadius, 1.8999999999999999, 1.8999999999999999, (float)PP3.Sharpening.EdgedetectionRadius, filecount));
     crvs.Add(CurveName.Sharpening_EdgeTolerance.ToString(), new GCurve(CurveName.Sharpening_EdgeTolerance, 1800, 1800, PP3.Sharpening.EdgeTolerance, filecount));
     crvs.Add(CurveName.Sharpening_HalocontrolAmount.ToString(), new GCurve(CurveName.Sharpening_HalocontrolAmount, 85, 85, PP3.Sharpening.HalocontrolAmount, filecount));
     crvs.Add(CurveName.Sharpening_DeconvRadius.ToString(), new GCurve(CurveName.Sharpening_DeconvRadius, 0.5, 0.75, (float)PP3.Sharpening.DeconvRadius, filecount));
     crvs.Add(CurveName.Sharpening_DeconvAmount.ToString(), new GCurve(CurveName.Sharpening_DeconvAmount, 0, 75, PP3.Sharpening.DeconvAmount, filecount));
     crvs.Add(CurveName.Sharpening_DeconvDamping.ToString(), new GCurve(CurveName.Sharpening_DeconvDamping, 0, 20, PP3.Sharpening.DeconvDamping, filecount));
     crvs.Add(CurveName.Sharpening_DeconvIterations.ToString(), new GCurve(CurveName.Sharpening_DeconvIterations, 5, 30, PP3.Sharpening.DeconvIterations, filecount));
     crvs.Add(CurveName.Vibrance_Pastels.ToString(), new GCurve(CurveName.Vibrance_Pastels, -100, 100, PP3.Vibrance.Pastels, filecount));
     crvs.Add(CurveName.Vibrance_Saturated.ToString(), new GCurve(CurveName.Vibrance_Saturated, -100, 100, PP3.Vibrance.Saturated, filecount));
     crvs.Add(CurveName.SharpenEdge_Passes.ToString(), new GCurve(CurveName.SharpenEdge_Passes, 1, 4, PP3.SharpenEdge.Passes, filecount));
     crvs.Add(CurveName.SharpenEdge_Strength.ToString(), new GCurve(CurveName.SharpenEdge_Strength, 0, 100, (float)PP3.SharpenEdge.Strength, filecount));
     crvs.Add(CurveName.SharpenMicro_Strength.ToString(), new GCurve(CurveName.SharpenMicro_Strength, 0, 100, (float)PP3.SharpenMicro.Strength, filecount));
     crvs.Add(CurveName.SharpenMicro_Uniformity.ToString(), new GCurve(CurveName.SharpenMicro_Uniformity, 0, 100, (float)PP3.SharpenMicro.Uniformity, filecount));
     crvs.Add(CurveName.WhiteBalance_Temperature.ToString(), new GCurve(CurveName.WhiteBalance_Temperature, 2000, 25000, PP3.WhiteBalance.Temperature, filecount));
     crvs.Add(CurveName.WhiteBalance_Green.ToString(), new GCurve(CurveName.WhiteBalance_Green, 0.02, 5, (float)PP3.WhiteBalance.Green, filecount));
     crvs.Add(CurveName.ImpulseDenoising_Threshold.ToString(), new GCurve(CurveName.ImpulseDenoising_Threshold, 0, 100, PP3.ImpulseDenoising.Threshold, filecount));
     crvs.Add(CurveName.Defringing_Radius.ToString(), new GCurve(CurveName.Defringing_Radius, 0.5, 5, (float)PP3.Defringing.Radius, filecount));
     crvs.Add(CurveName.Defringing_Threshold.ToString(), new GCurve(CurveName.Defringing_Threshold, 0, 100, PP3.Defringing.Threshold, filecount));
     crvs.Add(CurveName.DirectionalPyramidDenoising_Luma.ToString(), new GCurve(CurveName.DirectionalPyramidDenoising_Luma, 0, 100, PP3.DirectionalPyramidDenoising.Luma, filecount));
     crvs.Add(CurveName.DirectionalPyramidDenoising_Chroma.ToString(), new GCurve(CurveName.DirectionalPyramidDenoising_Chroma, 0, 100, PP3.DirectionalPyramidDenoising.Chroma, filecount));
     crvs.Add(CurveName.DirectionalPyramidDenoising_Gamma.ToString(), new GCurve(CurveName.DirectionalPyramidDenoising_Gamma, 1, 3, (float)PP3.DirectionalPyramidDenoising.Gamma, filecount));
     crvs.Add(CurveName.EPD_Strength.ToString(), new GCurve(CurveName.EPD_Strength, -2, 0.25, (float)PP3.EPD.Strength, filecount));
     crvs.Add(CurveName.EPD_EdgeStopping.ToString(), new GCurve(CurveName.EPD_EdgeStopping, 0.10000000000000001, 1.3999999999999999, (float)PP3.EPD.EdgeStopping, filecount));
     crvs.Add(CurveName.EPD_Scale.ToString(), new GCurve(CurveName.EPD_Scale, 0.10000000000000001, 1, (float)PP3.EPD.Scale, filecount));
     crvs.Add(CurveName.EPD_ReweightingIterates.ToString(), new GCurve(CurveName.EPD_ReweightingIterates, 0, 0, PP3.EPD.ReweightingIterates, filecount));
     crvs.Add(CurveName.ShadowsAndHighlights_Highlights.ToString(), new GCurve(CurveName.ShadowsAndHighlights_Highlights, 0, 100, PP3.ShadowsAndHighlights.Highlights, filecount));
     crvs.Add(CurveName.ShadowsAndHighlights_HighlightTonalWidth.ToString(), new GCurve(CurveName.ShadowsAndHighlights_HighlightTonalWidth, 10, 100, PP3.ShadowsAndHighlights.HighlightTonalWidth, filecount));
     crvs.Add(CurveName.ShadowsAndHighlights_Shadows.ToString(), new GCurve(CurveName.ShadowsAndHighlights_Shadows, 0, 100, PP3.ShadowsAndHighlights.Shadows, filecount));
     crvs.Add(CurveName.ShadowsAndHighlights_ShadowTonalWidth.ToString(), new GCurve(CurveName.ShadowsAndHighlights_ShadowTonalWidth, 10, 100, PP3.ShadowsAndHighlights.ShadowTonalWidth, filecount));
     crvs.Add(CurveName.ShadowsAndHighlights_LocalContrast.ToString(), new GCurve(CurveName.ShadowsAndHighlights_LocalContrast, 0, 100, PP3.ShadowsAndHighlights.LocalContrast, filecount));
     crvs.Add(CurveName.ShadowsAndHighlights_Radius.ToString(), new GCurve(CurveName.ShadowsAndHighlights_Radius, 5, 100, PP3.ShadowsAndHighlights.Radius, filecount));
     crvs.Add(CurveName.Crop_X.ToString(), new GCurve(CurveName.Crop_X, PP3.Crop.X, filecount));
     crvs.Add(CurveName.Crop_Y.ToString(), new GCurve(CurveName.Crop_Y, PP3.Crop.Y, filecount));
     crvs.Add(CurveName.Rotation_Degree.ToString(), new GCurve(CurveName.Rotation_Degree, -45, 45, (float)PP3.Rotation.Degree, filecount));
     crvs.Add(CurveName.Distortion_Amount.ToString(), new GCurve(CurveName.Distortion_Amount, -0.5, 0.5, (float)PP3.Distortion.Amount, filecount));
     crvs.Add(CurveName.Perspective_Horizontal.ToString(), new GCurve(CurveName.Perspective_Horizontal, -100, 100, PP3.Perspective.Horizontal, filecount));
     crvs.Add(CurveName.Perspective_Vertical.ToString(), new GCurve(CurveName.Perspective_Vertical, -100, 100, PP3.Perspective.Vertical, filecount));
     crvs.Add(CurveName.CACorrection_Red.ToString(), new GCurve(CurveName.CACorrection_Red, -0.0050000000000000001, 0.0050000000000000001, (float)PP3.CACorrection.Red, filecount));
     crvs.Add(CurveName.CACorrection_Blue.ToString(), new GCurve(CurveName.CACorrection_Blue, -0.0050000000000000001, 0.0050000000000000001, (float)PP3.CACorrection.Blue, filecount));
     crvs.Add(CurveName.VignettingCorrection_Amount.ToString(), new GCurve(CurveName.VignettingCorrection_Amount, -100, 100, PP3.VignettingCorrection.Amount, filecount));
     crvs.Add(CurveName.VignettingCorrection_Radius.ToString(), new GCurve(CurveName.VignettingCorrection_Radius, 0, 100, PP3.VignettingCorrection.Radius, filecount));
     crvs.Add(CurveName.VignettingCorrection_Strength.ToString(), new GCurve(CurveName.VignettingCorrection_Strength, 1, 100, PP3.VignettingCorrection.Strength, filecount));
     crvs.Add(CurveName.VignettingCorrection_CenterX.ToString(), new GCurve(CurveName.VignettingCorrection_CenterX, -100, 100, PP3.VignettingCorrection.CenterX, filecount));
     crvs.Add(CurveName.VignettingCorrection_CenterY.ToString(), new GCurve(CurveName.VignettingCorrection_CenterY, -100, 100, PP3.VignettingCorrection.CenterY, filecount));
     crvs.Add(CurveName.Resize_Scale.ToString(), new GCurve(CurveName.Resize_Scale, 0.01, 4, (float)PP3.Resize.Scale, filecount));
     crvs.Add(CurveName.Resize_Width.ToString(), new GCurve(CurveName.Resize_Width, 32, 15600, PP3.Resize.Width, filecount));
     crvs.Add(CurveName.Resize_Height.ToString(), new GCurve(CurveName.Resize_Height, 32, 10376, PP3.Resize.Height, filecount));
     crvs.Add(CurveName.ColorManagement_GammaValue.ToString(), new GCurve(CurveName.ColorManagement_GammaValue, 1, 3.5, (float)PP3.ColorManagement.GammaValue, filecount));
     crvs.Add(CurveName.ColorManagement_GammaSlope.ToString(), new GCurve(CurveName.ColorManagement_GammaSlope, 0, 15, (float)PP3.ColorManagement.GammaSlope, filecount));
     crvs.Add(CurveName.DirectionalPyramidEqualizer_Mult0.ToString(), new GCurve(CurveName.DirectionalPyramidEqualizer_Mult0, 0, 4, (float)PP3.DirectionalPyramidEqualizer.Mult0, filecount));
     crvs.Add(CurveName.DirectionalPyramidEqualizer_Mult1.ToString(), new GCurve(CurveName.DirectionalPyramidEqualizer_Mult1, 0, 4, (float)PP3.DirectionalPyramidEqualizer.Mult1, filecount));
     crvs.Add(CurveName.DirectionalPyramidEqualizer_Mult2.ToString(), new GCurve(CurveName.DirectionalPyramidEqualizer_Mult2, 0, 4, (float)PP3.DirectionalPyramidEqualizer.Mult2, filecount));
     crvs.Add(CurveName.DirectionalPyramidEqualizer_Mult3.ToString(), new GCurve(CurveName.DirectionalPyramidEqualizer_Mult3, 0, 4, (float)PP3.DirectionalPyramidEqualizer.Mult3, filecount));
     crvs.Add(CurveName.DirectionalPyramidEqualizer_Mult4.ToString(), new GCurve(CurveName.DirectionalPyramidEqualizer_Mult4, 0, 1, (float)PP3.DirectionalPyramidEqualizer.Mult4, filecount));
     crvs.Add(CurveName.RAW_FlatFieldBlurRadius.ToString(), new GCurve(CurveName.RAW_FlatFieldBlurRadius, 0, 200, PP3.RAW.FlatFieldBlurRadius, filecount));
     crvs.Add(CurveName.RAW_CARed.ToString(), new GCurve(CurveName.RAW_CARed, -4, 4, (float)PP3.RAW.CARed, filecount));
     crvs.Add(CurveName.RAW_CABlue.ToString(), new GCurve(CurveName.RAW_CABlue, -4, 4, (float)PP3.RAW.CABlue, filecount));
     crvs.Add(CurveName.RAW_LineDenoise.ToString(), new GCurve(CurveName.RAW_LineDenoise, 0, 1000, PP3.RAW.LineDenoise, filecount));
     crvs.Add(CurveName.RAW_GreenEqThreshold.ToString(), new GCurve(CurveName.RAW_GreenEqThreshold, 0, 100, PP3.RAW.GreenEqThreshold, filecount));
     crvs.Add(CurveName.RAW_CcSteps.ToString(), new GCurve(CurveName.RAW_CcSteps, 0, 5, PP3.RAW.CcSteps, filecount));
     crvs.Add(CurveName.RAW_DCBIterations.ToString(), new GCurve(CurveName.RAW_DCBIterations, 2, 2, PP3.RAW.DCBIterations, filecount));
     crvs.Add(CurveName.RAW_PreExposure.ToString(), new GCurve(CurveName.RAW_PreExposure, 0.10000000000000001, 16, (float)PP3.RAW.PreExposure, filecount));
     crvs.Add(CurveName.RAW_PrePreserv.ToString(), new GCurve(CurveName.RAW_PrePreserv, 0, 2.5, (float)PP3.RAW.PrePreserv, filecount));
     crvs.Add(CurveName.RAW_PreBlackzero.ToString(), new GCurve(CurveName.RAW_PreBlackzero, -50, 50, (float)PP3.RAW.PreBlackzero, filecount));
     crvs.Add(CurveName.RAW_PreBlackone.ToString(), new GCurve(CurveName.RAW_PreBlackone, -50, 50, (float)PP3.RAW.PreBlackone, filecount));
     crvs.Add(CurveName.RAW_PreBlacktwo.ToString(), new GCurve(CurveName.RAW_PreBlacktwo, -50, 50, (float)PP3.RAW.PreBlacktwo, filecount));
     crvs.Add(CurveName.RAW_PreBlackthree.ToString(), new GCurve(CurveName.RAW_PreBlackthree, -50, 50, (float)PP3.RAW.PreBlackthree, filecount));
 }
Ejemplo n.º 3
0
    private void RenderPreview()
    {
        int PrevIndex = (int)PrevIndexSpin.Value - 1;

        if (AllFiles.Count > 1 && BrightnessCalculated && AllFiles[PrevIndex].Height > 0)
        {
            ProgState = ProgramState.PreviewRender;
            int width, height;
            double fac = AllFiles[PrevIndex].Width / AllFiles[PrevIndex].Height;
            if (AllFiles[PrevIndex].Width > AllFiles[PrevIndex].Height)
            {
                width = 600;
                height = (int)(width / fac);
            }
            else
            {
                height = 400;
                width = (int)(height * fac);
            }

            string prevPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "preview");
            string command = " -o " + "\"" + prevPath + "\"" + " -S " + "-j[95]" + " -c";

            if (InterpolatePP3())
            {
                for (int i = 0; i < PrevCountSpin.Value; i++)
                {
                    PP3Values neutral = new PP3Values();
                    neutral.Resize.Width = width;
                    neutral.Resize.Height = height;
                    neutral.Resize.Enabled = true;
                    neutral.VignettingCorrection = AllFiles[PrevIndex + i].PP3.VignettingCorrection;
                    neutral.WhiteBalance = AllFiles[PrevIndex + i].PP3.WhiteBalance;
                    neutral.ColorManagement = AllFiles[PrevIndex + i].PP3.ColorManagement;
                    neutral.RAW = AllFiles[PrevIndex + i].PP3.RAW;
                    neutral.Exposure = AllFiles[PrevIndex + i].PP3.Exposure;
                    neutral.Exposure.Auto = false;
                    neutral.NewCompensation = AllFiles[PrevIndex + i].PP3.Exposure.Compensation + AllFiles[PrevIndex + i].PP3.NewCompensation;
                    neutral.WriteFile(AllFiles[PrevIndex + i].FilePath + ".pp3");
                    command += " \"" + AllFiles[PrevIndex + i].FilePath + "\"";
                }
            }
            else { return; }
            
            //the windows command line can´t take longer commands than 8191 characters
            if (command.Length > 8191 && Environment.OSVersion.Platform == PlatformID.Win32NT)
            {
                UpdateInfo(InfoType.LongCommand, 1);
            }

            if (Directory.Exists(prevPath))
            {
                string[] files = Directory.GetFiles(prevPath);
                if (files.Length > 0)
                {
                    foreach (string path in files) { File.Delete(path); }
                }
            }
            else { Directory.CreateDirectory(prevPath); }
            
            UpdateInfo(InfoType.PreviewCalc, 0);
            
            BackCounter.Start();

            ProgressFileWatcher.Filter = "*.jpg";
            ProgressFileWatcher.Path = prevPath;
            ProgressFileWatcher.EnableRaisingEvents = true;

            ProgressPulse.Start();

            RTBackground.RunWorkerAsync(command);
        }
    }
Ejemplo n.º 4
0
    private void ResetProject()
    {
        table.Clear();
        AllFiles.Clear();
        AllCurves.Clear();
        MovePoint = new KeyValuePair<int, bool>(0, false);
        MainPP3 = new PP3Values();
        MainPP3.Name = "Main";
        SaveButton.Sensitive = true;
        CurveSelectBox.Model = new ListStore(typeof(string));
        BrightnessCalculated = false;
        PPfileOpened = false;
        CountdownRunning = false;
        BrScale.Value = 0;
        BrScaleEntry.Text = "0,00";

        if (PreviewImg.Pixbuf != null) { PreviewImg.Pixbuf.Dispose(); }
        PreviewImg.Pixbuf = null;

        //Clear Graph
        Graph.Color = new Cairo.Color(0.9, 0.9, 0.9);
        Graph.Rectangle(0, 0, GraphArea.Allocation.Width, GraphArea.Allocation.Height);
        Graph.Fill();

        deleteThumbs();
        deletePPFiles(MySettings.KeepPP);
        ProcessCancelled = false;
        ProjectSavePath = String.Empty;

        MainNotebook.Page = 0;
        SetSaveStatus(false);
        UpdateInfo(InfoType.Default, 0);
    }