예제 #1
0
        /// <summary>
        /// Rasterize along a line.
        /// </summary>
        /// <param name="p0">Starting point.</param>
        /// <param name="p1">Ending point.</param>
        /// <param name="pattern">Sequence of bits to mask drawing the line.</param>
        public static IEnumerable <IntVector> Line(IntVector p0, IntVector p1, ushort pattern)
        {
            var _pattern = (uint)(pattern | (pattern << 16));

            return(Line(p0, p1, _pattern));
        }
예제 #2
0
 /// <summary>
 /// Rasterize a rectangular region.
 /// </summary>
 public static IEnumerable <IntVector> Rectangle(IntVector position, IntSize size)
 {
     return(Rectangle(position.X, position.Y, size.Width, size.Height));
 }
예제 #3
0
        /// <summary>
        /// Rasterize along a line.
        /// </summary>
        /// <param name="p0">Starting point.</param>
        /// <param name="p1">Ending point.</param>
        /// <param name="pattern">Sequence of bits to mask drawing the line.</param>
        public static IEnumerable <IntVector> Line(IntVector p0, IntVector p1, byte pattern)
        {
            var _pattern = (uint)(pattern | (pattern << 8) | (pattern << 16) | (pattern << 24));

            return(Line(p0, p1, _pattern));
        }
예제 #4
0
        // todo: Curves

        #region Line

        /// <summary>
        /// Rasterize along a line.
        /// </summary>
        /// <param name="p0">Starting point.</param>
        /// <param name="p1">Ending point.</param>
        public static IEnumerable <IntVector> Line(IntVector p0, IntVector p1)
        {
            return(Line(p0, p1, uint.MaxValue));
        }
예제 #5
0
 /// <summary>
 /// Gets or sets the color a pixel in this image.
 /// </summary>
 public ColorBytes this[IntVector co]
 {
     get => GetPixel(co);
예제 #6
0
 /// <summary>
 /// Constructs a new instance of <see cref="IntRectangle"/>.
 /// </summary>
 /// <param name="position">The position of the rectangle.</param>
 /// <param name="size">The size of the rectangle.</param>
 public IntRectangle(IntVector position, IntSize size)
     : this(position.X, position.Y, size.Width, size.Height)
 {
 }
예제 #7
0
 /// <summary>
 /// Constructs a new instance of <see cref="IntRectangle"/> using minimum and maximum points.
 /// </summary>
 /// <param name="min">The minimum point.</param>
 /// <param name="max">The maximum point.</param>
 public IntRectangle(IntVector min, IntVector max)
     : this(min, (IntSize)(max - min))
 {
 }