// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System;
namespace SixLabors.PolygonClipper {
///
/// Provides configuration options for geometric stroke generation.
///
public sealed class StrokeOptions : IEquatable
{
///
/// Gets or sets a value indicating whether stroked contours should be normalized by
/// resolving self-intersections and overlaps before returning.
///
///
/// Defaults to for maximum throughput.
/// When disabled, callers should rasterize with a non-zero winding fill rule.
///
public bool NormalizeOutput { get; set; }
///
/// Gets or sets the miter limit used to clamp outer miter joins.
///
public double MiterLimit { get; set; } = 4D;
///
/// Gets or sets the tessellation detail scale for round joins and round caps.
/// Higher values produce more vertices (smoother curves, more work).
/// Lower values produce fewer vertices.
///
public double ArcDetailScale { get; set; } = 1D;
///
/// Gets or sets the outer line join style used for stroking corners.
///
public LineJoin LineJoin { get; set; } = LineJoin.Bevel;
///
/// Gets or sets the line cap style used for open path ends.
///
public LineCap LineCap { get; set; } = LineCap.Butt;
///
public override bool Equals(object? obj) => this.Equals(obj as StrokeOptions);
///
public bool Equals(StrokeOptions? other)
=> other is not null &&
this.NormalizeOutput == other.NormalizeOutput &&
this.MiterLimit == other.MiterLimit &&
this.ArcDetailScale == other.ArcDetailScale &&
this.LineJoin == other.LineJoin &&
this.LineCap == other.LineCap;
///
public override int GetHashCode()
=> HashCode.Combine(
this.NormalizeOutput,
this.MiterLimit,
this.ArcDetailScale,
this.LineJoin,
this.LineCap);
}
}