Fix tests.
Before Width: | Height: | Size: 900 B |
Before Width: | Height: | Size: 932 B |
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 328 B |
Before Width: | Height: | Size: 352 B After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 346 B |
Before Width: | Height: | Size: 328 B |
Before Width: | Height: | Size: 358 B |
Before Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 375 B |
Before Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 336 B |
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 328 B |
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 343 B |
Before Width: | Height: | Size: 356 B |
BIN
tests/images/masters/centerRotation.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
tests/images/masters/centerRotationWhite.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 328 B |
BIN
tests/images/masters/drawBlendSmooth.png
Normal file
After Width: | Height: | Size: 352 B |
Before Width: | Height: | Size: 328 B After Width: | Height: | Size: 328 B |
BIN
tests/images/masters/drawOverwriteRot.png
Normal file
After Width: | Height: | Size: 343 B |
BIN
tests/images/masters/transCompose.c.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
tests/images/masters/transCompose.png
Normal file
After Width: | Height: | Size: 1.6 KiB |
|
@ -1,11 +1,11 @@
|
||||||
import pixie, chroma, vmath, os
|
import pixie, chroma, vmath, strutils, os
|
||||||
|
|
||||||
proc writeAndCheck(image: Image, fileName: string) =
|
proc writeAndCheck(image: Image, fileName: string) =
|
||||||
image.writeFile(fileName)
|
image.writeFile(fileName)
|
||||||
let masterFileName = fileName.changeFileExt(".master.png")
|
let masterFileName = fileName.replace("tests/images/", "tests/images/masters/")
|
||||||
if not existsFile(masterFileName):
|
if not existsFile(masterFileName):
|
||||||
echo "Master file: " & masterFileName & " not found!"
|
echo "Master file: " & masterFileName & " not found!"
|
||||||
return
|
quit(-1)
|
||||||
var master = readImage(fileName)
|
var master = readImage(fileName)
|
||||||
assert image.width == master.width
|
assert image.width == master.width
|
||||||
assert image.height == master.height
|
assert image.height == master.height
|
||||||
|
@ -16,7 +16,7 @@ block:
|
||||||
a.fill(rgba(0, 0, 0, 0))
|
a.fill(rgba(0, 0, 0, 0))
|
||||||
var b = newImage(50, 50)
|
var b = newImage(50, 50)
|
||||||
b.fill(rgba(255, 92, 0, 255))
|
b.fill(rgba(255, 92, 0, 255))
|
||||||
var c = a.drawFast3(
|
var c = a.drawBlendSmooth(
|
||||||
b,
|
b,
|
||||||
translate(vec2(50, 50)) * rotationMat3(0.2789281382) * translate(vec2(-25, -25)),
|
translate(vec2(50, 50)) * rotationMat3(0.2789281382) * translate(vec2(-25, -25)),
|
||||||
bmNormal
|
bmNormal
|
||||||
|
@ -28,7 +28,7 @@ block:
|
||||||
a.fill(rgba(255, 255, 255, 255))
|
a.fill(rgba(255, 255, 255, 255))
|
||||||
var b = newImage(50, 50)
|
var b = newImage(50, 50)
|
||||||
b.fill(rgba(255, 92, 0, 255))
|
b.fill(rgba(255, 92, 0, 255))
|
||||||
var c = a.drawFast3(
|
var c = a.drawBlendSmooth(
|
||||||
b,
|
b,
|
||||||
translate(vec2(50, 50)) * rotationMat3(0.2789281382) * translate(vec2(-25, -25)),
|
translate(vec2(50, 50)) * rotationMat3(0.2789281382) * translate(vec2(-25, -25)),
|
||||||
bmNormal
|
bmNormal
|
||||||
|
@ -41,7 +41,7 @@ block:
|
||||||
a.fill(rgba(0, 0, 0, 0))
|
a.fill(rgba(0, 0, 0, 0))
|
||||||
var b = newImage(50, 50)
|
var b = newImage(50, 50)
|
||||||
b.fill(rgba(255, 92, 0, 255))
|
b.fill(rgba(255, 92, 0, 255))
|
||||||
var c = a.drawFast3(
|
var c = a.drawBlendSmooth(
|
||||||
b,
|
b,
|
||||||
translate(vec2(50, 50)) * rotationMat3(0.2789281382) * translate(vec2(-25, -25)),
|
translate(vec2(50, 50)) * rotationMat3(0.2789281382) * translate(vec2(-25, -25)),
|
||||||
bmNormal
|
bmNormal
|
||||||
|
@ -67,24 +67,24 @@ block:
|
||||||
a.fill(rgba(255, 0, 0, 255))
|
a.fill(rgba(255, 0, 0, 255))
|
||||||
var b = newImage(100, 100)
|
var b = newImage(100, 100)
|
||||||
b.fill(rgba(0, 255, 0, 255))
|
b.fill(rgba(0, 255, 0, 255))
|
||||||
var c = a.drawFast1(b, translate(vec2(25, 25)))
|
var c = a.drawOverwrite(b, translate(vec2(25, 25)))
|
||||||
c.writeAndCheck("tests/images/drawFast1.png")
|
c.writeAndCheck("tests/images/drawOverwrite.png")
|
||||||
|
|
||||||
block:
|
block:
|
||||||
var a = newImage(100, 100)
|
var a = newImage(100, 100)
|
||||||
a.fill(rgba(255, 0, 0, 255))
|
a.fill(rgba(255, 0, 0, 255))
|
||||||
var b = newImage(100, 100)
|
var b = newImage(100, 100)
|
||||||
b.fill(rgba(0, 255, 0, 255))
|
b.fill(rgba(0, 255, 0, 255))
|
||||||
var c = a.drawFast2(b, translate(vec2(25, 25)), bmCopy)
|
var c = a.drawBlend(b, translate(vec2(25, 25)), bmOverwrite)
|
||||||
c.writeAndCheck("tests/images/drawFast2.png")
|
c.writeAndCheck("tests/images/drawBlend.png")
|
||||||
|
|
||||||
block:
|
block:
|
||||||
var a = newImage(100, 100)
|
var a = newImage(100, 100)
|
||||||
a.fill(rgba(255, 0, 0, 255))
|
a.fill(rgba(255, 0, 0, 255))
|
||||||
var b = newImage(100, 100)
|
var b = newImage(100, 100)
|
||||||
b.fill(rgba(0, 255, 0, 255))
|
b.fill(rgba(0, 255, 0, 255))
|
||||||
var c = a.drawFast3(b, translate(vec2(25.15, 25.15)), bmCopy)
|
var c = a.drawBlendSmooth(b, translate(vec2(25.15, 25.15)), bmOverwrite)
|
||||||
c.writeAndCheck("tests/images/drawFast3.png")
|
c.writeAndCheck("tests/images/drawBlendSmooth.png")
|
||||||
|
|
||||||
block:
|
block:
|
||||||
var a = newImage(100, 100)
|
var a = newImage(100, 100)
|
||||||
|
@ -92,5 +92,5 @@ block:
|
||||||
var b = newImage(100, 100)
|
var b = newImage(100, 100)
|
||||||
b.fill(rgba(0, 255, 0, 255))
|
b.fill(rgba(0, 255, 0, 255))
|
||||||
|
|
||||||
var c = a.drawFast1(b, translate(vec2(25, 25)) * rotationMat3(PI/2))
|
var c = a.drawOverwrite(b, translate(vec2(25, 25)) * rotationMat3(PI/2))
|
||||||
c.writeAndCheck("tests/images/drawFast1Rot.png")
|
c.writeAndCheck("tests/images/drawOverwriteRot.png")
|
||||||
|
|