Line data Source code
1 2355 : export enum BrushShape {
2 2355 : Arc = 'arc',
3 2355 : Rect = 'rect'
4 : }
5 :
6 2355 : export enum Tools {
7 2355 : MaskPen = 'pen',
8 2355 : PaintPen = 'rgbPaint',
9 2355 : Eraser = 'eraser',
10 2355 : MaskBucket = 'paintBucket',
11 2355 : MaskColorFill = 'colorSelect'
12 : }
13 :
14 2355 : export const allTools = [
15 : Tools.MaskPen,
16 : Tools.PaintPen,
17 : Tools.Eraser,
18 : Tools.MaskBucket,
19 : Tools.MaskColorFill
20 : ]
21 :
22 : const allImageLayers = ['mask', 'rgb'] as const
23 :
24 : export type ImageLayer = (typeof allImageLayers)[number]
25 :
26 : export interface ToolInternalSettings {
27 : container: HTMLElement
28 : cursor?: string
29 : newActiveLayerOnSet?: ImageLayer
30 : }
31 :
32 2355 : export enum CompositionOperation {
33 2355 : SourceOver = 'source-over',
34 2355 : DestinationOut = 'destination-out'
35 : }
36 :
37 2355 : export enum MaskBlendMode {
38 2355 : Black = 'black',
39 2355 : White = 'white',
40 2355 : Negative = 'negative'
41 : }
42 :
43 2355 : export enum ColorComparisonMethod {
44 2355 : Simple = 'simple',
45 2355 : HSL = 'hsl',
46 2355 : LAB = 'lab'
47 : }
48 : export type { Point2D as Point } from '@comfyorg/shared-frontend-utils/geometry'
49 :
50 : export type { Point2D as Offset } from '@comfyorg/shared-frontend-utils/geometry'
51 :
52 : export interface Brush {
53 : type: BrushShape
54 : size: number
55 : opacity: number
56 : hardness: number
57 : stepSize: number
58 : }
|