/// <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)); }
/// <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)); }
/// <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)); }
// 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)); }
/// <summary> /// Gets or sets the color a pixel in this image. /// </summary> public ColorBytes this[IntVector co] { get => GetPixel(co);
/// <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) { }
/// <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)) { }