@thi.ng/rasterize v1.0.101
This project is part of the @thi.ng/umbrella monorepo.
About
2D shape drawing & rasterization.
The functions in this package can be used with any
IGrid2D
compatible
grid/image type (e.g. those provided by
@thi.ng/pixel
or
@thi.ng/text-canvas).
Currently the following functions are available:
Circle
Filled or outline implementation of Bresenham's circle algorithm. A clipping check is pre-applied to see if the circle lies entirely outside the target grid.
Line
Implementation of Bresenham's line
algorithm with
pre-applied Liang-Barsky
clipping. The
higher-order function
drawLineWith()
can be used to apply custom brushes to trace the line.
Rect
Filled or outline implementation with pre-applied clipping against the target grid.
Flood fill
Fills grid in the connected region around x,y
with given value or pattern. See
floodFill()
in the @thi.ng/grid-iterators
package for
further details.
Status
ALPHA - bleeding edge / work-in-progress
Search or submit any issues for this package
Related packages
- @thi.ng/grid-iterators - 2D grid and shape iterators w/ multiple orderings
- @thi.ng/pixel - Typedarray integer & float pixel buffers w/ customizable formats, blitting, drawing, convolution
- @thi.ng/text-canvas - Text based canvas, drawing, tables with arbitrary formatting (incl. ANSI/HTML)
Installation
yarn add @thi.ng/rasterize
ES module import:
<script type="module" src="https://cdn.skypack.dev/@thi.ng/rasterize"></script>
For Node.js REPL:
# with flag only for < v16
node --experimental-repl-await
> const rasterize = await import("@thi.ng/rasterize");
Package sizes (gzipped, pre-treeshake): ESM: 669 bytes
Dependencies
API
TODO
Authors
Karsten Schmidt
If this project contributes to an academic publication, please cite it as:
@misc{thing-rasterize,
title = "@thi.ng/rasterize",
author = "Karsten Schmidt",
note = "https://thi.ng/rasterize",
year = 2021
}
License
© 2021 Karsten Schmidt // Apache Software License 2.0
7 days ago
9 days ago
12 days ago
21 days ago
24 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
6 months ago
10 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
8 months ago
8 months ago
8 months ago
7 months ago
7 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago