-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vaev-paint: Initial implementation for printing.
- Loading branch information
1 parent
649712e
commit 5a71566
Showing
53 changed files
with
622 additions
and
467 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 |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
"requires": [ | ||
"efi", | ||
"abi", | ||
"karm-net.json" | ||
"karm-json" | ||
], | ||
"provides": [ | ||
"karm-logger-impl", | ||
|
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
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 |
---|---|---|
|
@@ -12,6 +12,6 @@ | |
"hideo-base", | ||
"karm-sys", | ||
"opstart-impl", | ||
"karm-net.json" | ||
"karm-json" | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#pragma once | ||
|
||
#include <karm-meta/nocopy.h> | ||
|
||
#include "paint.h" | ||
#include "path.h" | ||
#include "stroke.h" | ||
#include "types.h" | ||
|
||
namespace Karm::Gfx { | ||
|
||
struct Canvas : public Meta::NoCopy { | ||
// NOTE: Canvas is marked as NoCopy because it doesn't make sense to copy | ||
// a context. And it's also a good way to prevent accidental copies. | ||
|
||
Canvas() = default; | ||
Canvas(Canvas &&) = default; | ||
Canvas &operator=(Canvas &&) = default; | ||
|
||
virtual ~Canvas() = default; | ||
|
||
// Begin a new path. | ||
virtual void begin() = 0; | ||
|
||
// Close the current path. This will connect the last point to the first | ||
virtual void close() = 0; | ||
|
||
// Begin a new subpath at the given point. | ||
virtual void moveTo(Math::Vec2f p, Path::Flags flags = Path::DEFAULT) = 0; | ||
|
||
// Add a line segment to the current path. | ||
virtual void lineTo(Math::Vec2f p, Path::Flags flags = Path::DEFAULT) = 0; | ||
|
||
// Add a horizontal line segment to the current path. | ||
virtual void hlineTo(f64 x, Path::Flags flags = Path::DEFAULT) = 0; | ||
|
||
// Add a vertical line segment to the current path. | ||
virtual void vlineTo(f64 y, Path::Flags flags = Path::DEFAULT) = 0; | ||
|
||
// Add a cubic Bezier curve to the current path. | ||
virtual void cubicTo(Math::Vec2f cp1, Math::Vec2f cp2, Math::Vec2f p, Path::Flags flags = Path::DEFAULT) = 0; | ||
|
||
// Add a quadratic Bezier curve to the current path. | ||
virtual void quadTo(Math::Vec2f cp, Math::Vec2f p, Path::Flags flags = Path::DEFAULT) = 0; | ||
|
||
// Add an elliptical arc to the current path. | ||
virtual void arcTo(Math::Vec2f radius, f64 angle, Math::Vec2f p, Path::Flags flags = Path::DEFAULT) = 0; | ||
|
||
// Add a line segment to the current path. | ||
virtual void line(Math::Edgef line) = 0; | ||
|
||
// Add a curve to the current path. | ||
virtual void curve(Math::Curvef curve) = 0; | ||
|
||
// Add a rectangle to the current path. | ||
virtual void rect(Math::Rectf rect, Math::Radiusf radius = 0) = 0; | ||
|
||
// Add an ellipse to the current path. | ||
virtual void ellipse(Math::Ellipsef ellipse) = 0; | ||
|
||
// Fill the current path with the given paint. | ||
virtual void fill(Paint paint, FillRule rule = FillRule::NONZERO) = 0; | ||
|
||
// Stroke the current path with the given style. | ||
virtual void stroke(Stroke style) = 0; | ||
}; | ||
|
||
} // namespace Karm::Gfx |
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.