Class MemoryAllocatorExtensions
- Namespace
- SixLabors.ImageSharp.Memory
- Assembly
- SixLabors.ImageSharp.dll
Extension methods for MemoryAllocator.
public static class MemoryAllocatorExtensions
- Inheritance
-
MemoryAllocatorExtensions
- Inherited Members
Methods
Allocate2D<T>(MemoryAllocator, Size, AllocationOptions)
Allocates a buffer of value type objects interpreted as a 2D region
of size width x size height elements.
public static Buffer2D<T> Allocate2D<T>(this MemoryAllocator memoryAllocator, Size size, AllocationOptions options = AllocationOptions.None) where T : struct
Parameters
memoryAllocatorMemoryAllocatorThe memory allocator.
sizeSizeThe buffer size.
optionsAllocationOptionsThe allocation options.
Returns
- Buffer2D<T>
The Buffer2D<T>.
Type Parameters
TThe type of buffer items to allocate.
Allocate2D<T>(MemoryAllocator, Size, bool, AllocationOptions)
Allocates a buffer of value type objects interpreted as a 2D region
of size width x size height elements.
public static Buffer2D<T> Allocate2D<T>(this MemoryAllocator memoryAllocator, Size size, bool preferContiguosImageBuffers, AllocationOptions options = AllocationOptions.None) where T : struct
Parameters
memoryAllocatorMemoryAllocatorThe memory allocator.
sizeSizeThe buffer size.
preferContiguosImageBuffersboolA value indicating whether the allocated buffer should be contiguous, unless bigger than MaxValue.
optionsAllocationOptionsThe allocation options.
Returns
- Buffer2D<T>
The Buffer2D<T>.
Type Parameters
TThe type of buffer items to allocate.
Allocate2D<T>(MemoryAllocator, int, int, AllocationOptions)
Allocates a buffer of value type objects interpreted as a 2D region
of width x height elements.
public static Buffer2D<T> Allocate2D<T>(this MemoryAllocator memoryAllocator, int width, int height, AllocationOptions options = AllocationOptions.None) where T : struct
Parameters
memoryAllocatorMemoryAllocatorThe memory allocator.
widthintThe buffer width.
heightintThe buffer height.
optionsAllocationOptionsThe allocation options.
Returns
- Buffer2D<T>
The Buffer2D<T>.
Type Parameters
TThe type of buffer items to allocate.
Allocate2D<T>(MemoryAllocator, int, int, bool, AllocationOptions)
Allocates a buffer of value type objects interpreted as a 2D region
of width x height elements.
public static Buffer2D<T> Allocate2D<T>(this MemoryAllocator memoryAllocator, int width, int height, bool preferContiguosImageBuffers, AllocationOptions options = AllocationOptions.None) where T : struct
Parameters
memoryAllocatorMemoryAllocatorThe memory allocator.
widthintThe buffer width.
heightintThe buffer height.
preferContiguosImageBuffersboolA value indicating whether the allocated buffer should be contiguous, unless bigger than MaxValue.
optionsAllocationOptionsThe allocation options.
Returns
- Buffer2D<T>
The Buffer2D<T>.
Type Parameters
TThe type of buffer items to allocate.