blend + rotation mat test
This commit is contained in:
parent
abbcc717cd
commit
d07c77095d
6 changed files with 51 additions and 0 deletions
BIN
tests/images/rotate0.png
Normal file
BIN
tests/images/rotate0.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.8 KiB |
BIN
tests/images/rotate180.png
Normal file
BIN
tests/images/rotate180.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.7 KiB |
BIN
tests/images/rotate270.png
Normal file
BIN
tests/images/rotate270.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
BIN
tests/images/rotate360.png
Normal file
BIN
tests/images/rotate360.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.7 KiB |
BIN
tests/images/rotate90.png
Normal file
BIN
tests/images/rotate90.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.4 KiB |
51
tests/test_images_draw.nim
Normal file
51
tests/test_images_draw.nim
Normal file
|
@ -0,0 +1,51 @@
|
|||
import chroma, pixie, vmath
|
||||
|
||||
block:
|
||||
let
|
||||
a = newImage(1000, 1000)
|
||||
b = newImage(500, 500)
|
||||
a.fill(rgba(255, 0, 0, 255))
|
||||
b.fill(rgba(0, 255, 0, 255))
|
||||
|
||||
a.draw(b, translate(vec2(250, 250)))
|
||||
a.writeFile("tests/images/rotate0.png")
|
||||
|
||||
block:
|
||||
let
|
||||
a = newImage(1000, 1000)
|
||||
b = newImage(500, 500)
|
||||
a.fill(rgba(255, 0, 0, 255))
|
||||
b.fill(rgba(0, 255, 0, 255))
|
||||
|
||||
a.draw(b, translate(vec2(250, 250)) * rotationMat3(90 * PI / 180))
|
||||
a.writeFile("tests/images/rotate90.png")
|
||||
|
||||
block:
|
||||
let
|
||||
a = newImage(1000, 1000)
|
||||
b = newImage(500, 500)
|
||||
a.fill(rgba(255, 0, 0, 255))
|
||||
b.fill(rgba(0, 255, 0, 255))
|
||||
|
||||
a.draw(b, translate(vec2(250, 250)) * rotationMat3(180 * PI / 180))
|
||||
a.writeFile("tests/images/rotate180.png")
|
||||
|
||||
block:
|
||||
let
|
||||
a = newImage(1000, 1000)
|
||||
b = newImage(500, 500)
|
||||
a.fill(rgba(255, 0, 0, 255))
|
||||
b.fill(rgba(0, 255, 0, 255))
|
||||
|
||||
a.draw(b, translate(vec2(250, 250)) * rotationMat3(270 * PI / 180))
|
||||
a.writeFile("tests/images/rotate270.png")
|
||||
|
||||
block:
|
||||
let
|
||||
a = newImage(1000, 1000)
|
||||
b = newImage(500, 500)
|
||||
a.fill(rgba(255, 0, 0, 255))
|
||||
b.fill(rgba(0, 255, 0, 255))
|
||||
|
||||
a.draw(b, translate(vec2(250, 250)) * rotationMat3(360 * PI / 180))
|
||||
a.writeFile("tests/images/rotate360.png")
|
Loading…
Reference in a new issue