-
-
Notifications
You must be signed in to change notification settings - Fork 419
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added interfaces to the Path classes.
- Loading branch information
Showing
32 changed files
with
383 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,11 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Marker interface for paths. | ||
/// </summary> | ||
[SuppressMessage("Design", "CA1040:Avoid empty interfaces", Justification = "This is a marker interface.")] | ||
public interface IPath | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Draws an elliptical arc from the current point to (X, Y) using absolute coordinates. The size | ||
/// and orientation of the ellipse are defined by two radii(RadiusX, RadiusY) and an RotationX, | ||
/// which indicates how the ellipse as a whole is rotated relative to the current coordinate | ||
/// system. The center of the ellipse is calculated automagically to satisfy the constraints | ||
/// imposed by the other parameters. UseLargeArc and UseSweep contribute to the automatic | ||
/// calculations and help determine how the arc is drawn. If UseLargeArc is true then draw the | ||
/// larger of the available arcs. If UseSweep is true, then draw the arc matching a clock-wise | ||
/// rotation. | ||
/// </summary> | ||
public interface IPathArc : IPath | ||
{ | ||
/// <summary> | ||
/// Gets the coordinates. | ||
/// </summary> | ||
IReadOnlyList<PathArc> Coordinates { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Adds a path element to the current path which closes the current subpath by drawing a straight | ||
/// line from the current point to the current subpath's most recent starting point (usually, the | ||
/// most recent moveto point). | ||
/// </summary> | ||
public interface IPathClose : IPath | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Draws a cubic Bezier curve from the current point to (x, y) using (x1, y1) as the control point | ||
/// at the beginning of the curve and (x2, y2) as the control point at the end of the curve using | ||
/// absolute coordinates. At the end of the command, the new current point becomes the final (x, y) | ||
/// coordinate pair used in the polybezier. | ||
/// </summary> | ||
public interface IPathCurveTo : IPath | ||
{ | ||
/// <summary> | ||
/// Gets the coordinate of control point for curve beginning. | ||
/// </summary> | ||
PointD ControlPointStart { get; } | ||
|
||
/// <summary> | ||
/// Gets the coordinate of control point for curve ending. | ||
/// </summary> | ||
PointD ControlPointEnd { get; } | ||
|
||
/// <summary> | ||
/// Gets the coordinate of the end of the curve. | ||
/// </summary> | ||
PointD End { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
using System.Collections.Generic; | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Draws a line path from the current point to the given coordinate using absolute coordinates. | ||
/// The coordinate then becomes the new current point. | ||
/// </summary> | ||
public interface IPathLineTo : IPath | ||
{ | ||
/// <summary> | ||
/// Gets the coordinates. | ||
/// </summary> | ||
IReadOnlyList<PointD> Coordinates { get; } | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Magick.NET.Core/Drawables/Paths/IPathLineToHorizontal.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Draws a horizontal line path from the current point to the target point using absolute | ||
/// coordinates. The target point then becomes the new current point. | ||
/// </summary> | ||
public interface IPathLineToHorizontal : IPath | ||
{ | ||
/// <summary> | ||
/// Gets the X coordinate. | ||
/// </summary> | ||
double X { get; } | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Magick.NET.Core/Drawables/Paths/IPathLineToVertical.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Draws a vertical line path from the current point to the target point using absolute | ||
/// coordinates. The target point then becomes the new current point. | ||
/// </summary> | ||
public interface IPathLineToVertical : IPath | ||
{ | ||
/// <summary> | ||
/// Gets the Y coordinate. | ||
/// </summary> | ||
double Y { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Starts a new sub-path at the given coordinate using absolute coordinates. The current point | ||
/// then becomes the specified coordinate. | ||
/// </summary> | ||
public interface IPathMoveTo : IPath | ||
{ | ||
/// <summary> | ||
/// Gets the coordinate. | ||
/// </summary> | ||
PointD Coordinate { get; } | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Magick.NET.Core/Drawables/Paths/IPathQuadraticCurveTo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Draws a quadratic Bezier curve from the current point to (x, y) using (x1, y1) as the control | ||
/// point using absolute coordinates. At the end of the command, the new current point becomes | ||
/// the final (x, y) coordinate pair used in the polybezier. | ||
/// </summary> | ||
public interface IPathQuadraticCurveTo : IPath | ||
{ | ||
/// <summary> | ||
/// Gets the coordinate of control point. | ||
/// </summary> | ||
PointD ControlPoint { get; } | ||
|
||
/// <summary> | ||
/// Gets the coordinate of final point. | ||
/// </summary> | ||
PointD End { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Draws a cubic Bezier curve from the current point to (x,y) using absolute coordinates. The | ||
/// first control point is assumed to be the reflection of the second control point on the | ||
/// previous command relative to the current point. (If there is no previous command or if the | ||
/// previous command was not an PathCurveToAbs, PathCurveToRel, PathSmoothCurveToAbs or | ||
/// PathSmoothCurveToRel, assume the first control point is coincident with the current point.) | ||
/// (x2,y2) is the second control point (i.e., the control point at the end of the curve). At | ||
/// the end of the command, the new current point becomes the final (x,y) coordinate pair used | ||
/// in the polybezier. | ||
/// </summary> | ||
public interface IPathSmoothCurveTo : IPath | ||
{ | ||
/// <summary> | ||
/// Gets the coordinate of second point. | ||
/// </summary> | ||
PointD ControlPoint { get; } | ||
|
||
/// <summary> | ||
/// Gets the coordinate of final point. | ||
/// </summary> | ||
PointD End { get; } | ||
} |
21 changes: 21 additions & 0 deletions
21
src/Magick.NET.Core/Drawables/Paths/IPathSmoothQuadraticCurveTo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright Dirk Lemstra https://github.com/dlemstra/Magick.NET. | ||
// Licensed under the Apache License, Version 2.0. | ||
|
||
namespace ImageMagick; | ||
|
||
/// <summary> | ||
/// Draws a quadratic Bezier curve (using absolute coordinates) from the current point to (X, Y). | ||
/// The control point is assumed to be the reflection of the control point on the previous | ||
/// command relative to the current point. (If there is no previous command or if the previous | ||
/// command was not a PathQuadraticCurveToAbs, PathQuadraticCurveToRel, | ||
/// PathSmoothQuadraticCurveToAbs or PathSmoothQuadraticCurveToRel, assume the control point is | ||
/// coincident with the current point.). At the end of the command, the new current point becomes | ||
/// the final (X,Y) coordinate pair used in the polybezier. | ||
/// </summary> | ||
public interface IPathSmoothQuadraticCurveTo : IPath | ||
{ | ||
/// <summary> | ||
/// Gets the coordinate of final point. | ||
/// </summary> | ||
PointD End { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.