Enum ClearMode
- Namespace
- Egami
- Assembly
- Egami.dll
Says whether new pixel memory is cleared.
public enum ClearMode
Fields
None = 0Leave whatever the memory held. Use this when every pixel will be written anyway.
Zero = 1Set every byte to zero.
Examples
private sealed class CountingSource(IPixelMemorySource inner) : IPixelMemorySource
{
public int Blocks;
public long Bytes;
public int MaxBlockBytes => inner.MaxBlockBytes;
public IMemoryOwner<byte> Allocate(int byteLength, ClearMode clear)
{
Interlocked.Increment(ref Blocks);
Interlocked.Add(ref Bytes, byteLength);
return inner.Allocate(byteLength, clear); // ClearMode.Zero when the caller needs zeroed memory
}
}