public void CopyFrom(GlobalOptions source) { this.showOriginalInsteadOfProcessed = source.showOriginalInsteadOfProcessed; this.showAnnotationsPrimary = source.showAnnotationsPrimary; this.showAnnotationsDetail = source.showAnnotationsDetail; this.showShrinkExpandDetail = source.showShrinkExpandDetail; this.showAutoCropGrid = source.showAutoCropGrid; this.showPolyUnbiasGrid = source.showPolyUnbiasGrid; this.lastSelected = (int[])source.lastSelected.Clone(); this.lastSelectedSwap = source.lastSelectedSwap; this.jpegQuality = source.jpegQuality; this.jpegUseGDI = source.jpegUseGDI; this.shrink = source.shrink; this.shrinkFactor = source.shrinkFactor; this.autoCrop = source.autoCrop; this.autoCropLeftLimit = source.autoCropLeftLimit; this.autoCropTopLimit = source.autoCropTopLimit; this.autoCropRightLimit = source.autoCropRightLimit; this.autoCropBottomLimit = source.autoCropBottomLimit; this.autoCropMinMedianBrightness = source.autoCropMinMedianBrightness; this.autoCropUseEdgeColor = source.autoCropUseEdgeColor; this.rightRotations = source.rightRotations; this.brightAdjust = source.brightAdjust; this.brightAdjustMinClusterFrac = source.brightAdjustMinClusterFrac; this.brightAdjustWhiteCorrect = source.brightAdjustWhiteCorrect; this.unbias = source.unbias; this.unbiasMaxDegree = source.unbiasMaxDegree; this.unbiasMaxChisq = source.unbiasMaxChisq; this.unbiasMaxS = source.unbiasMaxS; this.unbiasMinV = source.unbiasMinV; this.oneBit = source.oneBit; this.oneBitChannel = source.oneBitChannel; this.oneBitThreshhold = source.oneBitThreshhold; this.oneBitOutputFormat = source.oneBitOutputFormat; this.oneBitScaleUp = source.oneBitScaleUp; this.staticSaturate = source.staticSaturate; this.staticSaturateWhiteThreshhold = source.staticSaturateWhiteThreshhold; this.staticSaturateBlackThreshhold = source.staticSaturateBlackThreshhold; this.staticSaturateExponent = source.staticSaturateExponent; this.enableAutoNormalizeGeometry = source.enableAutoNormalizeGeometry; this.autoNormalizeGeometryAspectHeight = source.autoNormalizeGeometryAspectHeight; this.autoNormalizeGeometryAspectWidth = source.autoNormalizeGeometryAspectWidth; this.normalizeGeometryPreviewInterp = source.normalizeGeometryPreviewInterp; this.normalizeGeometryFinalInterp = source.normalizeGeometryFinalInterp; this.timestamps = source.timestamps; this.timestampsOverwriteExisting = source.timestampsOverwriteExisting; this.timestampsExifMissingModifiedInsteadOfCreated = source.timestampsExifMissingModifiedInsteadOfCreated; }
private void SelectOneBitFormat(OutputTransforms.OutputFormat format, bool updateSource) { if (lockOutOneBitFormat != 0) { return; } try { lockOutOneBitFormat++; radioButtonOneBitOutputPng.Checked = false; radioButtonOneBitOutputBmp.Checked = false; if (updateSource) { options.OneBitOutputFormat = format; } switch (format) { default: Debug.Assert(false); break; case OutputTransforms.OutputFormat.Bmp: radioButtonOneBitOutputBmp.Checked = true; break; case OutputTransforms.OutputFormat.Png: radioButtonOneBitOutputPng.Checked = true; break; } } finally { lockOutOneBitFormat--; } }
public GlobalOptions(XPathNavigator nav) { if (nav != null) { this.showOriginalInsteadOfProcessed = nav.SelectSingleNode("ui/showOriginalInsteadOfProcessed").ValueAsBoolean; this.showAnnotationsPrimary = nav.SelectSingleNode("ui/showAnnotationsPrimary").ValueAsBoolean; this.showAnnotationsDetail = nav.SelectSingleNode("ui/showAnnotationsDetail").ValueAsBoolean; this.showShrinkExpandDetail = nav.SelectSingleNode("ui/showShrinkExpandDetail").ValueAsBoolean; this.showAutoCropGrid = nav.SelectSingleNode("ui/showAutoCropGrid").ValueAsBoolean; this.showPolyUnbiasGrid = nav.SelectSingleNode("ui/showPolyUnbiasGrid").ValueAsBoolean; { List <int> items = new List <int>(); foreach (XPathNavigator index in nav.Select("ui/lastSelected/index")) { items.Add(index.ValueAsInt); } this.lastSelected = items.ToArray(); } this.lastSelectedSwap = nav.SelectSingleNode("ui/lastSelectedSwap").ValueAsInt; this.jpegQuality = nav.SelectSingleNode("jpegQuality").ValueAsInt; this.jpegUseGDI = nav.SelectSingleNode("jpegUseGDI").ValueAsBoolean; this.shrink = nav.SelectSingleNode("shrink/enable").ValueAsBoolean; this.shrinkFactor = nav.SelectSingleNode("shrink/shrinkFactor").ValueAsInt; this.autoCrop = nav.SelectSingleNode("autoCrop/enable").ValueAsBoolean; this.autoCropLeftLimit = (float)nav.SelectSingleNode("autoCrop/leftLimit").ValueAsDouble; this.autoCropTopLimit = (float)nav.SelectSingleNode("autoCrop/topLimit").ValueAsDouble; this.autoCropRightLimit = (float)nav.SelectSingleNode("autoCrop/rightLimit").ValueAsDouble; this.autoCropBottomLimit = (float)nav.SelectSingleNode("autoCrop/bottomLimit").ValueAsDouble; this.autoCropMinMedianBrightness = (float)nav.SelectSingleNode("autoCrop/minMedianBrightness").ValueAsDouble; this.rightRotations = nav.SelectSingleNode("rightRotations").ValueAsInt; this.brightAdjust = nav.SelectSingleNode("brightAdjust/enable").ValueAsBoolean; this.brightAdjustMinClusterFrac = (float)nav.SelectSingleNode("brightAdjust/minClusterFrac").ValueAsDouble; this.brightAdjustWhiteCorrect = nav.SelectSingleNode("brightAdjust/whiteCorrect").ValueAsBoolean; this.unbias = nav.SelectSingleNode("polyUnbias/enable").ValueAsBoolean; this.unbiasMaxDegree = nav.SelectSingleNode("polyUnbias/maxDegree").ValueAsInt; this.unbiasMaxChisq = (float)nav.SelectSingleNode("polyUnbias/maxChisq").ValueAsDouble; this.oneBit = nav.SelectSingleNode("oneBit/enable").ValueAsBoolean; this.oneBitChannel = (Transforms.Channel)nav.SelectSingleNode("oneBit/channel").ValueAsInt; this.oneBitThreshhold = (float)nav.SelectSingleNode("oneBit/threshhold").ValueAsDouble; this.oneBitOutputFormat = (OutputTransforms.OutputFormat)nav.SelectSingleNode("oneBit/outputFormat").ValueAsInt; this.oneBitScaleUp = nav.SelectSingleNode("oneBit/scaleUp").ValueAsBoolean; this.staticSaturate = nav.SelectSingleNode("staticSaturate/enable").ValueAsBoolean; this.staticSaturateWhiteThreshhold = (float)nav.SelectSingleNode("staticSaturate/whiteThreshhold").ValueAsDouble; this.staticSaturateBlackThreshhold = (float)nav.SelectSingleNode("staticSaturate/blackThreshhold").ValueAsDouble; this.staticSaturateExponent = (float)nav.SelectSingleNode("staticSaturate/exponent").ValueAsDouble; this.enableAutoNormalizeGeometry = nav.SelectSingleNode("normalizeGeometry/enable").ValueAsBoolean; this.autoNormalizeGeometryAspectHeight = (float?)nav.SelectSingleNode("normalizeGeometry/autoNormalizeGeometryAspectHeight")?.ValueAsDouble; this.autoNormalizeGeometryAspectWidth = (float?)nav.SelectSingleNode("normalizeGeometry/autoNormalizeGeometryAspectWidth")?.ValueAsDouble; this.normalizeGeometryPreviewInterp = (Transforms.InterpMethod)Enum.Parse(typeof(Transforms.InterpMethod), nav.SelectSingleNode("normalizeGeometry/normalizeGeometryPreviewInterp").Value); this.normalizeGeometryFinalInterp = (Transforms.InterpMethod)Enum.Parse(typeof(Transforms.InterpMethod), nav.SelectSingleNode("normalizeGeometry/normalizeGeometryFinalInterp").Value); } }