diff --git a/mandelmapper/render.go b/mandelmapper/render.go index 13a0ada..aee3a0b 100644 --- a/mandelmapper/render.go +++ b/mandelmapper/render.go @@ -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) +} +*/ diff --git a/mandelmapper/web.go b/mandelmapper/web.go index ccf3d0c..8a9ec0f 100644 --- a/mandelmapper/web.go +++ b/mandelmapper/web.go @@ -17,7 +17,7 @@ func init() { MandelMapper - +