Pinta.ImageManipulation.BitVector2DSurfaceAdapter.SetUnchecked C# (CSharp) Method

SetUnchecked() public method

public SetUnchecked ( int x, int y, bool newValue ) : void
x int
y int
newValue bool
return void
		public unsafe void SetUnchecked (int x, int y, bool newValue)
		{
			int cx = x / 32;
			int sx = x % 32;
			ColorBgra* ptr = surface.GetPointAddress (cx, y);
			uint mask = ptr->Bgra;
			uint slice = ((uint)1 << sx);
			uint newMask;

			if (newValue) {
				newMask = mask | slice;
			} else {
				newMask = mask & ~slice;
			}

			ptr->Bgra = newMask;
		}