public void Filtered() { using (var transparency = new TransparencyFilter()) { new FingerprintMatcher(FingerprintTemplateTest.ProbeGray()) .Match(FingerprintTemplateTest.MatchingGray()); Assert.IsEmpty(transparency.Keys); } }
/// <summary> /// Initializes this TransparencyControl /// </summary> /// <param name="bitmap">The Bitmap to generate the visualization for</param> public override void Initialize(Bitmap bitmap) { base.Initialize(bitmap); if (filter == null) { filter = new TransparencyFilter(); ((TransparencyFilter)filter).Transparency = 1; } }
public void TestEqualityUnordered() { TransparencyFilter filter1 = new TransparencyFilter { Transparency = 1.0f }; TransparencyFilter filter2 = new TransparencyFilter { Transparency = 0.0f }; FilterPreset preset1 = new FilterPreset("Preset 1", new IFilter[] { filter1, filter2 }); FilterPreset preset2 = new FilterPreset("Preset 2", new IFilter[] { filter2, filter1 }); Assert.IsTrue(preset1.Equals(preset2)); }
// // Decorate Main Image method // public override void DecorateMainBitmap(Bitmap bitmap) { base.DecorateMainBitmap(bitmap); if (!_layerStatuses[_layerController.ActiveLayerIndex].Visible) { FastBitmap.ClearBitmap(bitmap, Color.Transparent); } // Transparent layer else if (_layerStatuses[_layerController.ActiveLayerIndex].Transparency < 1) { TransparencyFilter filter = new TransparencyFilter { Transparency = _layerStatuses[_layerController.ActiveLayerIndex].Transparency }; filter.ApplyToBitmap(bitmap); } }
private void CreateConvolutionBmp(int width, int height, ParallelOptions parallelOptions) { var dataSource = this.GetValueSync<IDataSource2D<Vector>>(DataSourceProperty); if (dataSource == null) return; if (parallelOptions.CancellationToken.IsCancellationRequested) return; int[] pixels = null; if (unmodifiedWhiteNoize == null) { pixels = ImageHelper.CreateWhiteNoizeImage(width, height); unmodifiedWhiteNoize = new int[pixels.Length]; pixels.CopyTo(unmodifiedWhiteNoize, 0); } else { pixels = new int[unmodifiedWhiteNoize.Length]; unmodifiedWhiteNoize.CopyTo(pixels, 0); } if (parallelOptions.CancellationToken.IsCancellationRequested) return; UpdateBitmap(pixels); if (parallelOptions.CancellationToken.IsCancellationRequested) return; bool cancelled = false; int[] effectivePixels = CreateConvolutionArray(width, height, pixels, parallelOptions, out cancelled); if (cancelled) return; if (parallelOptions.CancellationToken.IsCancellationRequested) return; UpdateBitmap(effectivePixels); if (parallelOptions.CancellationToken.IsCancellationRequested) return; if (transparencyFilter == null) transparencyFilter = new TransparencyFilter(unmodifiedWhiteNoize); //effectivePixels = transparencyFilter.ApplyFilter(effectivePixels, width, height, dataSource.Data); effectivePixels = normalizeFilter.ApplyFilter(effectivePixels, width, height, dataSource.Data); if (parallelOptions.CancellationToken.IsCancellationRequested) return; effectivePixels = magnitudeFilter.ApplyFilter(effectivePixels, width, height, dataSource.Data); if (parallelOptions.CancellationToken.IsCancellationRequested) return; UpdateBitmap(effectivePixels); RaiseRenderingFinished(); }