redirect curve tests results to output.curve folder
This commit is contained in:
parent
55b5c931cf
commit
d00980730f
8 changed files with 27 additions and 15 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -20,4 +20,4 @@ _test*
|
||||||
**/*.dll
|
**/*.dll
|
||||||
**/core*[0-9]
|
**/core*[0-9]
|
||||||
.private
|
.private
|
||||||
output
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ func (p *Path) LineTo(x, y float64) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
f, err := os.Create("_test.html")
|
f, err := os.Create("../output/curve/test.html")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -60,10 +60,10 @@ func init() {
|
||||||
log.Printf("Create html viewer")
|
log.Printf("Create html viewer")
|
||||||
f.Write([]byte("<html><body>"))
|
f.Write([]byte("<html><body>"))
|
||||||
for i := 0; i < len(testsCubicFloat64); i++ {
|
for i := 0; i < len(testsCubicFloat64); i++ {
|
||||||
f.Write([]byte(fmt.Sprintf("<div><img src='_testRec%d.png'/>\n<img src='_test%d.png'/>\n<img src='_testAdaptiveRec%d.png'/>\n<img src='_testAdaptive%d.png'/>\n<img src='_testParabolic%d.png'/>\n</div>\n", i, i, i, i, i)))
|
f.Write([]byte(fmt.Sprintf("<div><img src='testRec%d.png'/>\n<img src='test%d.png'/>\n<img src='testAdaptiveRec%d.png'/>\n<img src='testAdaptive%d.png'/>\n<img src='testParabolic%d.png'/>\n</div>\n", i, i, i, i, i)))
|
||||||
}
|
}
|
||||||
for i := 0; i < len(testsQuadFloat64); i++ {
|
for i := 0; i < len(testsQuadFloat64); i++ {
|
||||||
f.Write([]byte(fmt.Sprintf("<div><img src='_testQuad%d.png'/>\n</div>\n", i)))
|
f.Write([]byte(fmt.Sprintf("<div><img src='testQuad%d.png'/>\n</div>\n", i)))
|
||||||
}
|
}
|
||||||
f.Write([]byte("</body></html>"))
|
f.Write([]byte("</body></html>"))
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ func TestCubicCurveRec(t *testing.T) {
|
||||||
raster.PolylineBresenham(img, image.Black, p.points...)
|
raster.PolylineBresenham(img, image.Black, p.points...)
|
||||||
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
||||||
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
|
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))
|
log.Printf("Num of points: %d\n", len(p.points))
|
||||||
}
|
}
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -132,7 +132,7 @@ func TestCubicCurve(t *testing.T) {
|
||||||
raster.PolylineBresenham(img, image.Black, p.points...)
|
raster.PolylineBresenham(img, image.Black, p.points...)
|
||||||
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
||||||
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
|
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))
|
log.Printf("Num of points: %d\n", len(p.points))
|
||||||
}
|
}
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -148,7 +148,7 @@ func TestCubicCurveAdaptiveRec(t *testing.T) {
|
||||||
raster.PolylineBresenham(img, image.Black, p.points...)
|
raster.PolylineBresenham(img, image.Black, p.points...)
|
||||||
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
||||||
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
|
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))
|
log.Printf("Num of points: %d\n", len(p.points))
|
||||||
}
|
}
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -164,7 +164,7 @@ func TestCubicCurveAdaptive(t *testing.T) {
|
||||||
raster.PolylineBresenham(img, image.Black, p.points...)
|
raster.PolylineBresenham(img, image.Black, p.points...)
|
||||||
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
||||||
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
|
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))
|
log.Printf("Num of points: %d\n", len(p.points))
|
||||||
}
|
}
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -180,7 +180,7 @@ func TestCubicCurveParabolic(t *testing.T) {
|
||||||
raster.PolylineBresenham(img, image.Black, p.points...)
|
raster.PolylineBresenham(img, image.Black, p.points...)
|
||||||
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
||||||
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
|
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))
|
log.Printf("Num of points: %d\n", len(p.points))
|
||||||
}
|
}
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
@ -196,7 +196,7 @@ func TestQuadCurve(t *testing.T) {
|
||||||
raster.PolylineBresenham(img, image.Black, p.points...)
|
raster.PolylineBresenham(img, image.Black, p.points...)
|
||||||
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
//drawPoints(img, image.NRGBAColor{0, 0, 0, 0xff}, curve[:]...)
|
||||||
drawPoints(img, color.NRGBA{0, 0, 0, 0xff}, p.points...)
|
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))
|
log.Printf("Num of points: %d\n", len(p.points))
|
||||||
}
|
}
|
||||||
fmt.Println()
|
fmt.Println()
|
||||||
|
|
4
output/curve/.gitignore
vendored
Normal file
4
output/curve/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Ignore everything in this directory
|
||||||
|
*
|
||||||
|
# Except this file
|
||||||
|
!.gitignore
|
4
output/raster/.gitignore
vendored
Normal file
4
output/raster/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Ignore everything in this directory
|
||||||
|
*
|
||||||
|
# Except this file
|
||||||
|
!.gitignore
|
4
output/samples/.gitignore
vendored
Normal file
4
output/samples/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
# Ignore everything in this directory
|
||||||
|
*
|
||||||
|
# Except this file
|
||||||
|
!.gitignore
|
|
@ -74,7 +74,7 @@ func TestFreetype(t *testing.T) {
|
||||||
painter.SetColor(color)
|
painter.SetColor(color)
|
||||||
rasterizer.Rasterize(painter)
|
rasterizer.Rasterize(painter)
|
||||||
|
|
||||||
savepng("../output/raster_TestFreetype.png", img)
|
savepng("../output/raster/TestFreetype.png", img)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFreetypeNonZeroWinding(t *testing.T) {
|
func TestFreetypeNonZeroWinding(t *testing.T) {
|
||||||
|
@ -100,7 +100,7 @@ func TestFreetypeNonZeroWinding(t *testing.T) {
|
||||||
painter.SetColor(color)
|
painter.SetColor(color)
|
||||||
rasterizer.Rasterize(painter)
|
rasterizer.Rasterize(painter)
|
||||||
|
|
||||||
savepng("../output/raster_TestFreetypeNonZeroWinding.png", img)
|
savepng("../output/raster/TestFreetypeNonZeroWinding.png", img)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRasterizer(t *testing.T) {
|
func TestRasterizer(t *testing.T) {
|
||||||
|
@ -116,7 +116,7 @@ func TestRasterizer(t *testing.T) {
|
||||||
//PolylineBresenham(img, image.Black, poly...)
|
//PolylineBresenham(img, image.Black, poly...)
|
||||||
|
|
||||||
r.RenderEvenOdd(img, &color, &poly, tr)
|
r.RenderEvenOdd(img, &color, &poly, tr)
|
||||||
savepng("../output/raster_TestRasterizer.png", img)
|
savepng("../output/raster/TestRasterizer.png", img)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRasterizerNonZeroWinding(t *testing.T) {
|
func TestRasterizerNonZeroWinding(t *testing.T) {
|
||||||
|
@ -132,7 +132,7 @@ func TestRasterizerNonZeroWinding(t *testing.T) {
|
||||||
//PolylineBresenham(img, image.Black, poly...)
|
//PolylineBresenham(img, image.Black, poly...)
|
||||||
|
|
||||||
r.RenderNonZeroWinding(img, &color, &poly, tr)
|
r.RenderNonZeroWinding(img, &color, &poly, tr)
|
||||||
savepng("../output/raster_TestRasterizerNonZeroWinding.png", img)
|
savepng("../output/raster/TestRasterizerNonZeroWinding.png", img)
|
||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkFreetype(b *testing.B) {
|
func BenchmarkFreetype(b *testing.B) {
|
||||||
|
|
|
@ -20,5 +20,5 @@ func Output(name, ext string) string {
|
||||||
if ext == "pdf" {
|
if ext == "pdf" {
|
||||||
root = "../"
|
root = "../"
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%soutput/%s.%s", root, name, ext)
|
return fmt.Sprintf("%soutput/samples/%s.%s", root, name, ext)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue