diff --git a/tests/images/centerRotation.master.png b/tests/images/centerRotation.master.png deleted file mode 100644 index 70cf775..0000000 Binary files a/tests/images/centerRotation.master.png and /dev/null differ diff --git a/tests/images/centerRotationWhite.master.png b/tests/images/centerRotationWhite.master.png deleted file mode 100644 index 2723c55..0000000 Binary files a/tests/images/centerRotationWhite.master.png and /dev/null differ diff --git a/tests/images/drawCopy.master.png b/tests/images/drawBlend.png similarity index 100% rename from tests/images/drawCopy.master.png rename to tests/images/drawBlend.png diff --git a/tests/images/drawFast3.png b/tests/images/drawBlendSmooth.png similarity index 100% rename from tests/images/drawFast3.png rename to tests/images/drawBlendSmooth.png diff --git a/tests/images/drawFast1Rot.master.png b/tests/images/drawFast1Rot.master.png deleted file mode 100644 index d67e4bd..0000000 Binary files a/tests/images/drawFast1Rot.master.png and /dev/null differ diff --git a/tests/images/drawFast2.png b/tests/images/drawFast2.png deleted file mode 100644 index ef62fc5..0000000 Binary files a/tests/images/drawFast2.png and /dev/null differ diff --git a/tests/images/drawFast3.master.png b/tests/images/drawFast3.master.png deleted file mode 100644 index bef6ff3..0000000 Binary files a/tests/images/drawFast3.master.png and /dev/null differ diff --git a/tests/images/drawFast3Rot.master.png b/tests/images/drawFast3Rot.master.png deleted file mode 100644 index 2a78fb8..0000000 Binary files a/tests/images/drawFast3Rot.master.png and /dev/null differ diff --git a/tests/images/drawFast3Rot.png b/tests/images/drawFast3Rot.png deleted file mode 100644 index 2a78fb8..0000000 Binary files a/tests/images/drawFast3Rot.png and /dev/null differ diff --git a/tests/images/drawFast4.master.png b/tests/images/drawFast4.master.png deleted file mode 100644 index 3a098ca..0000000 Binary files a/tests/images/drawFast4.master.png and /dev/null differ diff --git a/tests/images/drawFast4.png b/tests/images/drawFast4.png deleted file mode 100644 index 3a098ca..0000000 Binary files a/tests/images/drawFast4.png and /dev/null differ diff --git a/tests/images/drawFast4Rot.master.png b/tests/images/drawFast4Rot.master.png deleted file mode 100644 index 3a098ca..0000000 Binary files a/tests/images/drawFast4Rot.master.png and /dev/null differ diff --git a/tests/images/drawFast4Rot.png b/tests/images/drawFast4Rot.png deleted file mode 100644 index 3a098ca..0000000 Binary files a/tests/images/drawFast4Rot.png and /dev/null differ diff --git a/tests/images/drawFast1.master.png b/tests/images/drawOverwrite.png similarity index 100% rename from tests/images/drawFast1.master.png rename to tests/images/drawOverwrite.png diff --git a/tests/images/drawFast1Rot.png b/tests/images/drawOverwriteRot.png similarity index 100% rename from tests/images/drawFast1Rot.png rename to tests/images/drawOverwriteRot.png diff --git a/tests/images/drawSmooth.master.png b/tests/images/drawSmooth.master.png deleted file mode 100644 index e695b85..0000000 Binary files a/tests/images/drawSmooth.master.png and /dev/null differ diff --git a/tests/images/masters/centerRotation.png b/tests/images/masters/centerRotation.png new file mode 100644 index 0000000..52b891b Binary files /dev/null and b/tests/images/masters/centerRotation.png differ diff --git a/tests/images/masters/centerRotationWhite.png b/tests/images/masters/centerRotationWhite.png new file mode 100644 index 0000000..1e1144e Binary files /dev/null and b/tests/images/masters/centerRotationWhite.png differ diff --git a/tests/images/drawFast1.png b/tests/images/masters/drawBlend.png similarity index 100% rename from tests/images/drawFast1.png rename to tests/images/masters/drawBlend.png diff --git a/tests/images/masters/drawBlendSmooth.png b/tests/images/masters/drawBlendSmooth.png new file mode 100644 index 0000000..df7a048 Binary files /dev/null and b/tests/images/masters/drawBlendSmooth.png differ diff --git a/tests/images/drawFast2.master.png b/tests/images/masters/drawOverwrite.png similarity index 100% rename from tests/images/drawFast2.master.png rename to tests/images/masters/drawOverwrite.png diff --git a/tests/images/masters/drawOverwriteRot.png b/tests/images/masters/drawOverwriteRot.png new file mode 100644 index 0000000..35cedb3 Binary files /dev/null and b/tests/images/masters/drawOverwriteRot.png differ diff --git a/tests/images/masters/transCompose.c.png b/tests/images/masters/transCompose.c.png new file mode 100644 index 0000000..52b891b Binary files /dev/null and b/tests/images/masters/transCompose.c.png differ diff --git a/tests/images/masters/transCompose.png b/tests/images/masters/transCompose.png new file mode 100644 index 0000000..5fd4195 Binary files /dev/null and b/tests/images/masters/transCompose.png differ diff --git a/tests/test_images.nim b/tests/test_images.nim index 77bef73..b5597bf 100644 --- a/tests/test_images.nim +++ b/tests/test_images.nim @@ -1,11 +1,11 @@ -import pixie, chroma, vmath, os +import pixie, chroma, vmath, strutils, os proc writeAndCheck(image: Image, fileName: string) = image.writeFile(fileName) - let masterFileName = fileName.changeFileExt(".master.png") + let masterFileName = fileName.replace("tests/images/", "tests/images/masters/") if not existsFile(masterFileName): echo "Master file: " & masterFileName & " not found!" - return + quit(-1) var master = readImage(fileName) assert image.width == master.width assert image.height == master.height @@ -16,7 +16,7 @@ block: a.fill(rgba(0, 0, 0, 0)) var b = newImage(50, 50) b.fill(rgba(255, 92, 0, 255)) - var c = a.drawFast3( + var c = a.drawBlendSmooth( b, translate(vec2(50, 50)) * rotationMat3(0.2789281382) * translate(vec2(-25, -25)), bmNormal @@ -28,7 +28,7 @@ block: a.fill(rgba(255, 255, 255, 255)) var b = newImage(50, 50) b.fill(rgba(255, 92, 0, 255)) - var c = a.drawFast3( + var c = a.drawBlendSmooth( b, translate(vec2(50, 50)) * rotationMat3(0.2789281382) * translate(vec2(-25, -25)), bmNormal @@ -41,7 +41,7 @@ block: a.fill(rgba(0, 0, 0, 0)) var b = newImage(50, 50) b.fill(rgba(255, 92, 0, 255)) - var c = a.drawFast3( + var c = a.drawBlendSmooth( b, translate(vec2(50, 50)) * rotationMat3(0.2789281382) * translate(vec2(-25, -25)), bmNormal @@ -67,24 +67,24 @@ block: a.fill(rgba(255, 0, 0, 255)) var b = newImage(100, 100) b.fill(rgba(0, 255, 0, 255)) - var c = a.drawFast1(b, translate(vec2(25, 25))) - c.writeAndCheck("tests/images/drawFast1.png") + var c = a.drawOverwrite(b, translate(vec2(25, 25))) + c.writeAndCheck("tests/images/drawOverwrite.png") block: var a = newImage(100, 100) a.fill(rgba(255, 0, 0, 255)) var b = newImage(100, 100) b.fill(rgba(0, 255, 0, 255)) - var c = a.drawFast2(b, translate(vec2(25, 25)), bmCopy) - c.writeAndCheck("tests/images/drawFast2.png") + var c = a.drawBlend(b, translate(vec2(25, 25)), bmOverwrite) + c.writeAndCheck("tests/images/drawBlend.png") block: var a = newImage(100, 100) a.fill(rgba(255, 0, 0, 255)) var b = newImage(100, 100) b.fill(rgba(0, 255, 0, 255)) - var c = a.drawFast3(b, translate(vec2(25.15, 25.15)), bmCopy) - c.writeAndCheck("tests/images/drawFast3.png") + var c = a.drawBlendSmooth(b, translate(vec2(25.15, 25.15)), bmOverwrite) + c.writeAndCheck("tests/images/drawBlendSmooth.png") block: var a = newImage(100, 100) @@ -92,5 +92,5 @@ block: var b = newImage(100, 100) b.fill(rgba(0, 255, 0, 255)) - var c = a.drawFast1(b, translate(vec2(25, 25)) * rotationMat3(PI/2)) - c.writeAndCheck("tests/images/drawFast1Rot.png") + var c = a.drawOverwrite(b, translate(vec2(25, 25)) * rotationMat3(PI/2)) + c.writeAndCheck("tests/images/drawOverwriteRot.png")