/// <inheritdoc />
            internal override void PackFromRgbPlanes(
                Configuration configuration,
                ReadOnlySpan <byte> redChannel,
                ReadOnlySpan <byte> greenChannel,
                ReadOnlySpan <byte> blueChannel,
                Span <Rgb24> destination)
            {
                Guard.NotNull(configuration, nameof(configuration));
                int count = redChannel.Length;

                GuardPackFromRgbPlanes(greenChannel, blueChannel, destination, count);

                SimdUtils.PackFromRgbPlanes(configuration, redChannel, greenChannel, blueChannel, destination);
            }
Example #2
0
            /// <inheritdoc />
            internal override void PackFromRgbPlanes(
                Configuration configuration,
                ReadOnlySpan <byte> redChannel,
                ReadOnlySpan <byte> greenChannel,
                ReadOnlySpan <byte> blueChannel,
                Span <Rgb24> destination)
            {
                Guard.NotNull(configuration, nameof(configuration));
                int count = redChannel.Length;

                Guard.IsTrue(greenChannel.Length == count, nameof(greenChannel), "Channels must be of same size!");
                Guard.IsTrue(blueChannel.Length == count, nameof(blueChannel), "Channels must be of same size!");
                Guard.IsTrue(destination.Length > count + 2, nameof(destination), "'destination' must contain a padding of 3 elements!");

                SimdUtils.PackFromRgbPlanes(configuration, redChannel, greenChannel, blueChannel, destination);
            }
            /// <inheritdoc />
            internal override void PackFromRgbPlanes(
                Configuration configuration,
                ReadOnlySpan <byte> redChannel,
                ReadOnlySpan <byte> greenChannel,
                ReadOnlySpan <byte> blueChannel,
                Span <Rgba32> destination)
            {
                Guard.NotNull(configuration, nameof(configuration));
                int count = redChannel.Length;

                Guard.IsTrue(greenChannel.Length == count, nameof(greenChannel), "Channels must be of same size!");
                Guard.IsTrue(blueChannel.Length == count, nameof(blueChannel), "Channels must be of same size!");
                Guard.IsTrue(destination.Length > count, nameof(destination), "'destination' span should not be shorter than the source channels!");

                SimdUtils.PackFromRgbPlanes(configuration, redChannel, greenChannel, blueChannel, destination);
            }