@ikijs/editor 0.10.0 → 0.11.0

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/README.md CHANGED
@@ -133,15 +133,20 @@ radius. It also takes the optional `denseCore`, the tight box of a layer's alpha
133
133
  width are the nose's turn landmark, so a shaded nose is fitted by its drawing
134
134
  rather than its soft feather, and its top edge at its centre x is the bridge top
135
135
  the nose tilts 6° about on the turn, its tip toward the far side; absent, the
136
- crop stands in for both.
136
+ crop stands in for both. And it takes the optional `rowRuns` (per crop row, the
137
+ row's alpha ≥ 128 runs as a flat list of canvas columns `[start, end, …]`, each
138
+ end exclusive), measured for `hair_front` and `hair_back` so the turn and the
139
+ nod can tell where back hair is painted behind the front hair; absent, the front
140
+ hair keeps its outline hold on the turn and its crown's ease to the back hair's
141
+ nod looking down.
137
142
 
138
143
  `createLayerSetMeasurer(canvas)` measures all of it — `rowHalfWidths`,
139
- `denseCore`, `headHalfWidth`, `headEdges` and `strandEdges` — off the RGBA a
140
- host decoded, one layer at a time: `add` each layer while its pixels are in
141
- memory (it keeps no reference to them), then `finish` for the `LayerInput`s and
142
- the `turnOptions` to pass the generator. A caller's own `turnTargets` go
143
- underneath `turnOptions.turnTargets`: spread the caller's targets first, then
144
- the measured ones.
144
+ `rowRuns`, `denseCore`, `headHalfWidth`, `headEdges` and `strandEdges` — off
145
+ the RGBA a host decoded, one layer at a time: `add` each layer while its pixels
146
+ are in memory (it keeps no reference to them), then `finish` for the
147
+ `LayerInput`s and the `turnOptions` to pass the generator. A caller's own
148
+ `turnTargets` go underneath `turnOptions.turnTargets`: spread the caller's
149
+ targets first, then the measured ones.
145
150
 
146
151
  `*_L` / `*_R` are the **character's** sides — `eye_L` is the character's left
147
152
  eye, which appears on the viewer's right.
package/dist/index.d.mts CHANGED
@@ -674,7 +674,11 @@ interface RigStyle {
674
674
  * profile 1.1). */
675
675
  hairFollow?: number;
676
676
  /** Its outer edge's share, where the front hair draws the head's outline
677
- * (profile 0: the outline holds; `hairFollow` rides it whole). */
677
+ * and no back hair paints behind that edge (profile 0: the outline holds;
678
+ * `hairFollow` rides it whole). Where back hair does, the edge rides
679
+ * further, as far as that back hair stays behind it through the turn and
680
+ * the nod, up to the front hair's follow there (`hairFollow`; over the
681
+ * far eye's rows, as far as that eye's outer corner goes). */
678
682
  outlineFollow?: number;
679
683
  /** How far the upper lid comes down, over the eye's height (0.30–0.67). */
680
684
  blink?: number;
