@thi.ng/rasterize 0.3.5 → 0.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -1
- package/README.md +1 -1
- package/flood-fill.d.ts +4 -4
- package/flood-fill.js +4 -4
- package/package.json +22 -22
- package/poly.d.ts +3 -3
- package/poly.js +3 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/flood-fill.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import type { Shader2D } from "./api.js";
|
|
|
5
5
|
* function. If the latter, the shader is called for each grid coordinate and
|
|
6
6
|
* returns a fill value. Returns updated grid.
|
|
7
7
|
*
|
|
8
|
-
* @param grid
|
|
9
|
-
* @param x
|
|
10
|
-
* @param y
|
|
11
|
-
* @param val
|
|
8
|
+
* @param grid -
|
|
9
|
+
* @param x -
|
|
10
|
+
* @param y -
|
|
11
|
+
* @param val -
|
|
12
12
|
*/
|
|
13
13
|
export declare const floodFill: <T extends any[] | TypedArray, P>(grid: IGrid2D<T, P>, x: number, y: number, val: P | Shader2D<P>) => IGrid2D<T, P>;
|
|
14
14
|
//# sourceMappingURL=flood-fill.d.ts.map
|
package/flood-fill.js
CHANGED
|
@@ -9,10 +9,10 @@ import { __draw2D } from "./draw.js";
|
|
|
9
9
|
* function. If the latter, the shader is called for each grid coordinate and
|
|
10
10
|
* returns a fill value. Returns updated grid.
|
|
11
11
|
*
|
|
12
|
-
* @param grid
|
|
13
|
-
* @param x
|
|
14
|
-
* @param y
|
|
15
|
-
* @param val
|
|
12
|
+
* @param grid -
|
|
13
|
+
* @param x -
|
|
14
|
+
* @param y -
|
|
15
|
+
* @param val -
|
|
16
16
|
*/
|
|
17
17
|
export const floodFill = (grid, x, y, val) => isInBounds2D(grid, x, y)
|
|
18
18
|
? __draw2D($fill(__pred(grid, x, y), x, y, grid.size[0], grid.size[1]), grid, val)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rasterize",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "2D shape drawing & rasterization",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -34,20 +34,20 @@
|
|
|
34
34
|
"test": "testament test"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.3.
|
|
38
|
-
"@thi.ng/checks": "^3.1.
|
|
39
|
-
"@thi.ng/equiv": "^2.1.
|
|
40
|
-
"@thi.ng/grid-iterators": "^2.
|
|
41
|
-
"@thi.ng/random": "^3.2.
|
|
42
|
-
"@thi.ng/transducers": "^8.2
|
|
37
|
+
"@thi.ng/api": "^8.3.6",
|
|
38
|
+
"@thi.ng/checks": "^3.1.6",
|
|
39
|
+
"@thi.ng/equiv": "^2.1.6",
|
|
40
|
+
"@thi.ng/grid-iterators": "^2.3.1",
|
|
41
|
+
"@thi.ng/random": "^3.2.6",
|
|
42
|
+
"@thi.ng/transducers": "^8.3.2"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@microsoft/api-extractor": "^7.
|
|
46
|
-
"@thi.ng/testament": "^0.2.
|
|
45
|
+
"@microsoft/api-extractor": "^7.23.1",
|
|
46
|
+
"@thi.ng/testament": "^0.2.6",
|
|
47
47
|
"rimraf": "^3.0.2",
|
|
48
48
|
"tools": "^0.0.1",
|
|
49
|
-
"typedoc": "^0.22.
|
|
50
|
-
"typescript": "^4.
|
|
49
|
+
"typedoc": "^0.22.15",
|
|
50
|
+
"typescript": "^4.6.4"
|
|
51
51
|
},
|
|
52
52
|
"keywords": [
|
|
53
53
|
"2d",
|
|
@@ -79,34 +79,34 @@
|
|
|
79
79
|
],
|
|
80
80
|
"exports": {
|
|
81
81
|
".": {
|
|
82
|
-
"
|
|
82
|
+
"default": "./index.js"
|
|
83
83
|
},
|
|
84
84
|
"./api": {
|
|
85
|
-
"
|
|
85
|
+
"default": "./api.js"
|
|
86
86
|
},
|
|
87
87
|
"./checks": {
|
|
88
|
-
"
|
|
88
|
+
"default": "./checks.js"
|
|
89
89
|
},
|
|
90
90
|
"./circle": {
|
|
91
|
-
"
|
|
91
|
+
"default": "./circle.js"
|
|
92
92
|
},
|
|
93
93
|
"./flood-fill": {
|
|
94
|
-
"
|
|
94
|
+
"default": "./flood-fill.js"
|
|
95
95
|
},
|
|
96
96
|
"./line": {
|
|
97
|
-
"
|
|
97
|
+
"default": "./line.js"
|
|
98
98
|
},
|
|
99
99
|
"./poly": {
|
|
100
|
-
"
|
|
100
|
+
"default": "./poly.js"
|
|
101
101
|
},
|
|
102
102
|
"./polyline": {
|
|
103
|
-
"
|
|
103
|
+
"default": "./polyline.js"
|
|
104
104
|
},
|
|
105
105
|
"./rect": {
|
|
106
|
-
"
|
|
106
|
+
"default": "./rect.js"
|
|
107
107
|
},
|
|
108
108
|
"./shader": {
|
|
109
|
-
"
|
|
109
|
+
"default": "./shader.js"
|
|
110
110
|
}
|
|
111
111
|
},
|
|
112
112
|
"thi.ng": {
|
|
@@ -118,5 +118,5 @@
|
|
|
118
118
|
"status": "alpha",
|
|
119
119
|
"year": 2021
|
|
120
120
|
},
|
|
121
|
-
"gitHead": "
|
|
121
|
+
"gitHead": "cf084be5fd5932226054d2dd32bad35481379f5d\n"
|
|
122
122
|
}
|
package/poly.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ import type { Shader2D } from "./api.js";
|
|
|
10
10
|
*
|
|
11
11
|
* Bounds calculation and clipping added by Karsten Schmidt
|
|
12
12
|
*
|
|
13
|
-
* @param grid
|
|
14
|
-
* @param pts
|
|
15
|
-
* @param val
|
|
13
|
+
* @param grid -
|
|
14
|
+
* @param pts -
|
|
15
|
+
* @param val -
|
|
16
16
|
*/
|
|
17
17
|
export declare const fillPoly: <T extends any[] | TypedArray, P>(grid: IGrid2D<T, P>, pts: number[][], val: P | Shader2D<P>) => void;
|
|
18
18
|
//# sourceMappingURL=poly.d.ts.map
|
package/poly.js
CHANGED
|
@@ -9,9 +9,9 @@ import { ensureShader2D } from "./checks.js";
|
|
|
9
9
|
*
|
|
10
10
|
* Bounds calculation and clipping added by Karsten Schmidt
|
|
11
11
|
*
|
|
12
|
-
* @param grid
|
|
13
|
-
* @param pts
|
|
14
|
-
* @param val
|
|
12
|
+
* @param grid -
|
|
13
|
+
* @param pts -
|
|
14
|
+
* @param val -
|
|
15
15
|
*/
|
|
16
16
|
export const fillPoly = (grid, pts, val) => {
|
|
17
17
|
const numP = pts.length;
|