diff --git a/.gitignore b/.gitignore
index 5aafa34..3527a30 100644
--- a/.gitignore
+++ b/.gitignore
@@ -20,4 +20,4 @@ _test*
**/*.dll
**/core*[0-9]
.private
-output
+
diff --git a/curve/curve_test.go b/curve/curve_test.go
index 1196761..0978e11 100644
--- a/curve/curve_test.go
+++ b/curve/curve_test.go
@@ -51,7 +51,7 @@ func (p *Path) LineTo(x, y float64) {
}
func init() {
- f, err := os.Create("_test.html")
+ f, err := os.Create("../output/curve/test.html")
if err != nil {
log.Println(err)
os.Exit(1)
@@ -60,10 +60,10 @@ func init() {
log.Printf("Create html viewer")
f.Write([]byte("
"))
for i := 0; i < len(testsCubicFloat64); i++ {
- f.Write([]byte(fmt.Sprintf("\n", i, i, i, i, i)))
+ f.Write([]byte(fmt.Sprintf("\n", i, i, i, i, i)))
}
for i := 0; i < len(testsQuadFloat64); i++ {
- f.Write([]byte(fmt.Sprintf("\n
\n", i)))
+ f.Write([]byte(fmt.Sprintf("\n
\n", i)))
}
f.Write([]byte(""))
@@ -116,7 +116,7 @@ func TestCubicCurveRec(t *testing.T) {
raster.PolylineBresenham(img, image.Black, p.points...)
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
- savepng(fmt.Sprintf("_testRec%d.png", i), img)
+ savepng(fmt.Sprintf("../output/curve/testRec%d.png", i), img)
log.Printf("Num of points: %d\n", len(p.points))
}
fmt.Println()
@@ -132,7 +132,7 @@ func TestCubicCurve(t *testing.T) {
raster.PolylineBresenham(img, image.Black, p.points...)
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
- savepng(fmt.Sprintf("_test%d.png", i), img)
+ savepng(fmt.Sprintf("../output/curve/test%d.png", i), img)
log.Printf("Num of points: %d\n", len(p.points))
}
fmt.Println()
@@ -148,7 +148,7 @@ func TestCubicCurveAdaptiveRec(t *testing.T) {
raster.PolylineBresenham(img, image.Black, p.points...)
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
- savepng(fmt.Sprintf("_testAdaptiveRec%d.png", i), img)
+ savepng(fmt.Sprintf("../output/curve/testAdaptiveRec%d.png", i), img)
log.Printf("Num of points: %d\n", len(p.points))
}
fmt.Println()
@@ -164,7 +164,7 @@ func TestCubicCurveAdaptive(t *testing.T) {
raster.PolylineBresenham(img, image.Black, p.points...)
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
- savepng(fmt.Sprintf("_testAdaptive%d.png", i), img)
+ savepng(fmt.Sprintf("../output/curve/testAdaptive%d.png", i), img)
log.Printf("Num of points: %d\n", len(p.points))
}
fmt.Println()
@@ -180,7 +180,7 @@ func TestCubicCurveParabolic(t *testing.T) {
raster.PolylineBresenham(img, image.Black, p.points...)
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
- savepng(fmt.Sprintf("_testParabolic%d.png", i), img)
+ savepng(fmt.Sprintf("../output/curve/testParabolic%d.png", i), img)
log.Printf("Num of points: %d\n", len(p.points))
}
fmt.Println()
@@ -196,7 +196,7 @@ func TestQuadCurve(t *testing.T) {
raster.PolylineBresenham(img, image.Black, p.points...)
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
- savepng(fmt.Sprintf("_testQuad%d.png", i), img)
+ savepng(fmt.Sprintf("../output/curve/testQuad%d.png", i), img)
log.Printf("Num of points: %d\n", len(p.points))
}
fmt.Println()
diff --git a/output/.empty b/output/.empty
deleted file mode 100644
index e69de29..0000000
diff --git a/output/curve/.gitignore b/output/curve/.gitignore
new file mode 100644
index 0000000..86d0cb2
--- /dev/null
+++ b/output/curve/.gitignore
@@ -0,0 +1,4 @@
+# Ignore everything in this directory
+*
+# Except this file
+!.gitignore
\ No newline at end of file
diff --git a/output/raster/.gitignore b/output/raster/.gitignore
new file mode 100644
index 0000000..86d0cb2
--- /dev/null
+++ b/output/raster/.gitignore
@@ -0,0 +1,4 @@
+# Ignore everything in this directory
+*
+# Except this file
+!.gitignore
\ No newline at end of file
diff --git a/output/samples/.gitignore b/output/samples/.gitignore
new file mode 100644
index 0000000..86d0cb2
--- /dev/null
+++ b/output/samples/.gitignore
@@ -0,0 +1,4 @@
+# Ignore everything in this directory
+*
+# Except this file
+!.gitignore
\ No newline at end of file
diff --git a/raster/raster_test.go b/raster/raster_test.go
index 40dc3a9..e01373e 100644
--- a/raster/raster_test.go
+++ b/raster/raster_test.go
@@ -74,7 +74,7 @@ func TestFreetype(t *testing.T) {
painter.SetColor(color)
rasterizer.Rasterize(painter)
- savepng("../output/raster_TestFreetype.png", img)
+ savepng("../output/raster/TestFreetype.png", img)
}
func TestFreetypeNonZeroWinding(t *testing.T) {
@@ -100,7 +100,7 @@ func TestFreetypeNonZeroWinding(t *testing.T) {
painter.SetColor(color)
rasterizer.Rasterize(painter)
- savepng("../output/raster_TestFreetypeNonZeroWinding.png", img)
+ savepng("../output/raster/TestFreetypeNonZeroWinding.png", img)
}
func TestRasterizer(t *testing.T) {
@@ -116,7 +116,7 @@ func TestRasterizer(t *testing.T) {
//PolylineBresenham(img, image.Black, poly...)
r.RenderEvenOdd(img, &color, &poly, tr)
- savepng("../output/raster_TestRasterizer.png", img)
+ savepng("../output/raster/TestRasterizer.png", img)
}
func TestRasterizerNonZeroWinding(t *testing.T) {
@@ -132,7 +132,7 @@ func TestRasterizerNonZeroWinding(t *testing.T) {
//PolylineBresenham(img, image.Black, poly...)
r.RenderNonZeroWinding(img, &color, &poly, tr)
- savepng("../output/raster_TestRasterizerNonZeroWinding.png", img)
+ savepng("../output/raster/TestRasterizerNonZeroWinding.png", img)
}
func BenchmarkFreetype(b *testing.B) {
diff --git a/samples/samples.go b/samples/samples.go
index ee08db4..ff30559 100644
--- a/samples/samples.go
+++ b/samples/samples.go
@@ -20,5 +20,5 @@ func Output(name, ext string) string {
if ext == "pdf" {
root = "../"
}
- return fmt.Sprintf("%soutput/%s.%s", root, name, ext)
+ return fmt.Sprintf("%soutput/samples/%s.%s", root, name, ext)
}