public override void Create()
        {
            ShaderProperties.Init(32); //hack for now

            blurAlgorithm = new ScalableBlur();
            pass          = new TranslucentImageBlurRenderPass();

            tisCache.Clear();
        }
        public override void Create()
        {
            ShaderId.Init(32); //hack for now

            blurAlgorithm = new ScalableBlur();

            pass = new TranslucentImageBlurRenderPass();
            pass.renderPassEvent = RenderPassEvent.AfterRendering;

            tisCache.Clear();
        }
예제 #3
0
        void InitializeBlurAlgorithm()
        {
            switch (blurAlgorithmSelection)
            {
            case BlurAlgorithmType.ScalableBlur:
                blurAlgorithm = new ScalableBlur();
                break;

            default:
                throw new ArgumentOutOfRangeException("BlurAlgorithmSelection");
            }

            blurAlgorithm.Init(BlurConfig);
        }
예제 #4
0
        public BlockingBlurController(View blurView, View rootView, Color overlayColor)
        {
            _blurView      = blurView ?? throw new ArgumentNullException(nameof(blurView));
            _rootView      = rootView ?? throw new ArgumentNullException(nameof(rootView));
            _overlayColor  = overlayColor;
            _blurAlgorithm = new NoOpBlurAlgorithm();

            int measuredWidth  = blurView.MeasuredWidth;
            int measuredHeight = blurView.MeasuredHeight;

            if (IsZeroSized(measuredWidth, measuredHeight))
            {
                DeferBitmapCreation();
                return;
            }

            Init(measuredWidth, measuredHeight);
        }
예제 #5
0
        protected override void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                _disposed = true;
                if (disposing)
                {
                    SetBlurAutoUpdateInternal(false);
                    if (_blurAlgorithm != null)
                    {
                        _blurAlgorithm.Dispose();
                        _blurAlgorithm = null;
                    }
                    if (_internalBitmap != null)
                    {
                        _internalBitmap.Recycle();
                        _internalBitmap = null;
                    }
                }
            }

            base.Dispose(disposing);
        }
예제 #6
0
 public IBlurViewFacade SetBlurAlgorithm(IBlurAlgorithm algorithm)
 {
     _blurAlgorithm = algorithm;
     return(this);
 }
예제 #7
0
 public BlurEffect(IBlurAlgorithm blurAlgorithm)
 {
     this.blurAlgorithm = blurAlgorithm;
 }