/// <summary> /// Returns the image processing command. /// </summary> /// <returns>The image processing command.</returns> public override Vintasoft.Imaging.ImageProcessing.ProcessingCommandBase GetProcessingCommand() { LevelsCommand command = new LevelsCommand(); ChannelRemapSettings settings = new ChannelRemapSettings( (int)sourceMinValueEditorControl.Value, (int)sourceMaxValueEditorControl.Value, (double)gammaValueEditorControl.Value, (int)destinationMinValueEditorControl.Value, (int)destinationMaxValueEditorControl.Value); if (redCheckBox.Checked) { command.RedChannelSettings = settings; } if (greenCheckBox.Checked) { command.GreenChannelSettings = settings; } if (blueCheckBox.Checked) { command.BlueChannelSettings = settings; } return(command); }
/// <summary> /// Sets the default settings of value editor controls. /// </summary> private void SetDefaultSettings() { LevelsCommand command = new LevelsCommand(); ChannelRemapSettings settings = command.RedChannelSettings; sourceMinValueEditorControl.DefaultValue = settings.InputMin; sourceMaxValueEditorControl.DefaultValue = settings.InputMax; destinationMinValueEditorControl.DefaultValue = settings.OutputMin; destinationMaxValueEditorControl.DefaultValue = settings.OutputMax; gammaValueEditorControl.DefaultValue = (float)settings.Gamma; sourceMinValueEditorControl.Value = settings.InputMin; sourceMaxValueEditorControl.Value = settings.InputMax; destinationMinValueEditorControl.Value = settings.OutputMin; destinationMaxValueEditorControl.Value = settings.OutputMax; gammaValueEditorControl.Value = (float)settings.Gamma; }