Skip to content

Commit 3d13292

Browse files
committed
delete mask ref object type
1 parent c3438f8 commit 3d13292

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+356
-2136
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,10 @@ mask.fillPath(
223223
Q 180 120 100 180
224224
Q 20 120 20 60
225225
z
226-
"""
226+
""",
227+
color(1, 1, 1, 1)
227228
)
228-
lines.draw(mask)
229+
lines.draw(mask, blendMode = MaskBlend)
229230
image.draw(lines)
230231
```
231232
![example output](examples/masking.png)
@@ -303,8 +304,8 @@ nim c -r [examples/blur.nim](examples/blur.nim)
303304
let path = newPath()
304305
path.polygon(vec2(100, 100), 70, sides = 6)
305306
306-
let mask = newMask(200, 200)
307-
mask.fillPath(path)
307+
let mask = newImage(200, 200)
308+
mask.fillPath(path, color(1, 1, 1, 1))
308309
309310
blur.blur(20)
310311
blur.draw(mask, blendMode = MaskBlend)

bindings/bindings.nim

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,10 @@ exportRefObject Image:
125125
applyOpacity(Image, float32)
126126
invert(Image)
127127
blur(Image, float32, Color)
128-
newMask(Image)
129128
resize(Image, int, int)
130129
shadow(Image, Vec2, float32, float32, Color)
131130
superImage
132131
draw(Image, Image, Mat3, BlendMode)
133-
draw(Image, Mask, Mat3, BlendMode)
134132
fillGradient
135133
fillText(Image, Font, string, Mat3, Vec2, HorizontalAlignment, VerticalAlignment)
136134
fillText(Image, Arrangement, Mat3)
@@ -140,36 +138,6 @@ exportRefObject Image:
140138
strokePath(Image, Path, Paint, Mat3, float32, LineCap, LineJoin, float32, seq[float32])
141139
newContext(Image)
142140

143-
exportRefObject Mask:
144-
fields:
145-
width
146-
height
147-
constructor:
148-
newMask(int, int)
149-
procs:
150-
writeFile(Mask, string)
151-
copy(Mask)
152-
getValue
153-
setValue
154-
fill(Mask, uint8)
155-
minifyBy2(Mask, int)
156-
magnifyBy2(Mask, int)
157-
spread
158-
ceil(Mask)
159-
newImage(Mask)
160-
applyOpacity(Mask, float32)
161-
invert(Mask)
162-
blur(Mask, float32, uint8)
163-
resize(Mask, int, int)
164-
draw(Mask, Mask, Mat3, BlendMode)
165-
draw(Mask, Image, Mat3, BlendMode)
166-
fillText(Mask, Font, string, Mat3, Vec2, HorizontalAlignment, VerticalAlignment)
167-
fillText(Mask, Arrangement, Mat3)
168-
strokeText(Mask, Font, string, Mat3, float32, Vec2, HorizontalAlignment, VerticalAlignment, LineCap, LineJoin, float32, seq[float32])
169-
strokeText(Mask, Arrangement, Mat3, float32, LineCap, LineJoin, float32, seq[float32])
170-
fillPath(Mask, Path, Mat3, WindingRule)
171-
strokePath(Mask, Path, Mat3, float32, LineCap, LineJoin, float32, seq[float32])
172-
173141
exportRefObject Paint:
174142
fields:
175143
kind
@@ -320,7 +288,6 @@ exportProcs:
320288
decodeImageDimensions
321289
readImage
322290
readImageDimensions
323-
readmask
324291
readTypeface
325292
readFont
326293
parsePath

examples/blur.nim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ image.fill(rgba(255, 255, 255, 255))
1010
let path = newPath()
1111
path.polygon(vec2(100, 100), 70, sides = 6)
1212

13-
let mask = newMask(200, 200)
14-
mask.fillPath(path)
13+
let mask = newImage(200, 200)
14+
mask.fillPath(path, color(1, 1, 1, 1))
1515

1616
blur.blur(20)
1717
blur.draw(mask, blendMode = MaskBlend)

examples/blur.png

2.84 KB
Loading

examples/gradient.png

-1.21 KB
Loading

examples/heart.png

-1.02 KB
Loading

examples/image_tiled.png

120 Bytes
Loading

examples/line.png

-1.09 KB
Loading

examples/masking.nim

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import pixie
33
let
44
image = newImage(200, 200)
55
lines = newImage(200, 200)
6-
mask = newMask(200, 200)
6+
mask = newImage(200, 200)
77

88
lines.fill(parseHtmlColor("#FC427B").rgba)
99
image.fill(rgba(255, 255, 255, 255))
@@ -23,9 +23,10 @@ mask.fillPath(
2323
Q 180 120 100 180
2424
Q 20 120 20 60
2525
z
26-
"""
26+
""",
27+
color(1, 1, 1, 1)
2728
)
28-
lines.draw(mask)
29+
lines.draw(mask, blendMode = MaskBlend)
2930
image.draw(lines)
3031

3132
image.writeFile("examples/masking.png")

examples/masking.png

-1.16 KB
Loading

0 commit comments

Comments
 (0)