public void DrawImageSilhouette(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) * this.size.X + position.X;
int endInputIndex = inputIndex + size.X;
bool code = (position.X ^ y) != 1;
for (; inputIndex < endInputIndex; inputIndex++, outputIndex++, code = !code) {
int value = data[inputIndex];
if (value != maskIndex)
this.data[outputIndex] = code ? ColorB : ColorA;
}
}
}