Esempio n. 1
0
        /// <summary>
        /// Creates a new frame from the pixel data with the same dimensions as the other frames and inserts the
        /// new frame at the end of the collection.
        /// </summary>
        /// <param name="source">The raw pixel data to generate the <seealso cref="ImageFrame{TPixel}"/> from.</param>
        /// <returns>The new <see cref="ImageFrame{TPixel}"/>.</returns>
        public ImageFrame <TPixel> AddFrame(ReadOnlySpan <TPixel> source)
        {
            var frame = ImageFrame.LoadPixelData(
                this.parent.GetConfiguration(),
                source,
                this.RootFrame.Width,
                this.RootFrame.Height);

            this.frames.Add(frame);
            return(frame);
        }
        /// <inheritdoc/>
        public ImageFrame <TPixel> AddFrame(TPixel[] data)
        {
            var frame = ImageFrame.LoadPixelData(
                this.parent.GetMemoryManager(),
                new Span <TPixel>(data),
                this.RootFrame.Width,
                this.RootFrame.Height);

            this.frames.Add(frame);
            return(frame);
        }
        /// <summary>
        /// Creates a new frame from the pixel data with the same dimensions as the other frames and inserts the
        /// new frame at the end of the collection.
        /// </summary>
        /// <param name="source">The raw pixel data to generate the <seealso cref="ImageFrame{TPixel}"/> from.</param>
        /// <returns>The new <see cref="ImageFrame{TPixel}"/>.</returns>
        public ImageFrame <TPixel> AddFrame(TPixel[] source)
        {
            Guard.NotNull(source, nameof(source));

            var frame = ImageFrame.LoadPixelData(
                this.parent.GetConfiguration(),
                new ReadOnlySpan <TPixel>(source),
                this.RootFrame.Width,
                this.RootFrame.Height);

            this.frames.Add(frame);
            return(frame);
        }
Esempio n. 4
0
        /// <summary>
        /// Creates a new frame from the pixel data with the same dimensions as the other frames and inserts the
        /// new frame at the end of the collection.
        /// </summary>
        /// <param name="source">The raw pixel data to generate the <seealso cref="ImageFrame{TPixel}"/> from.</param>
        /// <returns>The new <see cref="ImageFrame{TPixel}"/>.</returns>
        public ImageFrame <TPixel> AddFrame(TPixel[] source)
        {
            Guard.NotNull(source, nameof(source));

            var frame = ImageFrame.LoadPixelData(
                this.parent.GetMemoryManager(),
                new Span <TPixel>(source),
                this.RootFrame.Width,
                this.RootFrame.Height);

            this.frames.Add(frame);
            return(frame);
        }