I forgot to save fix after AI + AI - new functions

This commit is contained in:
mcDandy
2026-02-26 13:03:11 +01:00
parent e9b9486bf1
commit ddc4bfd460
10 changed files with 3868 additions and 2783 deletions
+61 -2
View File
@@ -211,6 +211,55 @@ You can also get the node from comfy manager under the name of More math.
### Random Distributions
Generates random noise with default shape of aither first input or maximum of input sizes, depending on node setting.
- `random_normal(seed,[shape])` or `randn` or `noise`: generates a random tensor with normal distribution (var=1, mean=0).
- `random_uniform(seed,[shape])` or `rand`: generates a random tensor with uniform distribution [0, 1).
- `random_exponential(seed, lambda,[shape])` or `rande`: generates a random tensor with exponential distribution.
- `random_cauchy(seed, median, sigma,[shape])` or `randc`: generates a random tensor with Cauchy distribution.
- `random_log_normal(seed, mean, std,[shape])` or `randln`: generates a random tensor with log-normal distribution.
- `random_bernoulli(seed, p,[shape])` or `randb`: generates a random tensor with Bernoulli distribution. Parameter `p` is the probability of getting 1, can be aither float or tensor. If p is tensor, shape is ignored.
- `random_poisson(seed, lambda,[shape])` or `randp`: generates a random tensor with Poisson distribution. Lambda can be either float or tensor.
- `random_gamma(seed, shape, scale,[shape])` or `randg`: generates a random tensor with Gamma distribution. Shape parameter (α) controls the shape, scale parameter (θ) controls the scale.
- `random_beta(seed, alpha, beta,[shape])` or `randbeta`: generates a random tensor with Beta distribution in range [0, 1]. Alpha and beta are shape parameters.
- `random_laplace(seed, loc, scale,[shape])` or `randl`: generates a random tensor with Laplace (double exponential) distribution. Useful for L1 regularization and robust statistics.
- `random_gumbel(seed, loc, scale,[shape])` or `randgumbel`: generates a random tensor with Gumbel distribution. Used in Gumbel-softmax trick for neural networks.
- `random_weibull(seed, scale, concentration,[shape])` or `randw`: generates a random tensor with Weibull distribution. Used in reliability analysis and survival modeling.
- `random_chi2(seed, df,[shape])` or `randchi2`: generates a random tensor with Chi-squared distribution. Degrees of freedom `df` controls the shape. Sum of squared normal distributions.
- `random_studentt(seed, df,[shape])` or `randt`: generates a random tensor with Student's t distribution. Has heavier tails than normal distribution, useful for robust noise. As `df` increases, approaches normal distribution.
### Noise Generation
- `perlin(seed, scale, [octaves,[offset, [shape]]])` or `perlin_noise`: generates Perlin noise. `scale` controls the frequency of the noise, `octaves` adds additional layers of noise, `offset` offsets the noise pattern, `shape` controls the output shape (default is determined by node inputs and settings).
- `plasma(seed, scale, [octaves,[offset, [shape]]])` or `turbulence` or `plasma_noise`: generates Plasma noise. Same parameters as perlin noise.
- `voronoi(seed, scale, [jitter], [offset], [shape])` or `voronoi_noise`: generates Voronoi noise. `scale` controls the frequency of the noise, `jitter` adds randomness to the cell boundaries, `offset` offsets the noise pattern, `shape` controls the output shape (default is determined by node inputs and settings).
### Bitwise Operations
Bitwise operations work with scalars, tensors, and lists, preserving bit patterns (especially important for floats where bit patterns are preserved, not values converted).
#### Shift Operators
- `a << b`: Left shift operator. Shifts bits of `a` left by `b` positions.
- `a >> b`: Right shift operator. Shifts bits of `a` right by `b` positions.
#### Bitwise Functions
- `band(a, b)` or `bitwise_and(a, b)`: Bitwise AND. Returns bits set in both operands.
- `bor(a, b)` or `bitwise_or(a, b)`: Bitwise OR. Returns bits set in either operand.
- `bxor(a, b)` or `bitwise_xor(a, b)`: Bitwise XOR. Returns bits set in exactly one operand.
- `bnot(a)` or `bitwise_not(a)`: Bitwise NOT. Inverts all bits in the operand.
- `bitcount(a)`, `popcount(a)`, or `popcnt(a)`: Count set bits. Returns the number of set bits (1s) in the binary representation as a float.
### Stack
- `stack_push(id, value)`: Pushes value to stack with id.
- `stack_pop(id)`: Pops value from stack with id.
- `stack_get(id)`: Gets value from stack with id.
- `stack_clear(id)`: Clears stack with id.
- `stack_has(id)`: Checks if stack with id exists.
### String Operations
- `upper(str)`: Converts string to uppercase.
@@ -221,6 +270,18 @@ You can also get the node from comfy manager under the name of More math.
- `find(str, search)`: Returns position of first occurrence of `search` in `str`, or -1 if not found.
- `trim(str)`: Removes leading and trailing whitespace from string.
### Morphological Operations (Image Processing)
- `dilate(x, [kernel_size])`: Dilation operation. Expands bright regions. Default kernel_size is 3.
- `erode(x, [kernel_size])`: Erosion operation. Shrinks bright regions. Default kernel_size is 3.
- `morph_open(x, [kernel_size])`: Opening operation (erosion followed by dilation). Removes small bright spots.
- `morph_close(x, [kernel_size])`: Closing operation (dilation followed by erosion). Fills small dark holes.
### Color Space Conversions
- `rgb_to_hsv(r, g, b)`: Converts RGB color (0-1 range) to HSV. Returns `[h, s, v]` where h is in degrees (0-360), s and v are 0-1.
- `hsv_to_rgb(h, s, v)`: Converts HSV color to RGB (0-1 range). Returns `[r, g, b]`. h is in degrees (0-360), s and v are 0-1.
## Variables
- **Common variables (except FLOAT, MODEL, VAE and CLIP)**:
@@ -239,7 +300,6 @@ You can also get the node from comfy manager under the name of More math.
- `w`, `x`, `y`, `z`
- **INSIDE IFFT**
- `F` or `frequency_count` – frequency count (freq domain, iFFT only)
- `F` or `frequency_count` - frequency count (freq domain, iFFT only)
- `K` or `frequency` - isotropic frequency (Euclidean norm of indices, iFFT only)
- `Kx`, `Ky`, `K_dimN` - frequency index for specific dimension
- `Fx`, `Fy`, `F_dimN` - frequency count for specific dimension
@@ -263,7 +323,6 @@ You can also get the node from comfy manager under the name of More math.
- `N` or `channel_count` - count of channels
- `C` or `channel` - channel of audio
- `S` or `sample` – current audio sample
- `S` or `sample` - current audio sample
- `T` or `sample_count` - audio lenght in samples
- `R` or `sample_rate` - sample rate
+34 -16
View File
@@ -158,13 +158,13 @@ func1:
| BNOT LPAREN expr RPAREN # BitNotFunc
| BITCOUNT LPAREN expr RPAREN # BitCountFunc
| SHAPE LPAREN expr RPAREN # ShapeFunc
| 'upper' LPAREN expr RPAREN # UpperFunc
| 'lower' LPAREN expr RPAREN # LowerFunc
| 'trim' LPAREN expr RPAREN # TrimFunc
| 'dilate' LPAREN expr (COMMA expr)? RPAREN # DilateFunc
| 'erode' LPAREN expr (COMMA expr)? RPAREN # ErodeFunc
| 'morph_open' LPAREN expr (COMMA expr)? RPAREN # MorphOpenFunc
| 'morph_close' LPAREN expr (COMMA expr)? RPAREN # MorphCloseFunc;
| UPPER LPAREN expr RPAREN # UpperFunc
| LOWER LPAREN expr RPAREN # LowerFunc
| TRIM LPAREN expr RPAREN # TrimFunc
| DILATE LPAREN expr (COMMA expr)? RPAREN # DilateFunc
| ERODE LPAREN expr (COMMA expr)? RPAREN # ErodeFunc
| MORPH_OPEN LPAREN expr (COMMA expr)? RPAREN # MorphOpenFunc
| MORPH_CLOSE LPAREN expr (COMMA expr)? RPAREN # MorphCloseFunc;
func2:
POWE LPAREN expr COMMA expr RPAREN # PowFunc
@@ -197,13 +197,12 @@ func2:
| BAND LPAREN expr COMMA expr RPAREN # BitAndFunc
| XOR LPAREN expr COMMA expr RPAREN # BitXorFunc
| BOR LPAREN expr COMMA expr RPAREN # BitOrFunc
| 'split' '(' expr (',' expr)? ')' # SplitFunc
| 'join' '(' expr (',' expr)? ')' # JoinFunc
| 'substring' '(' expr ',' expr (',' expr)? ')' # SubstringFunc
| 'substr' '(' expr ',' expr (',' expr)? ')' # SubstringFunc
| 'find' '(' expr ',' expr ')' # FindFunc
| 'replace' '(' expr ',' expr ',' expr ')' # ReplaceFunc;
| SPLIT LPAREN expr (COMMA expr)? RPAREN # SplitFunc
| JOIN LPAREN expr (COMMA expr)? RPAREN # JoinFunc
| SUBSTRING LPAREN expr COMMA expr (COMMA expr)? RPAREN # SubstringFunc
| SUBSTR LPAREN expr COMMA expr (COMMA expr)? RPAREN # SubstringFunc
| FIND LPAREN expr COMMA expr RPAREN # FindFunc
| REPLACE LPAREN expr COMMA expr COMMA expr RPAREN # ReplaceFunc;
func3:
CLAMP LPAREN expr COMMA expr COMMA expr RPAREN # ClampFunc
@@ -217,7 +216,10 @@ func3:
| SMOOTHERSTEP LPAREN expr COMMA expr COMMA expr RPAREN # SmootherstepFunc
| CROP LPAREN expr COMMA expr COMMA expr RPAREN # CropFunc
| SIFFT LPAREN expr (COMMA expr)? RPAREN # sifftFunc
| OVERLAY LPAREN expr COMMA expr COMMA expr RPAREN # OverlayFunc;
| OVERLAY LPAREN expr COMMA expr COMMA expr RPAREN # OverlayFunc
| RGB_TO_HSV LPAREN expr COMMA expr COMMA expr RPAREN # RgbToHsvFunc
| HSV_TO_RGB LPAREN expr COMMA expr COMMA expr RPAREN # HsvToRgbFunc;
func4:
SWAP LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # SwapFunc
| NVL LPAREN expr COMMA expr COMMA expr COMMA expr RPAREN # NvlFunc
@@ -364,6 +366,22 @@ CLEAR: 'stack_clear';
HAS: 'stack_has';
GET: 'stack_get';
UPPER: 'upper';
LOWER: 'lower';
TRIM: 'trim';
SPLIT: 'split';
JOIN: 'join';
SUBSTRING: 'substring';
SUBSTR: 'substr';
FIND: 'find';
REPLACE: 'replace';
DILATE: 'dilate';
ERODE: 'erode';
MORPH_OPEN: 'morph_open';
MORPH_CLOSE: 'morph_close';
RGB_TO_HSV: 'rgb_to_hsv';
HSV_TO_RGB: 'hsv_to_rgb';
IF: 'if';
ELSE: 'else';
WHILE: 'while';
@@ -441,4 +459,4 @@ VARIABLE: [a-zA-Z_] [a-zA-Z_0-9]*;
SL_COMMENT: '#' ~[\r\n]* -> skip;
ML_COMMENT: '/*' .*? '*/' -> skip;
WS: [ \t\r\n]+ -> skip;WS: [ \t\r\n]+ -> skip;
WS: [ \t\r\n]+ -> skip;
File diff suppressed because one or more lines are too long
+147 -117
View File
@@ -104,77 +104,92 @@ POP=103
CLEAR=104
HAS=105
GET=106
IF=107
ELSE=108
WHILE=109
FOR=110
IN=111
BREAK=112
CONTINUE=113
RETURN=114
TIMESTAMP=115
SORT=116
ARGSORT=117
ARGMIN=118
ARGMAX=119
SOFTMAX=120
SOFTMIN=121
UNIQUE=122
FLIP=123
COV=124
CROP=125
NONE=126
NOISE=127
RAND=128
CAUCHY=129
EXPONENTIAL=130
LOGNORMAL=131
BERNOULLI=132
POISSON=133
GAMMADIST=134
BETADIST=135
LAPLACEDIST=136
GUMBELDIST=137
WEIBULLDIST=138
CHI2DIST=139
STUDENTTDIST=140
PERLIN=141
CELLULAR=142
PLASMA=143
PLUS=144
MINUS=145
MULT=146
DIV=147
MOD=148
POW=149
LSHIFT=150
RSHIFT=151
GE=152
GT=153
LE=154
LT=155
EQ=156
EQUEALS=157
NE=158
PIPE=159
LPAREN=160
RPAREN=161
COMMA=162
SEMICOLON=163
ARROW=164
LBRACKET=165
RBRACKET=166
QUESTION=167
COLON=168
LBRACE=169
RBRACE=170
NUMBER=171
CONSTANT=172
STRING=173
VARIABLE=174
SL_COMMENT=175
ML_COMMENT=176
WS=177
UPPER=107
LOWER=108
TRIM=109
SPLIT=110
JOIN=111
SUBSTRING=112
SUBSTR=113
FIND=114
REPLACE=115
DILATE=116
ERODE=117
MORPH_OPEN=118
MORPH_CLOSE=119
RGB_TO_HSV=120
HSV_TO_RGB=121
IF=122
ELSE=123
WHILE=124
FOR=125
IN=126
BREAK=127
CONTINUE=128
RETURN=129
TIMESTAMP=130
SORT=131
ARGSORT=132
ARGMIN=133
ARGMAX=134
SOFTMAX=135
SOFTMIN=136
UNIQUE=137
FLIP=138
COV=139
CROP=140
NONE=141
NOISE=142
RAND=143
CAUCHY=144
EXPONENTIAL=145
LOGNORMAL=146
BERNOULLI=147
POISSON=148
GAMMADIST=149
BETADIST=150
LAPLACEDIST=151
GUMBELDIST=152
WEIBULLDIST=153
CHI2DIST=154
STUDENTTDIST=155
PERLIN=156
CELLULAR=157
PLASMA=158
PLUS=159
MINUS=160
MULT=161
DIV=162
MOD=163
POW=164
LSHIFT=165
RSHIFT=166
GE=167
GT=168
LE=169
LT=170
EQ=171
EQUEALS=172
NE=173
PIPE=174
LPAREN=175
RPAREN=176
COMMA=177
SEMICOLON=178
ARROW=179
LBRACKET=180
RBRACKET=181
QUESTION=182
COLON=183
LBRACE=184
RBRACE=185
NUMBER=186
CONSTANT=187
STRING=188
VARIABLE=189
SL_COMMENT=190
ML_COMMENT=191
WS=192
'sin'=1
'cos'=2
'tan'=3
@@ -258,49 +273,64 @@ WS=177
'stack_clear'=104
'stack_has'=105
'stack_get'=106
'if'=107
'else'=108
'while'=109
'for'=110
'in'=111
'break'=112
'continue'=113
'return'=114
'timestamp'=115
'sort'=116
'argsort'=117
'argmin'=118
'argmax'=119
'softmax'=120
'softmin'=121
'unique'=122
'flip'=123
'cov'=124
'crop'=125
'+'=144
'-'=145
'*'=146
'/'=147
'%'=148
'^'=149
'<<'=150
'>>'=151
'>='=152
'>'=153
'<='=154
'<'=155
'=='=156
'='=157
'!='=158
'|'=159
'('=160
')'=161
','=162
';'=163
'->'=164
'['=165
']'=166
'?'=167
':'=168
'{'=169
'}'=170
'upper'=107
'lower'=108
'trim'=109
'split'=110
'join'=111
'substring'=112
'substr'=113
'find'=114
'replace'=115
'dilate'=116
'erode'=117
'morph_open'=118
'morph_close'=119
'rgb_to_hsv'=120
'hsv_to_rgb'=121
'if'=122
'else'=123
'while'=124
'for'=125
'in'=126
'break'=127
'continue'=128
'return'=129
'timestamp'=130
'sort'=131
'argsort'=132
'argmin'=133
'argmax'=134
'softmax'=135
'softmin'=136
'unique'=137
'flip'=138
'cov'=139
'crop'=140
'+'=159
'-'=160
'*'=161
'/'=162
'%'=163
'^'=164
'<<'=165
'>>'=166
'>='=167
'>'=168
'<='=169
'<'=170
'=='=171
'='=172
'!='=173
'|'=174
'('=175
')'=176
','=177
';'=178
'->'=179
'['=180
']'=181
'?'=182
':'=183
'{'=184
'}'=185
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+147 -117
View File
@@ -104,77 +104,92 @@ POP=103
CLEAR=104
HAS=105
GET=106
IF=107
ELSE=108
WHILE=109
FOR=110
IN=111
BREAK=112
CONTINUE=113
RETURN=114
TIMESTAMP=115
SORT=116
ARGSORT=117
ARGMIN=118
ARGMAX=119
SOFTMAX=120
SOFTMIN=121
UNIQUE=122
FLIP=123
COV=124
CROP=125
NONE=126
NOISE=127
RAND=128
CAUCHY=129
EXPONENTIAL=130
LOGNORMAL=131
BERNOULLI=132
POISSON=133
GAMMADIST=134
BETADIST=135
LAPLACEDIST=136
GUMBELDIST=137
WEIBULLDIST=138
CHI2DIST=139
STUDENTTDIST=140
PERLIN=141
CELLULAR=142
PLASMA=143
PLUS=144
MINUS=145
MULT=146
DIV=147
MOD=148
POW=149
LSHIFT=150
RSHIFT=151
GE=152
GT=153
LE=154
LT=155
EQ=156
EQUEALS=157
NE=158
PIPE=159
LPAREN=160
RPAREN=161
COMMA=162
SEMICOLON=163
ARROW=164
LBRACKET=165
RBRACKET=166
QUESTION=167
COLON=168
LBRACE=169
RBRACE=170
NUMBER=171
CONSTANT=172
STRING=173
VARIABLE=174
SL_COMMENT=175
ML_COMMENT=176
WS=177
UPPER=107
LOWER=108
TRIM=109
SPLIT=110
JOIN=111
SUBSTRING=112
SUBSTR=113
FIND=114
REPLACE=115
DILATE=116
ERODE=117
MORPH_OPEN=118
MORPH_CLOSE=119
RGB_TO_HSV=120
HSV_TO_RGB=121
IF=122
ELSE=123
WHILE=124
FOR=125
IN=126
BREAK=127
CONTINUE=128
RETURN=129
TIMESTAMP=130
SORT=131
ARGSORT=132
ARGMIN=133
ARGMAX=134
SOFTMAX=135
SOFTMIN=136
UNIQUE=137
FLIP=138
COV=139
CROP=140
NONE=141
NOISE=142
RAND=143
CAUCHY=144
EXPONENTIAL=145
LOGNORMAL=146
BERNOULLI=147
POISSON=148
GAMMADIST=149
BETADIST=150
LAPLACEDIST=151
GUMBELDIST=152
WEIBULLDIST=153
CHI2DIST=154
STUDENTTDIST=155
PERLIN=156
CELLULAR=157
PLASMA=158
PLUS=159
MINUS=160
MULT=161
DIV=162
MOD=163
POW=164
LSHIFT=165
RSHIFT=166
GE=167
GT=168
LE=169
LT=170
EQ=171
EQUEALS=172
NE=173
PIPE=174
LPAREN=175
RPAREN=176
COMMA=177
SEMICOLON=178
ARROW=179
LBRACKET=180
RBRACKET=181
QUESTION=182
COLON=183
LBRACE=184
RBRACE=185
NUMBER=186
CONSTANT=187
STRING=188
VARIABLE=189
SL_COMMENT=190
ML_COMMENT=191
WS=192
'sin'=1
'cos'=2
'tan'=3
@@ -258,49 +273,64 @@ WS=177
'stack_clear'=104
'stack_has'=105
'stack_get'=106
'if'=107
'else'=108
'while'=109
'for'=110
'in'=111
'break'=112
'continue'=113
'return'=114
'timestamp'=115
'sort'=116
'argsort'=117
'argmin'=118
'argmax'=119
'softmax'=120
'softmin'=121
'unique'=122
'flip'=123
'cov'=124
'crop'=125
'+'=144
'-'=145
'*'=146
'/'=147
'%'=148
'^'=149
'<<'=150
'>>'=151
'>='=152
'>'=153
'<='=154
'<'=155
'=='=156
'='=157
'!='=158
'|'=159
'('=160
')'=161
','=162
';'=163
'->'=164
'['=165
']'=166
'?'=167
':'=168
'{'=169
'}'=170
'upper'=107
'lower'=108
'trim'=109
'split'=110
'join'=111
'substring'=112
'substr'=113
'find'=114
'replace'=115
'dilate'=116
'erode'=117
'morph_open'=118
'morph_close'=119
'rgb_to_hsv'=120
'hsv_to_rgb'=121
'if'=122
'else'=123
'while'=124
'for'=125
'in'=126
'break'=127
'continue'=128
'return'=129
'timestamp'=130
'sort'=131
'argsort'=132
'argmin'=133
'argmax'=134
'softmax'=135
'softmin'=136
'unique'=137
'flip'=138
'cov'=139
'crop'=140
'+'=159
'-'=160
'*'=161
'/'=162
'%'=163
'^'=164
'<<'=165
'>>'=166
'>='=167
'>'=168
'<='=169
'<'=170
'=='=171
'='=172
'!='=173
'|'=174
'('=175
')'=176
','=177
';'=178
'->'=179
'['=180
']'=181
'?'=182
':'=183
'{'=184
'}'=185
File diff suppressed because it is too large Load Diff
+70 -5
View File
@@ -474,11 +474,6 @@ class MathExprVisitor(ParseTreeVisitor):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#FractFunc.
def visitFractFunc(self, ctx:MathExprParser.FractFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#ReluFunc.
def visitReluFunc(self, ctx:MathExprParser.ReluFuncContext):
return self.visitChildren(ctx)
@@ -654,6 +649,41 @@ class MathExprVisitor(ParseTreeVisitor):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#UpperFunc.
def visitUpperFunc(self, ctx:MathExprParser.UpperFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#LowerFunc.
def visitLowerFunc(self, ctx:MathExprParser.LowerFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#TrimFunc.
def visitTrimFunc(self, ctx:MathExprParser.TrimFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#DilateFunc.
def visitDilateFunc(self, ctx:MathExprParser.DilateFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#ErodeFunc.
def visitErodeFunc(self, ctx:MathExprParser.ErodeFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#MorphOpenFunc.
def visitMorphOpenFunc(self, ctx:MathExprParser.MorphOpenFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#MorphCloseFunc.
def visitMorphCloseFunc(self, ctx:MathExprParser.MorphCloseFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#PowFunc.
def visitPowFunc(self, ctx:MathExprParser.PowFuncContext):
return self.visitChildren(ctx)
@@ -804,6 +834,31 @@ class MathExprVisitor(ParseTreeVisitor):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#SplitFunc.
def visitSplitFunc(self, ctx:MathExprParser.SplitFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#JoinFunc.
def visitJoinFunc(self, ctx:MathExprParser.JoinFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#SubstringFunc.
def visitSubstringFunc(self, ctx:MathExprParser.SubstringFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#FindFunc.
def visitFindFunc(self, ctx:MathExprParser.FindFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#ReplaceFunc.
def visitReplaceFunc(self, ctx:MathExprParser.ReplaceFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#ClampFunc.
def visitClampFunc(self, ctx:MathExprParser.ClampFuncContext):
return self.visitChildren(ctx)
@@ -864,6 +919,16 @@ class MathExprVisitor(ParseTreeVisitor):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#RgbToHsvFunc.
def visitRgbToHsvFunc(self, ctx:MathExprParser.RgbToHsvFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#HsvToRgbFunc.
def visitHsvToRgbFunc(self, ctx:MathExprParser.HsvToRgbFuncContext):
return self.visitChildren(ctx)
# Visit a parse tree produced by MathExprParser#SwapFunc.
def visitSwapFunc(self, ctx:MathExprParser.SwapFuncContext):
return self.visitChildren(ctx)
+3 -1
View File
@@ -25,7 +25,9 @@ const FUNCTIONS = new Set([
"random_gamma", "randbeta", "random_beta", "randl", "random_laplace", "randgumbel", "random_gumbel", "randw",
"random_weibull", "randchi2", "random_chi2", "randt", "random_studentt", "perlin", "perlin_noise", "cellular", "voronoi",
"worley", "cellular_noise", "voronoi_noise", "plasma", "turbulence", "plasma_noise",
"upper", "lower", "split", "join", "substring", "substr", "find", "trim", "replace"
"upper", "lower", "split", "join", "substring", "substr", "find", "trim", "replace",
"dilate", "erode", "morph_open", "morph_close",
"rgb_to_hsv", "hsv_to_rgb"
]);
const BRACKET_PAIRS = {