public void DrawImage(Vector2i position, Vector2i size, int[] data, int offset, int pitch, int maskIndex)
{
SetupDrawImage(ref position, ref size, ref data, ref offset, ref pitch);
for (int y = 0; y < size.Y; y++) {
int inputIndex = offset + y * pitch;
int outputIndex = (y + position.Y) * Stride + position.X;
int endInputIndex = inputIndex + size.X;
for (; inputIndex < endInputIndex; inputIndex++, outputIndex++) {
int value = data[inputIndex];
if (value != maskIndex)
this.data[outputIndex] = value;
}
}
}