コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ImageFrame{TPixel}" /> class.
        /// </summary>
        /// <param name="memoryManager">The <see cref="MemoryManager"/> to use for buffer allocations.</param>
        /// <param name="width">The width of the image in pixels.</param>
        /// <param name="height">The height of the image in pixels.</param>
        /// <param name="metaData">The meta data.</param>
        internal ImageFrame(MemoryManager memoryManager, int width, int height, ImageFrameMetaData metaData)
        {
            Guard.NotNull(memoryManager, nameof(memoryManager));
            Guard.MustBeGreaterThan(width, 0, nameof(width));
            Guard.MustBeGreaterThan(height, 0, nameof(height));
            Guard.NotNull(metaData, nameof(metaData));

            this.MemoryManager = memoryManager;
            this.PixelBuffer   = memoryManager.AllocateClean2D <TPixel>(width, height);
            this.MetaData      = metaData;
        }