public ArrayBasedCollection(IResizer resizer) { m_Resizer = resizer; int initialCapacity = m_Resizer.InitialCapacity; m_InnerArray = new T[initialCapacity]; Count = 0; }
public LocalFileProvider( IHostingEnvironment env, IHttpContextAccessor httpContextAccessor, IResizer resizer, IFileSystemHelper fileSystemHelper) { this.env = env; this.httpContextAccessor = httpContextAccessor; this.resizer = resizer; this.fileSystemHelper = fileSystemHelper; }
public BitmapSource GetFull(IResizer resizer, double scale = 1) { // need scale if (Math.Abs(scale - 1) > 0.0001) { return(GetPartial(resizer, new Int32Rect(0, 0, Width, Height), scale)); } // no need scale var dst = Misc.AllocWriteableBitmap(source.Width, source.Height, source.Depth, source.Channel); Misc.CopyToWritableBitmap(dst, source.FullBitmap); dst.Freeze(); return(dst); }
public BitmapSource GetPartial(IResizer resizer, Int32Rect pos, double scale) { var src = source.GetBitmap(pos); var result = Misc.AllocWriteableBitmap( (int)(pos.Width * scale), (int)(pos.Height * scale), src.Depth, src.Channel); result.Lock(); var dst = Misc.BitmapOfWritableBitmap(result); resizer.Resize(src, dst); result.AddDirtyRect(new Int32Rect(0, 0, result.PixelWidth, result.PixelHeight)); result.Unlock(); result.Freeze(); return(result); }
public void Test_Add_Remove(IResizer resizeStrategy) { var initial = new[] {0, 1, 2, 3, 4, 5, 6, 7}; var toRemove = new[] {2, 3, 5}; var collection = new ArrayBasedCollection<int>(resizeStrategy); foreach (int element in initial) { collection.Add(element); } CollectionAssert.AreEquivalent(initial, collection.ToArray()); foreach (int elementToRemove in toRemove) { collection.Remove(elementToRemove); } int[] expected = initial.Except(toRemove).ToArray(); CollectionAssert.AreEquivalent(expected, collection.ToArray()); collection.Clear(); int[] emptyArray = Enumerable.Empty<int>().ToArray(); CollectionAssert.AreEquivalent(emptyArray, collection.ToArray()); }
public void Test_Add_Remove(IResizer resizeStrategy) { var initial = new[] { 0, 1, 2, 3, 4, 5, 6, 7 }; var toRemove = new[] { 2, 3, 5 }; var collection = new ArrayBasedCollection <int>(resizeStrategy); foreach (int element in initial) { collection.Add(element); } CollectionAssert.AreEquivalent(initial, collection.ToArray()); foreach (int elementToRemove in toRemove) { collection.Remove(elementToRemove); } int[] expected = initial.Except(toRemove).ToArray(); CollectionAssert.AreEquivalent(expected, collection.ToArray()); collection.Clear(); int[] emptyArray = Enumerable.Empty <int>().ToArray(); CollectionAssert.AreEquivalent(emptyArray, collection.ToArray()); }
public OptionFixedResizer(IResizer resizer, object option) { this.resizer = resizer; this.option = option; }
public AutoSwitchResizer(IResizer enlarge, IResizer shrink, IDoubler doubler = null) { enlargeResizer = enlarge; shrinkResizer = shrink; this.doubler = doubler; }
public AzureBlobProvider(IOptions<AppSettings> appSettings, IResizer resizer) { this.appSettings = appSettings; this.resizer = resizer; }
public AzureBlobProvider(IOptions <AppSettings> appSettings, IResizer resizer) { this.appSettings = appSettings; this.resizer = resizer; }