Prepare for release 0.02

This commit is contained in:
Steven Polley 2018-07-31 21:40:30 -06:00
parent 7c410ab7dd
commit 3d0b47b1cc
2 changed files with 21 additions and 4 deletions

View File

@ -19,7 +19,7 @@ import (
const (
Size = 256
Iterations = (1<<16 - 1) / 256
Iterations = (1<<16 - 1) / 128
)
var (
@ -44,7 +44,7 @@ type pixel struct {
out *image.RGBA
x, y int
tileX, tileY int64
tileZoom uint8
tileZoom uint16
wg *sync.WaitGroup
}
@ -110,12 +110,13 @@ func renderTile(w http.ResponseWriter, r *http.Request) {
for x := 0; x < Size; x++ {
for y := 0; y < Size; y++ {
queue <- pixel{img, x, y, tileX, tileY, uint8(tileZoom), &wg}
queue <- pixel{img, x, y, tileX, tileY, uint16(tileZoom), &wg}
}
}
wg.Wait()
//addLabel(img, 20, 30, fmt.Sprintf("%s/%s/%s.png", components[1], components[2], components[3]))
w.Header().Set("Content-Type", "image/png")
png.Encode(w, img)
}
@ -192,3 +193,19 @@ func cosineInterpolation(c1, c2, mu float64) float64 {
func linearInterpolation(c1, c2, mu uint32) uint32 {
return c1*(1-mu) + c2*mu
}
//Adds a text label to an image
/*
func addLabel(img *image.RGBA, x, y int, label string) {
col := color.RGBA{255, 255, 255, 255}
point := fixed.Point26_6{fixed.Int26_6(x * 64), fixed.Int26_6(y * 64)}
d := &font.Drawer{
Dst: img,
Src: image.NewUniform(col),
Face: basicfont.Face7x13,
Dot: point,
}
d.DrawString(label)
}
*/

View File

@ -17,7 +17,7 @@ func init() {
<html>
<head>
<title>MandelMapper</title>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAZItO5CjoqDfPLwH_FZ4KcvQFt_L5dQBw"></script>
<script>
var mandelbrotTypeOptions = {
getTileUrl: function(coord, zoom) {