public Options(Item item) { this.jpegQuality = item.JpegQuality; this.jpegUseGdi = item.JpegUseGdi; this.shrink = item.Shrink; this.shrinkFactor = item.ShrinkFactor; this.brightAdjust = item.BrightAdjust; this.brightAdjustMinClusterFrac = item.BrightAdjustMinClusterFrac; this.brightAdjustWhiteCorrect = item.BrightAdjustWhiteCorrect; this.unbias = item.Unbias; this.unbiasMaxDegree = item.UnbiasMaxDegree; this.unbiasMaxChisq = item.UnbiasMaxChisq; this.oneBit = item.OneBit; this.oneBitChannel = item.OneBitChannel; this.oneBitThreshhold = item.OneBitThreshhold; this.staticSaturate = item.StaticSaturate; this.staticSaturateWhiteThreshhold = item.StaticSaturateWhiteThreshhold; this.staticSaturateBlackThreshhold = item.StaticSaturateBlackThreshhold; this.staticSaturateExponent = item.StaticSaturateExponent; this.normalizeGeometry = item.NormalizeGeometry; this.cropRect = item.CropRect; }
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 SelectOneBitChannel(Transforms.Channel channel, bool updateSource) { if (lockOutOneBitChannel != 0) { return; } try { lockOutOneBitChannel++; radioButtonOneBitChannelAll.Checked = false; radioButtonOneBitChannelR.Checked = false; radioButtonOneBitChannelG.Checked = false; radioButtonOneBitChannelB.Checked = false; if (updateSource) { options.OneBitChannel = channel; } switch (channel) { default: Debug.Assert(false); break; case Transforms.Channel.Composite: radioButtonOneBitChannelAll.Checked = true; break; case Transforms.Channel.R: radioButtonOneBitChannelR.Checked = true; break; case Transforms.Channel.G: radioButtonOneBitChannelG.Checked = true; break; case Transforms.Channel.B: radioButtonOneBitChannelB.Checked = true; break; } } finally { lockOutOneBitChannel--; } }
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); } }