using System.Collections.Generic; using System.IO.Compression; using System.Linq; namespace Quik { /// /// QUIK draw command provider. /// public class QuikDraw { /// /// The draw command queue. /// public Queue Commands { get; } = new Queue(); public void Clear() => Commands.Clear(); public void Mask(QuikRectangle bounds) => Commands.Enqueue(new QuikCommandMask(bounds)); public void Line(QuikLine line) => Commands.Enqueue(new QuikCommandLine(line)); public void Line(params QuikLine[] lines) => Commands.Enqueue(new QuikCommandLines(lines)); public void Line(IEnumerable lines) => Commands.Enqueue(new QuikCommandLines(lines.ToArray())); public void Bezier(params QuikBezier[] curve) => Commands.Enqueue(new QuikCommandBezier(curve)); public void Bezier(IEnumerable curve) => Commands.Enqueue(new QuikCommandBezier(curve.ToArray())); public void Rectangle(QuikRectangle rectangle) => Commands.Enqueue(new QuikCommandRectangle(rectangle)); public void Rectangle(params QuikRectangle[] rectangles) => Commands.Enqueue(new QuikCommandRectangles(rectangles)); public void Rectangle(IEnumerable rectangles) => Commands.Enqueue(new QuikCommandRectangles(rectangles.ToArray())); public void Triangle(QuikTriangle triangle) => Commands.Enqueue(new QuikCommandTriangle(triangle)); public void Triangle(params QuikTriangle[] triangles) => Commands.Enqueue(new QuikCommandTriangles(triangles)); public void Triangle(IEnumerable triangles) => Commands.Enqueue(new QuikCommandTriangles(triangles.ToArray())); public void Polygon(params QuikVec2[] polygon) => Commands.Enqueue(new QuikCommandPolygon(polygon)); public void Polygon(IEnumerable polygon) => Commands.Enqueue(new QuikCommandPolygon(polygon.ToArray())); public void StencilClear() => Commands.Enqueue(new QuikCommandStencilClear()); public void StencilBegin() => Commands.Enqueue(new QuikCommandStencilBegin()); public void StencilEnd() => Commands.Enqueue(new QuikCommandStencilEnd()); public void PutChar(char chr, QuikVec2 position) => Commands.Enqueue(new QuikCommandPutChar(chr, position)); public void PutText(string text, QuikVec2 position) => Commands.Enqueue(new QuikCommandPutText(text, position)); public void FlowText(string text, QuikRectangle bounds) => Commands.Enqueue(new QuikCommandFlowText(text, bounds)); } }