Exemplo n.º 1
0
        public CancellableBitmapSource(IBitmapSource <TPixel> source, Func <RectInt32, IEnumerable <RectInt32> > sourceRectSplitter, Action <RectInt32> rectCompletedCallback, ICancellationToken cancelToken)
        {
            Validate.Begin().IsNotNull <IBitmapSource <TPixel> >(source, "source").IsNotNull <Func <RectInt32, IEnumerable <RectInt32> > >(sourceRectSplitter, "sourceRectSplitter").IsNotNull <ICancellationToken>(cancelToken, "cancelToken").Check();
            this.source                = source.CreateRef <TPixel>();
            this.sourceSize            = this.source.Size;
            this.sourceRectSplitter    = sourceRectSplitter;
            this.rectCompletedCallback = rectCompletedCallback;
            this.cancelToken           = cancelToken;
            TPixel local = default(TPixel);

            this.bytesPerPixel = local.BytesPerPixel;
        }
Exemplo n.º 2
0
 public ClippedBitmapSource(IBitmapSource <TPixel> source, RectInt32 sourceRect)
 {
     Validate.Begin().IsNotNull <IBitmapSource <TPixel> >(source, "source").Check().IsTrue(source.Bounds().Contains(sourceRect), "source.Bounds().Contains(sourceRect)").Check();
     this.source     = source.CreateRef <TPixel>();
     this.sourceRect = sourceRect;
 }
Exemplo n.º 3
0
 public static IBitmapSource <TPixel> CreateRef <TPixel>(this IBitmapSource <TPixel> objectRef) where TPixel : struct, INaturalPixelInfo =>
 ((IBitmapSource <TPixel>)objectRef.CreateRef(typeof(IBitmapSource <TPixel>)));
Exemplo n.º 4
0
 public static IBitmapSource CreateRef(this IBitmapSource objectRef) =>
 ((IBitmapSource)objectRef.CreateRef(typeof(IBitmapSource)));