@thi.ng/blurhash 0.1.3 → 0.1.5

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-01-30T15:21:30Z
3
+ - **Last updated**: 2024-02-06T23:18:11Z
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.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [0.1.5](https://github.com/thi-ng/umbrella/tree/@thi.ng/blurhash@0.1.5) (2024-02-06)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update base83 handling ([f7fd4c9](https://github.com/thi-ng/umbrella/commit/f7fd4c9))
17
+
12
18
  ## [0.1.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/blurhash@0.1.0) (2024-01-26)
13
19
 
14
20
  #### 🚀 Features
package/README.md CHANGED
@@ -73,7 +73,7 @@ For Node.js REPL:
73
73
  const blurhash = await import("@thi.ng/blurhash");
74
74
  ```
75
75
 
76
- Package sizes (brotli'd, pre-treeshake): ESM: 1.17 KB
76
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.21 KB
77
77
 
78
78
  ## Dependencies
79
79
 
package/decode.js CHANGED
@@ -1,9 +1,11 @@
1
- import { BASE83 } from "@thi.ng/base-n/83";
1
+ import { B83_CHARS } from "@thi.ng/base-n/chars/83";
2
+ import { BaseNDecoder } from "@thi.ng/base-n/decode";
2
3
  import { canvas2d } from "@thi.ng/canvas";
3
4
  import { signedPow } from "@thi.ng/math/abs";
4
5
  import { __ensureSize } from "./internal/ensure";
5
6
  import { __fromLinear, __toLinear } from "./internal/linear";
6
7
  const { PI, cos, floor } = Math;
8
+ const BASE83 = new BaseNDecoder(B83_CHARS);
7
9
  const decode = (hash, width, height, contrast = 1, pixels) => {
8
10
  const sizeFlag = BASE83.decode(hash[0]);
9
11
  const detailX = sizeFlag % 9 + 1;
package/encode.js CHANGED
@@ -1,10 +1,12 @@
1
- import { BASE83 } from "@thi.ng/base-n/83";
1
+ import { B83_CHARS } from "@thi.ng/base-n/chars/83";
2
+ import { BaseNEncoder } from "@thi.ng/base-n/encode";
2
3
  import { imageCanvas } from "@thi.ng/canvas";
3
4
  import { signedPow } from "@thi.ng/math/abs";
4
5
  import { clamp } from "@thi.ng/math/interval";
5
6
  import { __ensureDetail, __ensureSize } from "./internal/ensure";
6
7
  import { __fromLinear, __toLinear } from "./internal/linear";
7
8
  const { PI, cos, floor } = Math;
9
+ const BASE83 = new BaseNEncoder(B83_CHARS);
8
10
  const encode = (pixels, width, height, detailX = 4, detailY = detailX) => {
9
11
  __ensureDetail(detailX, detailY);
10
12
  __ensureSize(pixels, width, height);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/blurhash",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Fast, optimized TS implementation of the Wolt Blurhash algorithm",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -35,11 +35,11 @@
35
35
  "test": "bun test"
36
36
  },
37
37
  "dependencies": {
38
- "@thi.ng/api": "^8.9.21",
39
- "@thi.ng/base-n": "^2.6.3",
40
- "@thi.ng/canvas": "^0.2.3",
41
- "@thi.ng/errors": "^2.4.14",
42
- "@thi.ng/math": "^5.8.3"
38
+ "@thi.ng/api": "^8.9.22",
39
+ "@thi.ng/base-n": "^2.7.0",
40
+ "@thi.ng/canvas": "^0.2.4",
41
+ "@thi.ng/errors": "^2.4.15",
42
+ "@thi.ng/math": "^5.9.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@microsoft/api-extractor": "^7.39.0",
@@ -91,5 +91,5 @@
91
91
  "status": "alpha",
92
92
  "year": 2023
93
93
  },
94
- "gitHead": "ded7c5e87ebc7f6279c24f183c24ff348db8f304\n"
94
+ "gitHead": "ce8202c237a367c4038d41919a8acf75e1122507\n"
95
95
  }