@@ -706,6 +710,12 @@ interface LayerInput {
706
710
  cropH: number;
707
711
  /** Face only: half the opaque span of each crop row, canvas px (0 = none). */
708
712
  rowHalfWidths?: number[];
713
+ /** `hair_front` / `hair_back` only: per crop row, its opaque (alpha ≥ 128)
714
+ * runs as a flat list of canvas columns `[start0, end0, start1, end1, …]`,
715
+ * each end exclusive (`[]` for a row with none). The actual pixels, so a
716
+ * gap in the hair is a gap here: the turn and the nod read off it where
717
+ * back hair is painted behind the front hair. */
718
+ rowRuns?: number[][];
709
719
  /** Nose only: the tight box of its alpha ≥ 128 pixels, canvas px. */
710
720
  denseCore?: {
711
721
  x: number;
@@ -987,13 +997,14 @@ interface RgbaLayer {
987
997
  interface LayerSetMeasurer {
988
998
  /**
989
999
  * Measure one layer while its `rgba` is in memory, keeping no reference to
990
- * it: only the set's opaque union, this layer's per-row opaque extent and,
991
- * for `hair_front`, its opaque mask outlive the call, so the host may drop
992
- * `rgba` as soon as it returns. Returns the layer's `LayerInput` — its crop
993
- * box, the face's `rowHalfWidths`, the nose's `denseCore` unless that is a
994
- * speck of its crop (`isSpeckCore`) — or `null` for an empty layer, one with
995
- * no pixel at or above `ALPHA_BBOX_THRESHOLD`, which it records nothing for:
996
- * the host reports that with its own error. Throws, naming the file, when
1000
+ * it: only the set's opaque union, this layer's per-row opaque extent and
1001
+ * the `LayerInput` it returns outlive the call, so the host may drop `rgba`
1002
+ * as soon as it returns. Returns the layer's `LayerInput` — its crop
1003
+ * box, the face's `rowHalfWidths`, the hair layers' `rowRuns`, the nose's
1004
+ * `denseCore` unless that is a speck of its crop (`isSpeckCore`) — or
1005
+ * `null` for an empty layer, one with no pixel at or above
1006
+ * `ALPHA_BBOX_THRESHOLD`, which it records nothing for: the host reports
1007
+ * that with its own error. Throws, naming the file, when
997
1008
  * `rgba` is not `width × height × 4` long; checking the decoded dimensions
998
1009
  * is the host's job.
999
1010
  */
package/dist/index.d.ts CHANGED
@@ -674,7 +674,11 @@ interface RigStyle {
674
674
  * profile 1.1). */
675
675
  hairFollow?: number;
676
676
  /** Its outer edge's share, where the front hair draws the head's outline
677
- * (profile 0: the outline holds; `hairFollow` rides it whole). */
677
+ * and no back hair paints behind that edge (profile 0: the outline holds;
678
+ * `hairFollow` rides it whole). Where back hair does, the edge rides
679
+ * further, as far as that back hair stays behind it through the turn and
680
+ * the nod, up to the front hair's follow there (`hairFollow`; over the
681
+ * far eye's rows, as far as that eye's outer corner goes). */
678
682
  outlineFollow?: number;
679
683
  /** How far the upper lid comes down, over the eye's height (0.30–0.67). */
680
684
  blink?: number;
@@ -706,6 +710,12 @@ interface LayerInput {
706
710
  cropH: number;
707
711
  /** Face only: half the opaque span of each crop row, canvas px (0 = none). */
708
712
  rowHalfWidths?: number[];
713
+ /** `hair_front` / `hair_back` only: per crop row, its opaque (alpha ≥ 128)
714
+ * runs as a flat list of canvas columns `[start0, end0, start1, end1, …]`,
715
+ * each end exclusive (`[]` for a row with none). The actual pixels, so a
716
+ * gap in the hair is a gap here: the turn and the nod read off it where
717
+ * back hair is painted behind the front hair. */
718
+ rowRuns?: number[][];
709
719
  /** Nose only: the tight box of its alpha ≥ 128 pixels, canvas px. */
710
720
  denseCore?: {
711
721
  x: number;
@@ -987,13 +997,14 @@ interface RgbaLayer {
987
997
  interface LayerSetMeasurer {
988
998
  /**
989
999
  * Measure one layer while its `rgba` is in memory, keeping no reference to
990
- * it: only the set's opaque union, this layer's per-row opaque extent and,
991
- * for `hair_front`, its opaque mask outlive the call, so the host may drop
992
- * `rgba` as soon as it returns. Returns the layer's `LayerInput` — its crop
993
- * box, the face's `rowHalfWidths`, the nose's `denseCore` unless that is a
994
- * speck of its crop (`isSpeckCore`) — or `null` for an empty layer, one with
995
- * no pixel at or above `ALPHA_BBOX_THRESHOLD`, which it records nothing for:
996
- * the host reports that with its own error. Throws, naming the file, when
1000
+ * it: only the set's opaque union, this layer's per-row opaque extent and
1001
+ * the `LayerInput` it returns outlive the call, so the host may drop `rgba`
1002
+ * as soon as it returns. Returns the layer's `LayerInput` — its crop
1003
+ * box, the face's `rowHalfWidths`, the hair layers' `rowRuns`, the nose's
1004
+ * `denseCore` unless that is a speck of its crop (`isSpeckCore`) — or
1005
+ * `null` for an empty layer, one with no pixel at or above
1006
+ * `ALPHA_BBOX_THRESHOLD`, which it records nothing for: the host reports
1007
+ * that with its own error. Throws, naming the file, when
997
1008
  * `rgba` is not `width × height × 4` long; checking the decoded dimensions
998
1009
  * is the host's job.
999
1010
  */