-
Notifications
You must be signed in to change notification settings - Fork 0
/
cm_StretchEdges.nk
201 lines (201 loc) · 4.65 KB
/
cm_StretchEdges.nk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
Group {
name cm_StretchEdges
tile_color 0x6a49efff
note_font_color 0xffffffff
selected true
xpos 8
ypos -399
addUserKnob {20 Settings l StretchEdges}
addUserKnob {26 text_4 l "" +STARTLINE T " "}
addUserKnob {26 direction l "" +STARTLINE T "Stretch Directions:"}
addUserKnob {26 text_6 l "" +STARTLINE T " "}
addUserKnob {26 ""}
addUserKnob {26 text l "" +STARTLINE T " "}
addUserKnob {6 enableLeft l Left +STARTLINE}
enableLeft true
addUserKnob {6 enableRight l Right -STARTLINE}
enableRight true
addUserKnob {6 enableTop l Top -STARTLINE}
enableTop true
addUserKnob {6 enableBottom l Bottom -STARTLINE}
enableBottom true
addUserKnob {26 text_1 l "" +STARTLINE T " "}
addUserKnob {26 ""}
addUserKnob {26 text_2 l "" +STARTLINE T " "}
addUserKnob {7 amount l stretch t "Stretch pixels outward from the inputs bounding box." R 0 250}
amount 10
addUserKnob {7 erode l soften t "How far inward from the bounding box you wish to stretch from. High number means smoother stretch but more of the image is affected." R 1 500}
erode 10
addUserKnob {26 text_3 l "" +STARTLINE T " "}
addUserKnob {26 ""}
addUserKnob {26 text_7 l "" +STARTLINE T " "}
addUserKnob {6 bbox l "maintain bbox" +STARTLINE}
addUserKnob {6 blackOutside l "black outside" -STARTLINE}
addUserKnob {26 text_8 l "" +STARTLINE T " "}
addUserKnob {26 "" +STARTLINE}
addUserKnob {26 text_5 l "" +STARTLINE T " "}
addUserKnob {26 Credit l "" +STARTLINE T "StretchEdges v1.0 | © 2024 | <a href=\"www.chrismccrowe.com\" style=\"color:#757575; text-decoration:none\">www.chrismccrowe.com</a>"}
}
Input {
inputs 0
name Input1
xpos -189
ypos -393
}
set N2a74e800 [stack 0]
Crop {
box {{input.bbox.x-bbox_padding} {input.bbox.y-bbox_padding} {input.bbox.r+bbox_padding} {input.bbox.t+bbox_padding}}
name Crop_To_BBox
xpos -675
ypos -393
addUserKnob {20 padding_tab l Padding}
addUserKnob {7 bbox_padding l "bbox padding" t "Add or subtract from bounding box" R -100 100}
}
push $N2a74e800
push $N2a74e800
Shuffle2 {
fromInput1 {{0} B}
fromInput2 {{0} B}
mappings "4 black -1 -1 rgba.alpha 0 3 black -1 -1 rgba.red 0 0 black -1 -1 rgba.green 0 1 black -1 -1 rgba.blue 0 2"
name Shuffle1
xpos -636
ypos 46
}
set N2a74ec00 [stack 0]
Ramp {
cliptype none
p0 {{parent.Crop_To_BBox.box.r/2} {parent.Crop_To_BBox.box.y+parent.erode}}
p1 {{parent.Crop_To_BBox.box.r/2} {Crop_To_BBox.box.y-parent.erode}}
name Ramp_FromBottom
xpos -390
ypos 284
}
push $N2a74ec00
Ramp {
cliptype none
p0 {{parent.Crop_To_BBox.box.r/2} {parent.Crop_To_BBox.box.t-parent.erode}}
p1 {{parent.Crop_To_BBox.box.r/2} {parent.Crop_To_BBox.box.t+parent.erode}}
name Ramp_FromTop
xpos -385
ypos 174
}
push $N2a74ec00
Ramp {
cliptype none
p0 {{parent.Crop_To_BBox.box.r-parent.erode} {parent.Crop_To_BBox.box.t/2}}
p1 {{parent.Crop_To_BBox.box.r+parent.erode} {parent.Crop_To_BBox.box.t/2}}
name Ramp_FromRight
xpos -355
ypos 46
}
push $N2a74ec00
Ramp {
cliptype none
p0 {{parent.Crop_To_BBox.box.x+parent.erode} {parent.Crop_To_BBox.box.t/2}}
p1 {{parent.Crop_To_BBox.box.x-parent.erode} {parent.Crop_To_BBox.box.t/2}}
name Ramp_FromLeft
xpos -361
ypos -83
}
push $N2a74e800
Copy {
inputs 2
from0 rgba.alpha
to0 forward.u
from1 rgba.alpha
to1 forward.v
name Copy1
xpos -189
ypos -95
disable {{!parent.enableLeft}}
}
IDistort {
uv forward
uv_scale {{parent.amount} 0}
name IDistort_FromLeft
xpos -189
ypos -47
disable {{!parent.enableLeft}}
}
Copy {
inputs 2
from0 rgba.alpha
to0 forward.u
from1 rgba.alpha
to1 forward.v
name Copy2
xpos -189
ypos 34
disable {{!parent.enableRight}}
}
IDistort {
uv forward
uv_scale {{parent.amount*-1} 0}
name IDistort_FromRight
xpos -189
ypos 82
disable {{!parent.enableRight}}
}
Copy {
inputs 2
from0 rgba.alpha
to0 forward.u
from1 rgba.alpha
to1 forward.v
name Copy3
xpos -189
ypos 162
disable {{!parent.enableTop}}
}
IDistort {
uv forward
uv_scale {0 {parent.amount*-1}}
name IDistort_FromTop
xpos -189
ypos 210
disable {{!parent.enableTop}}
}
Copy {
inputs 2
from0 rgba.alpha
to0 forward.u
from1 rgba.alpha
to1 forward.v
name Copy4
xpos -189
ypos 272
disable {{!parent.enableBottom}}
}
IDistort {
uv forward
uv_scale {0 {parent.amount}}
name IDistort_FromTop1
xpos -189
ypos 320
disable {{!parent.enableBottom}}
}
Remove {
channels forward
name Remove1
xpos -189
ypos 370
}
CopyBBox {
inputs 2
name CopyBBox1
xpos -191
ypos 424
disable {{!parent.bbox}}
}
BlackOutside {
name BlackOutside1
xpos -191
ypos 448
disable {{!parent.blackOutside}}
}
Output {
name Output1
xpos -191
ypos 529
}
end_group