@thi.ng/shader-ast-stdlib 0.18.0 → 0.18.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-03-07T20:40:47Z
3
+ - **Last updated**: 2024-03-09T09:18:17Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
package/README.md CHANGED
@@ -136,6 +136,7 @@ directory are using this package:
136
136
  | | Minimal multi-pass / GPGPU example | [Demo](https://demo.thi.ng/umbrella/webgl-multipass/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-multipass) |
137
137
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-shadertoy.jpg" width="240"/> | Shadertoy-like WebGL setup | [Demo](https://demo.thi.ng/umbrella/webgl-shadertoy/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-shadertoy) |
138
138
  | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-ssao.jpg" width="240"/> | WebGL screenspace ambient occlusion | [Demo](https://demo.thi.ng/umbrella/webgl-ssao/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-ssao) |
139
+ | <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/webgl-texture-paint.jpg" width="240"/> | TODO | [Demo](https://demo.thi.ng/umbrella/webgl-texture-paint/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/webgl-texture-paint) |
139
140
 
140
141
  ## API
141
142
 
@@ -11,6 +11,17 @@ import type { FloatTerm, Vec4Sym } from "@thi.ng/shader-ast";
11
11
  * functions are used to extract blending coefficients for src/dest colors and
12
12
  * are called with the alpha components of both colors.
13
13
  *
14
+ * - `blendSrcOver(src, dest)`
15
+ * - `blendDestOver(src, dest)`
16
+ * - `blendSrcIn(src, dest)`
17
+ * - `blendDestIn(src, dest)`
18
+ * - `blendSrcOut(src, dest)`
19
+ * - `blendDestOut(src, dest)`
20
+ * - `blendSrcAtop(src, dest)`
21
+ * - `blendDestAtop(src, dest)`
22
+ * - `blendXor(src, dest)`
23
+ * - `blendPlus(src, dest)`
24
+ *
14
25
  * Optimization only happens for cases where either `fa` and/or `fb` are
15
26
  * {@link ZERO} or {@link ONE}.
16
27
  *
@@ -23,7 +34,19 @@ import type { FloatTerm, Vec4Sym } from "@thi.ng/shader-ast";
23
34
  * @param fb - dest coeff fn
24
35
  */
25
36
  export declare const porterDuff: (name: string, fa: Fn2<FloatTerm, FloatTerm, FloatTerm>, fb: Fn2<FloatTerm, FloatTerm, FloatTerm>) => import("@thi.ng/shader-ast").TaggedFn2<"vec4", "vec4", "vec4">;
37
+ /**
38
+ * Multiplies RGB channels by alpha. Returns `vec4(col.r*col.a, col.g*col.a,
39
+ * col.b*col.a, col.a)`. See {@link postmultiplyAlpha} for reverse op.
40
+ *
41
+ * @param col
42
+ */
26
43
  export declare const premultiplyAlpha: (col: Vec4Sym) => import("@thi.ng/shader-ast").Lit<"vec4">;
44
+ /**
45
+ * Divides RGB channels by alpha. Returns `vec4(col.r/col.a, col.g/col.a,
46
+ * col.b/col.a, col.a)`. See {@link premultiplyAlpha} for reverse op.
47
+ *
48
+ * @param col
49
+ */
27
50
  export declare const postmultiplyAlpha: (col: Vec4Sym) => import("@thi.ng/shader-ast").Lit<"vec4">;
28
51
  export declare const ZERO: () => import("@thi.ng/shader-ast").Lit<"float">;
29
52
  export declare const ONE: () => import("@thi.ng/shader-ast").Lit<"float">;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/shader-ast-stdlib",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "Function collection for modular GPGPU / shader programming with @thi.ng/shader-ast",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -39,8 +39,8 @@
39
39
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
40
40
  },
41
41
  "dependencies": {
42
- "@thi.ng/api": "^8.9.28",
43
- "@thi.ng/shader-ast": "^0.15.0"
42
+ "@thi.ng/api": "^8.9.29",
43
+ "@thi.ng/shader-ast": "^0.15.1"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@microsoft/api-extractor": "^7.40.1",
@@ -371,5 +371,5 @@
371
371
  ],
372
372
  "year": 2019
373
373
  },
374
- "gitHead": "a421058a65ba76608d94129ac29451bfedaf201c\n"
374
+ "gitHead": "69100942474942f7446ac645d59d91e7dfc352f9\n"
375
375
  }