@pixerate/editor 0.194.0 → 0.196.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.
@@ -1,5 +1,6 @@
1
1
  import { AdjustmentKind, AdjustmentLayer, AdjustmentParamsMap, Annotation, CreateAnnotationPayload, AspectRatio, CropBox, DepthMaskOptions, ExportOptions, ImageAdjustments, ImageDimensions, ImageEditorFit, ImageEditorOptions, ImageEditorState, ImageEditorTool, ImageTransform, ImagePoint, SerializedImageEditorState } from './types.cjs';
2
2
  import { type PathToSelectionOptions, type SelectionToPathOptions } from './selection/path.cjs';
3
+ import { type MagneticEdgeOptions } from './selection/magnetic.cjs';
3
4
  import { RenderOptions } from './renderer.cjs';
4
5
  import { type BlendMode } from './blend.cjs';
5
6
  import type { ImageHistogram } from './histogram.cjs';
@@ -1498,6 +1499,12 @@ export declare class ImageEditorController {
1498
1499
  selectEllipse(rect: CropBox, options?: SelectionCommandOptions & ShapeSelectionOptions): boolean;
1499
1500
  /** Lasso / polygonal lasso. */
1500
1501
  selectPolygon(points: ImagePoint[], options?: SelectionCommandOptions & ShapeSelectionOptions): boolean;
1502
+ /**
1503
+ * Magnetic Lasso for a given outline: each point snaps to the strongest edge within `width` px
1504
+ * and consecutive points (the last back to the first) are joined along the edges. Returns the
1505
+ * snapped outline in natural pixels, for {@link selectPolygon}.
1506
+ */
1507
+ snapToEdges(points: ImagePoint[], options?: MagneticEdgeOptions & SampleOptions): Promise<ImagePoint[]>;
1501
1508
  /**
1502
1509
  * Supplies the pixels the selection tools sample (natural size RGBA), e.g. decoded in a worker
1503
1510
  * or in a test; `null` goes back to reading the source image. Without a canvas (Node, workers)
@@ -1,5 +1,6 @@
1
1
  import { AdjustmentKind, AdjustmentLayer, AdjustmentParamsMap, Annotation, CreateAnnotationPayload, AspectRatio, CropBox, DepthMaskOptions, ExportOptions, ImageAdjustments, ImageDimensions, ImageEditorFit, ImageEditorOptions, ImageEditorState, ImageEditorTool, ImageTransform, ImagePoint, SerializedImageEditorState } from './types.js';
2
2
  import { type PathToSelectionOptions, type SelectionToPathOptions } from './selection/path.js';
3
+ import { type MagneticEdgeOptions } from './selection/magnetic.js';
3
4
  import { RenderOptions } from './renderer.js';
4
5
  import { type BlendMode } from './blend.js';
5
6
  import type { ImageHistogram } from './histogram.js';
@@ -1498,6 +1499,12 @@ export declare class ImageEditorController {
1498
1499
  selectEllipse(rect: CropBox, options?: SelectionCommandOptions & ShapeSelectionOptions): boolean;
1499
1500
  /** Lasso / polygonal lasso. */
1500
1501
  selectPolygon(points: ImagePoint[], options?: SelectionCommandOptions & ShapeSelectionOptions): boolean;
1502
+ /**
1503
+ * Magnetic Lasso for a given outline: each point snaps to the strongest edge within `width` px
1504
+ * and consecutive points (the last back to the first) are joined along the edges. Returns the
1505
+ * snapped outline in natural pixels, for {@link selectPolygon}.
1506
+ */
1507
+ snapToEdges(points: ImagePoint[], options?: MagneticEdgeOptions & SampleOptions): Promise<ImagePoint[]>;
1501
1508
  /**
1502
1509
  * Supplies the pixels the selection tools sample (natural size RGBA), e.g. decoded in a worker
1503
1510
  * or in a test; `null` goes back to reading the source image. Without a canvas (Node, workers)