Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Buffer{T}"/> class.
        /// </summary>
        /// <param name="length">The desired count of elements. (Minimum size for <see cref="Array"/>)</param>
        public Buffer(int length)
        {
            this.Length = length;
            this.Array  = PixelDataPool <T> .Rent(length);

            this.isPoolingOwner = true;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PinnedBuffer{T}"/> class.
        /// </summary>
        /// <param name="count">The desired count of elements. (Minimum size for <see cref="Array"/>)</param>
        public PinnedBuffer(int count)
        {
            this.Count = count;
            this.Array = PixelDataPool <T> .Rent(count);

            this.isPoolingOwner = true;
            this.Pin();
        }
Beispiel #3
0
 /// <summary>
 /// Rents the pixel array from the pool.
 /// </summary>
 private void RentPixels()
 {
     this.PixelBuffer = PixelDataPool <TPixel> .Rent(this.Width *this.Height);
 }