protected override MaskManager CreateMaskManager(MaskProperties mask) { CustomTimeEditMaskProperties patchedMask = new CustomTimeEditMaskProperties(); patchedMask.Assign(mask); patchedMask.EditMask = Properties.GetFormatMaskAccessFunction(mask.EditMask, mask.Culture); return patchedMask.CreatePatchedMaskManager(); }
/// <summary> /// Sets <see cref="CubismMaskTransform"/>. /// </summary> /// <param name="value">Value to set.</param> /// <returns>Instance.</returns> internal CubismMaskRenderer SetMaskTransform(CubismMaskTransform value) { MaskProperties.SetVector(CubismShaderVariables.MaskTransform, value); return(this); }
/// <summary> /// Sets <see cref="CubismMaskTile"/>. /// </summary> /// <param name="value">Value to set.</param> /// <returns>Instance.</returns> internal CubismMaskRenderer SetMaskTile(CubismMaskTile value) { MaskProperties.SetVector(CubismShaderVariables.MaskTile, value); return(this); }
protected override MaskManager CreateMaskManager(MaskProperties mask) { CustomTimeEditMaskProperties patchedMask = new CustomTimeEditMaskProperties(); patchedMask.Assign(mask); patchedMask.EditMask = Properties.GetFormatMaskAccessFunction(mask.EditMask, mask.Culture); return(patchedMask.CreatePatchedMaskManager()); }
protected override MaskManager CreateMaskManager(MaskProperties mask) { MaskButtonEditMaskProperties patchedMask = new MaskButtonEditMaskProperties(this); patchedMask.Assign(mask); patchedMask.EditMask = Properties.Mask.EditMask; return(patchedMask.CreatePatchedMaskManager()); }
protected internal override MaskManager CreateMaskManager(MaskProperties mask) { if (mask.MaskType == MaskType.Custom) { return(new RichTextIndentMaskManager(Properties, uiUnitConverter)); } else { return(base.CreateMaskManager(mask)); } }
public override bool Equals(object obj) { if (!(obj is MaskProperties)) { return false; } MaskProperties other = (MaskProperties)obj; return other.enabled == enabled; }
/// <summary> /// Creates a mask from a given image. /// The image is scanned for light sources which are then converted to a mask. /// </summary> /// <param name="Input">Input image.</param> /// <param name="Properties">Masking data and parameters. The masking thresholds should be set; the other parameters are automatically filled in.</param> /// <param name="Stats">Image statistical information.</param> public static void CreateMasker(Image Input, MaskProperties Properties, ImageStatistics Stats) { Properties.Mean = Stats.ZeroLevel; Properties.StDev = Stats.StDev; Properties.MaskData = new BitArray[Input.Height]; Properties.MaskTransform = Input.Transform; for (int i = 0; i < Input.Height; i++) { Properties.MaskData[i] = new BitArray((int)Input.Width); } var p = Parameters; /*p.FillZero = false;*/ MaskGenerator.Run(Properties, Input, p); }
/// <summary> /// Enqueues /// </summary> /// <param name="buffer">Buffer to enqueue in.</param> internal void AddToCommandBuffer(CommandBuffer buffer) { // Lazily fetch drawable texture and mesh. var mainTexture = MainRenderer.MainTexture; var mesh = MainRenderer.Mesh; MaskProperties.SetTexture(CubismShaderVariables.MainTexture, mainTexture); // Add command. buffer.DrawMesh(mesh, Matrix4x4.identity, CubismBuiltinMaterials.Mask, 0, 0, MaskProperties); }
public override bool Equals(object obj) { if (!(obj is MaskProperties)) { return(false); } MaskProperties other = (MaskProperties)obj; return (other.enabled == enabled && other.showMaskGraphic == showMaskGraphic); }
protected override ChangeType CalculateDeltaChanges() { ChangeType changeType = ChangeType.None; MaskProperties newValues = new MaskProperties(maskBroadcaster); if (previousValues != newValues) { changeType |= ChangeType.Properties; previousValues = newValues; } return changeType; }
/// <summary> /// Creates a mask from an image. All light sources are detected via a hysteresis algorithm and flagged in the mask. /// </summary> /// <param name="Input">Input image data.</param> /// <param name="Position">Data position in the image.</param> /// <param name="Properties">Bag of mask data.</param> static void GenerateMask(double[,] Input, ImageSegmentPosition Position, MaskProperties Properties) { int Width = Input.GetLength(1); int Height = Input.GetLength(0); int i, j; PixelPoint pxp = new PixelPoint(); /* Compute masking thresholds */ double UpperThreshold = Properties.UTM * Properties.StDev + Properties.Mean; double LowerThreshold = Properties.LTM * Properties.StDev + Properties.Mean; for (i = 0; i < Height; i++) { for (j = 0; j < Width; j++) { pxp.X = j + Position.Alignment.X; pxp.Y = i + Position.Alignment.Y; if (pxp.Y >= Properties.MaskData.Length) { break; } if (pxp.X >= Properties.MaskData[(int)pxp.Y].Length) { break; } if (Properties.MaskData[(int)pxp.Y][(int)pxp.X]) { continue; } if (Input[i, j] > UpperThreshold) { BitmapFill(Properties.MaskData, Input, Position.Alignment, pxp, LowerThreshold, Properties.MaskRadiusMultiplier, Properties.ExtraMaskRadius, out Filtering.Star? Star); if (Star != null) { Filtering.Star S = Star.Value; S.EqCenter = Position.WCS.GetEquatorialPoint(S.PixCenter); lock (Properties.StarList) Properties.StarList.FixedStarList.Add(S); } } } } }
protected override MaskManager CreateMaskManager(MaskProperties mask) { return new PersianDateTimeMaskManager(); }
private void SetChangeMaskMoney(int mone) { var omsk = new MaskProperties() { Culture = new CultureInfo((mone == 1) ? "es-PE" : "en-US"), EditMask = "c2", MaskType = MaskType.Numeric, UseMaskAsDisplayFormat = true }; ritPrice.Mask.Assign(omsk); ritDiscount.Mask.Assign(omsk); ritAmount.Mask.Assign(omsk); txtNUM_SUBB_TOTA.Properties.Mask.Assign(omsk); txtNUM_DESC.Properties.Mask.Assign(omsk); txtNUM_IGVV.Properties.Mask.Assign(omsk); txtNUM_TOTA.Properties.Mask.Assign(omsk); decimal TIP_CAMB = 1; if (mone == 1) { if (txtNUM_TIPO_CAMB.EditValue == null) TIP_CAMB = ((xfMain)MdiParent).SESSION_NUM_TIPO_CAMB_COMP; } var lines = (List<BEDocumentLines>)gdvLines.DataSource; if (lines == null) return; lines.ForEach(item => { item.NUM_PREC_UNIT = Math.Round(item.NUM_PREC_UNIT_ORIG * TIP_CAMB, 2); item.NUM_DESC = Math.Round((item.NUM_PREC_UNIT * item.NUM_PORC_DESC) / 100, 2); item.NUM_PREC_DESC = item.NUM_PREC_UNIT - item.NUM_DESC; item.NUM_IMPO = item.NUM_CANT * item.NUM_PREC_DESC; }); gdvLines.RefreshData(); Set_Totals(); }
/// <summary> /// Masks the input image with a given mask. Masked pixels are set to -1 standard deviation. /// </summary> /// <param name="Input">Input image data.</param> /// <param name="Output">Output image data.</param> /// <param name="InputPosition">Input data position.</param> /// <param name="OutputPosition">Output data position.</param> /// <param name="Properties">Mask data.</param> static void MaskImage(double[,] Input, double[,] Output, ImageSegmentPosition InputPosition, ImageSegmentPosition OutputPosition, MaskProperties Properties) { int Width = Output.GetLength(1); int Height = Output.GetLength(0); int i, j; PixelPoint pxp = new PixelPoint(); for (i = 0; i < Height; i++) { for (j = 0; j < Width; j++) { pxp.X = j + OutputPosition.Alignment.X; pxp.Y = i + OutputPosition.Alignment.Y; EquatorialPoint ep = OutputPosition.WCS.GetEquatorialPoint(pxp); PixelPoint mpt = Properties.MaskTransform.GetPixelPoint(ep); mpt.X = Math.Round(mpt.X); mpt.Y = Math.Round(mpt.Y); if (mpt.X < 0 || mpt.X >= Properties.MaskData[0].Length) { continue; } if (mpt.Y < 0 || mpt.Y >= Properties.MaskData.Length) { continue; } PixelPoint ipt = InputPosition.WCS.GetPixelPoint(ep); ipt.X = Math.Round(ipt.X - InputPosition.Alignment.X); ipt.Y = Math.Round(ipt.Y - InputPosition.Alignment.Y); if (Properties.MaskData[(int)mpt.Y][(int)mpt.X]) { Output[i, j] = -Properties.StDev; } else { Output[i, j] = Input[(int)ipt.Y, (int)ipt.X] - Properties.Mean; } } } }
/// <summary> /// Masks an image. /// </summary> /// <param name="Input">Input image.</param> /// <param name="Output">Output image.</param> /// <param name="Properties">Masking data.</param> public static void MaskImage(Image Input, Image Output, MaskProperties Properties) { Masker.Run(Properties, Input, Output, Parameters); }
/// <summary> /// /// </summary> /// <param name="editorMask"></param> public static void SetEnglishEditorMask(this MaskProperties editorMask) { editorMask.MaskType = MaskType.RegEx; editorMask.EditMask = @"[a-zA-Z0-9\+\-\ \(\)\.\,\;\_\/\>\<\=\&\!\@\#\%\^\&\*\~\?]*"; editorMask.BeepOnError = true; }
protected override MaskManager CreateMaskManager(MaskProperties mask) { return new PersianDateTimeMaskManager(); }