Alexandria.Raster.DrawImageSilhouette C# (CSharp) Метод

DrawImageSilhouette() публичный Метод

Draw the image data, using the currently assigned color indices for any non-transparent parts of the image.
public DrawImageSilhouette ( Vector2i position, Vector2i size, int data, int offset, int pitch, int maskIndex ) : void
position Vector2i
size Vector2i
data int
offset int
pitch int
maskIndex int
Результат void
        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;
                }
            }
        }