@pixerate/editor 0.198.0 → 0.199.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.
@@ -674,7 +674,7 @@ export declare class ImageEditorController {
674
674
  * or those drawn while a result was rendering, once it is in. A cache refresh: no undo step.
675
675
  */
676
676
  private refreshEffectSurfaces;
677
- /** The registered segmentation provider, or `null` (then `selectSubject` is unavailable). */
677
+ /** The registered segmentation provider, or `null` (then `selectSubject` finds the most salient subject without a model). */
678
678
  get segmentationProvider(): SegmentationProvider | null;
679
679
  /** Registers (or with `null` removes) the segmentation provider. Not an edit: no undo step. */
680
680
  setSegmentationProvider(provider: SegmentationProvider | null): void;
@@ -1613,19 +1613,25 @@ export declare class ImageEditorController {
1613
1613
  * Select › Subject: asks the segmentation provider for the objects matching `target` ("the
1614
1614
  * dog", "the sky") in the flattened image and selects their shapes, combined with the
1615
1615
  * selection by `mode`, as one undo step. Returns what was found (labels and bounds in natural
1616
- * pixels); an empty list leaves the selection as it was. Throws without a provider.
1616
+ * pixels); an empty list leaves the selection as it was. Without a provider, the subject that
1617
+ * stands out most is found classically (superpixels, saliency, Otsu, GrabCut): `target` can't
1618
+ * choose it, and `method: 'saliency'` and a `note` say so.
1617
1619
  */
1618
- selectSubject(target: string, options?: SelectionCommandOptions & {
1620
+ selectSubject(target?: string, options?: SelectionCommandOptions & {
1619
1621
  maxSegments?: number;
1620
1622
  signal?: AbortSignal;
1621
1623
  /** Called with the outlines found (image pixels; a mask-only result's bounds) before the selection changes, e.g. to trace them with an agent's cursor. */
1622
1624
  beforeApply?: (outlines: ImagePoint[][]) => void | Promise<void>;
1625
+ /** Without a model: smoother, less blocky edges (Auto-Enhance). */
1626
+ enhanceEdge?: boolean;
1623
1627
  }): Promise<{
1624
1628
  segments: {
1625
1629
  label: string;
1626
1630
  bounds: CropBox | null;
1627
1631
  score?: number;
1628
1632
  }[];
1633
+ method: 'model' | 'saliency';
1634
+ note?: string;
1629
1635
  }>;
1630
1636
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
1631
1637
  setQuickMask(on: boolean): void;
@@ -674,7 +674,7 @@ export declare class ImageEditorController {
674
674
  * or those drawn while a result was rendering, once it is in. A cache refresh: no undo step.
675
675
  */
676
676
  private refreshEffectSurfaces;
677
- /** The registered segmentation provider, or `null` (then `selectSubject` is unavailable). */
677
+ /** The registered segmentation provider, or `null` (then `selectSubject` finds the most salient subject without a model). */
678
678
  get segmentationProvider(): SegmentationProvider | null;
679
679
  /** Registers (or with `null` removes) the segmentation provider. Not an edit: no undo step. */
680
680
  setSegmentationProvider(provider: SegmentationProvider | null): void;
@@ -1613,19 +1613,25 @@ export declare class ImageEditorController {
1613
1613
  * Select › Subject: asks the segmentation provider for the objects matching `target` ("the
1614
1614
  * dog", "the sky") in the flattened image and selects their shapes, combined with the
1615
1615
  * selection by `mode`, as one undo step. Returns what was found (labels and bounds in natural
1616
- * pixels); an empty list leaves the selection as it was. Throws without a provider.
1616
+ * pixels); an empty list leaves the selection as it was. Without a provider, the subject that
1617
+ * stands out most is found classically (superpixels, saliency, Otsu, GrabCut): `target` can't
1618
+ * choose it, and `method: 'saliency'` and a `note` say so.
1617
1619
  */
1618
- selectSubject(target: string, options?: SelectionCommandOptions & {
1620
+ selectSubject(target?: string, options?: SelectionCommandOptions & {
1619
1621
  maxSegments?: number;
1620
1622
  signal?: AbortSignal;
1621
1623
  /** Called with the outlines found (image pixels; a mask-only result's bounds) before the selection changes, e.g. to trace them with an agent's cursor. */
1622
1624
  beforeApply?: (outlines: ImagePoint[][]) => void | Promise<void>;
1625
+ /** Without a model: smoother, less blocky edges (Auto-Enhance). */
1626
+ enhanceEdge?: boolean;
1623
1627
  }): Promise<{
1624
1628
  segments: {
1625
1629
  label: string;
1626
1630
  bounds: CropBox | null;
1627
1631
  score?: number;
1628
1632
  }[];
1633
+ method: 'model' | 'saliency';
1634
+ note?: string;
1629
1635
  }>;
1630
1636
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
1631
1637
  setQuickMask(on: boolean): void;