Example #1
0
        public WicMatteTransform(WicTransform prev) : base(prev)
        {
            if (Context.Settings.MatteColor.IsEmpty || (Context.PixelFormat != Consts.GUID_WICPixelFormat32bppBGRA && Context.PixelFormat != Consts.GUID_WICPixelFormat64bppBGRA))
            {
                return;
            }

            var mat = new WicMatte(Source, Context.Settings.MatteColor);

            Source = mat;
        }
        public WicMatteTransform(WicTransform prev) : base(prev)
        {
            if (Context.PixelFormat == PixelFormat.Pbgra128BppFloat)
            {
                Source = conv = new WicCustomPixelFormatConverter(Source, Consts.GUID_WICPixelFormat32bppBGRA);
                Context.PixelFormat = PixelFormat.Cache[Source.GetPixelFormat()];
            }

            if (Context.Settings.MatteColor.IsEmpty || Context.PixelFormat.ColorRepresentation != PixelColorRepresentation.Bgr || Context.PixelFormat.AlphaRepresentation == PixelAlphaRepresentation.None)
            {
                return;
            }

            Source = new WicMatte(Source, Context.Settings.MatteColor);
        }