Exemplo n.º 1
0
 protected override UIImage Transform(UIImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     using (var colorSpace = CGColorSpace.CreateDeviceGray())
     {
         return(ColorSpaceTransformation.ToColorSpace(sourceBitmap, colorSpace));
     }
 }
Exemplo n.º 2
0
        protected override UIImage Transform(UIImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            if (EnableSolidColor)
            {
                return(ToSolidColor(sourceBitmap, R, G, B, A));
            }

            RGBAWMatrix = FFColorMatrix.ColorToTintMatrix(R, G, B, A);

            return(base.Transform(sourceBitmap, path, source, isPlaceholder, key));
        }
 protected override UIImage Transform(UIImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     if (_colorMatrix != null)
     {
         return(ToFilter(sourceBitmap, _colorMatrix));
     }
     else
     {
         return(ToColorSpace(sourceBitmap, _colorSpace));
     }
 }
Exemplo n.º 4
0
 protected override NSImage Transform(NSImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     if (_colorMatrix != null)
     {
         return(Helpers.MainThreadDispatcher.PostForResult <NSImage>(() => ToFilter(sourceBitmap, _colorMatrix)));
     }
     else
     {
         return(Helpers.MainThreadDispatcher.PostForResult <NSImage>(() => ToColorSpace(sourceBitmap, _colorSpace)));
     }
 }
Exemplo n.º 5
0
        protected override NSImage Transform(NSImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            if (EnableSolidColor)
            {
                return(Helpers.MainThreadDispatcher.PostForResult <NSImage>(() => ToSolidColor(sourceBitmap, R, G, B, A)));
            }

            RGBAWMatrix = FFColorMatrix.ColorToTintMatrix(R, G, B, A);

            return(base.Transform(sourceBitmap, path, source, isPlaceholder, key));
        }
 protected override UIImage Transform(UIImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     using (var effect = new CIPhotoEffectMono()
     {
         Image = sourceBitmap.CGImage
     })
         using (var output = effect.OutputImage)
             using (var context = CIContext.FromOptions(null))
                 using (var cgimage = context.CreateCGImage(output, output.Extent))
                 {
                     return(UIImage.FromImage(cgimage));
                 }
 }
        protected override NSImage Transform(NSImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            switch (FlipType)
            {
            case FlipType.Vertical:
                throw new NotImplementedException();

            case FlipType.Horizontal:
                throw new NotImplementedException();

            default:
                throw new Exception("Invalid FlipType");
            }
        }
Exemplo n.º 8
0
        protected override UIImage Transform(UIImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            switch (FlipType)
            {
            case FlipType.Vertical:
                return(new UIImage(sourceBitmap.CGImage, sourceBitmap.CurrentScale, UIImageOrientation.DownMirrored));

            case FlipType.Horizontal:
                return(new UIImage(sourceBitmap.CGImage, sourceBitmap.CurrentScale, UIImageOrientation.UpMirrored));

            default:
                throw new Exception("Invalid FlipType");
            }
        }
Exemplo n.º 9
0
        protected override Bitmap Transform(Bitmap sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            switch (FlipType)
            {
            case FlipType.Vertical:
                return(Flip(sourceBitmap, 1, -1));

            case FlipType.Horizontal:
                return(Flip(sourceBitmap, -1, 1));

            default:
                throw new Exception("Invalid FlipType");
            }
        }
 protected override NSImage Transform(NSImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(Helpers.MainThreadDispatcher.PostForResult <NSImage>(() =>
     {
         using (var inputImage = CIImage.FromCGImage(sourceBitmap.CGImage))
             using (var filter = new CIPhotoEffectMono()
             {
                 Image = inputImage
             })
                 using (var resultImage = new NSCIImageRep(filter.OutputImage))
                 {
                     var nsImage = new NSImage(resultImage.Size);
                     nsImage.AddRepresentation(resultImage);
                     return nsImage;
                 }
     }));
 }
        protected override Bitmap Transform(Bitmap sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            double sourceWidth  = sourceBitmap.Width;
            double sourceHeight = sourceBitmap.Height;
            Bitmap bitmap       = Bitmap.CreateBitmap((int)sourceWidth, (int)sourceHeight, Bitmap.Config.Argb8888);

            bitmap.HasAlpha = true;

            using (Canvas canvas = new Canvas(bitmap))
                using (Paint paint = new Paint())
                {
                    paint.AntiAlias = true;
                    canvas.DrawColor(HexColor.ToColor());
                    canvas.DrawBitmap(sourceBitmap, 0, 0, paint);

                    return(bitmap);
                }
        }
