@pixerate/editor 0.195.0 → 0.197.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.
@@ -140,6 +140,17 @@ export interface SampleOptions {
140
140
  /** Pixels to use instead of reading the source image (natural size, RGBA). */
141
141
  pixels?: PixelBuffer;
142
142
  }
143
+ /** Options of {@link ImageEditorController.quickSelect}. */
144
+ export interface QuickSelectCommandOptions {
145
+ /** Brush diameter in natural pixels (default 30). */
146
+ size?: number;
147
+ /** How the strokes combine with the selection (default `replace`: the first replaces, the rest add). */
148
+ mode?: SelectionMode;
149
+ /** Sample every layer (default true) or only the active pixel layer. */
150
+ sampleAllLayers?: boolean;
151
+ /** Smoother, less blocky edges (Photoshop's Auto-Enhance). Default false. */
152
+ enhanceEdge?: boolean;
153
+ }
143
154
  /** A new adjustment layer: its kind plus optional initial values and position. */
144
155
  export interface AdjustmentLayerInit<K extends AdjustmentKind = AdjustmentKind> extends AdjustmentLayerUpdate<K> {
145
156
  kind: K;
@@ -1505,6 +1516,13 @@ export declare class ImageEditorController {
1505
1516
  * snapped outline in natural pixels, for {@link selectPolygon}.
1506
1517
  */
1507
1518
  snapToEdges(points: ImagePoint[], options?: MagneticEdgeOptions & SampleOptions): Promise<ImagePoint[]>;
1519
+ /**
1520
+ * Quick Selection: each stroke (the brush's path in natural pixels) grows into the region it is
1521
+ * painted on, out to that region's edges, and is combined with the selection by `mode`; with
1522
+ * `replace`, the first stroke replaces it and the rest add, as the brush does. All strokes are
1523
+ * one undo step. Resolves to the resulting selection.
1524
+ */
1525
+ quickSelect(strokes: ImagePoint[][], options?: QuickSelectCommandOptions): Promise<SelectionMask | null>;
1508
1526
  /**
1509
1527
  * Supplies the pixels the selection tools sample (natural size RGBA), e.g. decoded in a worker
1510
1528
  * or in a test; `null` goes back to reading the source image. Without a canvas (Node, workers)
@@ -140,6 +140,17 @@ export interface SampleOptions {
140
140
  /** Pixels to use instead of reading the source image (natural size, RGBA). */
141
141
  pixels?: PixelBuffer;
142
142
  }
143
+ /** Options of {@link ImageEditorController.quickSelect}. */
144
+ export interface QuickSelectCommandOptions {
145
+ /** Brush diameter in natural pixels (default 30). */
146
+ size?: number;
147
+ /** How the strokes combine with the selection (default `replace`: the first replaces, the rest add). */
148
+ mode?: SelectionMode;
149
+ /** Sample every layer (default true) or only the active pixel layer. */
150
+ sampleAllLayers?: boolean;
151
+ /** Smoother, less blocky edges (Photoshop's Auto-Enhance). Default false. */
152
+ enhanceEdge?: boolean;
153
+ }
143
154
  /** A new adjustment layer: its kind plus optional initial values and position. */
144
155
  export interface AdjustmentLayerInit<K extends AdjustmentKind = AdjustmentKind> extends AdjustmentLayerUpdate<K> {
145
156
  kind: K;
@@ -1505,6 +1516,13 @@ export declare class ImageEditorController {
1505
1516
  * snapped outline in natural pixels, for {@link selectPolygon}.
1506
1517
  */
1507
1518
  snapToEdges(points: ImagePoint[], options?: MagneticEdgeOptions & SampleOptions): Promise<ImagePoint[]>;
1519
+ /**
1520
+ * Quick Selection: each stroke (the brush's path in natural pixels) grows into the region it is
1521
+ * painted on, out to that region's edges, and is combined with the selection by `mode`; with
1522
+ * `replace`, the first stroke replaces it and the rest add, as the brush does. All strokes are
1523
+ * one undo step. Resolves to the resulting selection.
1524
+ */
1525
+ quickSelect(strokes: ImagePoint[][], options?: QuickSelectCommandOptions): Promise<SelectionMask | null>;
1508
1526
  /**
1509
1527
  * Supplies the pixels the selection tools sample (natural size RGBA), e.g. decoded in a worker
1510
1528
  * or in a test; `null` goes back to reading the source image. Without a canvas (Node, workers)