Exemplo n.º 12
0
        protected override BitmapHolder Transform(BitmapHolder bitmapSource, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            if (EnableSolidColor)
            {
                ToReplacedColor(bitmapSource, R, G, B, A);
                return(bitmapSource);
            }

            RGBAWMatrix = FFColorMatrix.ColorToTintMatrix(R, G, B, A);

            return(base.Transform(bitmapSource, path, source, isPlaceholder, key));
        }
 protected override BitmapHolder Transform(BitmapHolder bitmapSource, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToRounded(bitmapSource, (int)Radius, CropWidthRatio, CropHeightRatio, BorderSize, BorderHexColor));
 }
Exemplo n.º 14
0
 protected override Bitmap Transform(Bitmap sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToCropped(sourceBitmap, ZoomFactor, XOffset, YOffset, CropWidthRatio, CropHeightRatio));
 }
Exemplo n.º 15
0
 protected override BitmapHolder Transform(BitmapHolder bitmapSource, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToRotated(bitmapSource, Degrees, CCW, Resize));
 }
 protected override NSImage Transform(NSImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(Helpers.MainThreadDispatcher.PostForResult <NSImage>(() => ToTransformedCorners(sourceBitmap, TopLeftCornerSize, TopRightCornerSize, BottomLeftCornerSize, BottomRightCornerSize,
                                                                                            CornersTransformType, CropWidthRatio, CropHeightRatio)));
 }
Exemplo n.º 17
0
 protected override UIImage Transform(UIImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToRounded(sourceBitmap, (nfloat)Radius, CropWidthRatio, CropHeightRatio, BorderSize, BorderHexColor));
 }
 protected override Bitmap Transform(Bitmap sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToColorSpace(sourceBitmap, _colorMatrix));
 }
Exemplo n.º 19
0
 protected override Bitmap Transform(Bitmap sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(RoundedTransformation.ToRounded(sourceBitmap, 0f, 1f, 1f, BorderSize, BorderHexColor));
 }
Exemplo n.º 20
0
 protected override NSImage Transform(NSImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(Helpers.MainThreadDispatcher.PostForResult <NSImage>(() => ToSepia(sourceBitmap)));
 }
Exemplo n.º 21
0
 protected override Bitmap Transform(Bitmap sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToTransformedCorners(sourceBitmap, TopLeftCornerSize, TopRightCornerSize, BottomLeftCornerSize, BottomRightCornerSize,
                                 CornersTransformType, CropWidthRatio, CropHeightRatio));
 }
Exemplo n.º 22
0
 protected override Bitmap Transform(Bitmap sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToBlurred(sourceBitmap, _context, (float)Radius));
 }
 protected override UIImage Transform(UIImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToSepia(sourceBitmap));
 }
Exemplo n.º 24
0
 protected override BitmapHolder Transform(BitmapHolder bitmapSource, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToFlipped(bitmapSource, FlipType));
 }
Exemplo n.º 25
0
 public ImageSourceBinding(Work.ImageSource imageSource, string path)
 {
     ImageSource = imageSource;
     Path        = path;
 }
Exemplo n.º 26
0
        protected override BitmapHolder Transform(BitmapHolder bitmapSource, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            ToColorSpace(bitmapSource, _rgbawMatrix);

            return(bitmapSource);
        }
Exemplo n.º 27
0
 protected override Bitmap Transform(Bitmap sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(ToGrayscale(sourceBitmap));
 }
Exemplo n.º 28
0
 protected override NSImage Transform(NSImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(Helpers.MainThreadDispatcher.PostForResult <NSImage>(() => ToRounded(sourceBitmap, (nfloat)Radius, CropWidthRatio, CropHeightRatio, BorderSize, BorderHexColor)));
 }
        protected override BitmapHolder Transform(BitmapHolder bitmapSource, string path, Work.ImageSource source, bool isPlaceholder, string key)
        {
            ToGrayscale(bitmapSource);

            return(bitmapSource);
        }
Exemplo n.º 30
0
 protected override NSImage Transform(NSImage sourceBitmap, string path, Work.ImageSource source, bool isPlaceholder, string key)
 {
     return(Helpers.MainThreadDispatcher.PostForResult <NSImage>(() => RoundedTransformation.ToRounded(sourceBitmap, 0f, 1f, 1f, BorderSize, BorderHexColor)));
 }