Compare commits

...

70 Commits
1.0 ... master

Author SHA1 Message Date
c9c29f980d change iterations from /64 to /128
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-01 14:56:37 -07:00
4b811dc8d7 upgrade golang.orx/x/image from 0.18.0 to 0.22.0 2024-12-01 14:56:26 -07:00
62eed5a9ee remove ca-certificates 2024-12-01 14:56:01 -07:00
1dd6fa470e move from deadbeef.codes to code.stevenpolley.net
All checks were successful
continuous-integration/drone/push Build is passing
2024-06-28 11:57:09 -06:00
c1b138aad1 update dependencies
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is failing
2024-01-06 23:45:43 -07:00
073f79aa79 update go mod
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-10 12:26:22 -06:00
MashPotato
b2515749ae high res is cool and all, it's really killing perf
All checks were successful
continuous-integration/drone/push Build is passing
2023-02-22 13:10:59 -07:00
60050187f8 revert back to interpolated color palette and reduce iterations
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
2021-07-30 17:35:59 -06:00
20dc1fcbd9 increase size to 512 (experimenting)
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-11 23:33:57 -06:00
67a301284e pride
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-11 17:35:29 -06:00
884f2f0f80 update web API key
All checks were successful
continuous-integration/drone/push Build is passing
2021-06-11 16:40:32 -06:00
7f3ce1a8e1 go mod init
All checks were successful
continuous-integration/drone/push Build is passing
2021-03-23 19:13:34 -06:00
f344c9ca06 add maintainer to Dockerfile
All checks were successful
continuous-integration/drone/push Build is passing
2020-10-04 21:09:02 +00:00
b6bd4382c1 remove production pipeline step
All checks were successful
continuous-integration/drone/push Build is passing
2020-02-15 05:15:00 +00:00
07cfe80c08 Trigger CICD build - test
All checks were successful
continuous-integration/drone/push Build is passing
2019-11-02 11:55:20 -06:00
0014ae7eee fix production push
All checks were successful
continuous-integration/drone/push Build is passing
2019-08-31 15:17:45 -06:00
48ac50f64c Merge branch 'master' of https://deadbeef.codes/steven/mandelmapper
All checks were successful
continuous-integration/drone/push Build is passing
2019-08-31 09:44:34 -06:00
d5f9fb4b86 fix prod not getting updated on push 2019-08-31 09:44:33 -06:00
0f86e21376 Update 'README.md'
All checks were successful
continuous-integration/drone/push Build is passing
2019-08-16 05:25:02 +00:00
42c657cc3a Color scheme: TBD allow selecting in front end
All checks were successful
continuous-integration/drone/push Build is passing
2019-06-23 10:30:10 -06:00
c91076b7ac Increase max iterations
All checks were successful
continuous-integration/drone/push Build is passing
2019-06-23 10:25:40 -06:00
89e4390465 Trigger CICD
All checks were successful
continuous-integration/drone/push Build is passing
2019-06-15 18:32:21 +00:00
002332594c Add hostname to labels
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-05 10:14:28 -07:00
85150c2792 Add update production on push
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-05 10:04:48 -07:00
b2c2ba5c42 Add formvalue
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-03 14:38:06 -07:00
8c1e447286 Only label if form value says so
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-03 14:35:35 -07:00
d475ea5083 add labels to images
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-03 13:46:33 -07:00
77f367ef23 Remove println
All checks were successful
continuous-integration/drone/push Build is passing
2019-03-03 13:27:13 -07:00
0d4980f64d Update google maps API key
All checks were successful
continuous-integration/drone/push Build is passing
2019-01-16 20:02:29 -07:00
d2dff15b6f Don't scale iterations for color effect
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-07 20:50:52 -07:00
107a95e7f4 Iterations / 128
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-07 20:47:33 -07:00
63e25ba2d5 Fix color scaling with high iteration count
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-06 17:22:25 -07:00
ff0ca4030c iterations *1
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-06 14:31:08 -07:00
b0e33f0d9a Hippi
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-06 14:23:18 -07:00
d426e601e5 colorstep / 4
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-06 14:21:20 -07:00
3921e641c9 Full iteration capacity
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-06 14:19:42 -07:00
d8f2c606ee /4 interpolations, 128 also blue
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-06 14:16:06 -07:00
197ecf54a7 128 iterations... 256 was all blue
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-06 14:13:53 -07:00
ec5fdfa0b3 More color steps
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-06 14:12:36 -07:00
1486b05cd9 add cicd badge
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-06 14:08:49 -07:00
9fae307f90 /256 iterations temporarily 2019-01-06 14:06:51 -07:00
677e069a4e Fix example docker-compose registry
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-05 18:52:57 -07:00
cfcfc79727 Change docker registry
Some checks are pending
continuous-integration/drone/push Build is passing
2019-01-05 18:50:54 -07:00
dd9b05bc00 From scratch docker image 2018-12-23 01:48:14 -07:00
d8f00ba2a6 Add worksapce to drone.yml 2018-12-22 23:43:16 -07:00
a6d7c05b59 Fix gopath 2018-12-22 23:40:00 -07:00
b2b12265d9 Update drone.yml 2018-12-22 23:36:26 -07:00
6b43a65110 remove space in steps in drone.yml 2018-12-22 23:30:07 -07:00
c4a56295b6 testnig drone again 2018-12-22 23:25:15 -07:00
8301d08873 drone 2018-12-22 23:20:03 -07:00
41b033d4f2 Update drone.yml to new format 2018-12-22 23:18:12 -07:00
cc54877d5e testing drone 2018-12-22 22:58:27 -07:00
c846cfe262 Test drone 1.0 build 2018-12-22 22:50:45 -07:00
0f970fd21e Divide by 64 2018-12-02 14:29:26 -07:00
e926140b99 Divide by 32 2018-12-02 14:28:06 -07:00
a07290c8c2 Divide by 4 2018-12-02 14:26:22 -07:00
44033bd5dc change to plan9 2018-11-24 14:06:54 -07:00
3b3fe20ae7 update docker-copose 2018-11-24 13:53:51 -07:00
50185baa41 Fix drone, x86 build 2018-11-24 13:51:48 -07:00
9105f34d6a Fix paths in dockerfile 2018-11-24 13:39:56 -07:00
2cb2d4764d Add docker-compose.yml 2018-11-24 13:36:06 -07:00
150a098c46 x86 dockerfile 2018-11-24 13:32:00 -07:00
9bd13db3ec merge upstream 2018-09-27 22:57:24 -06:00
93d0a51230 Hippi 2018-09-27 22:56:31 -06:00
Steven Polley
8a1b7315f8 increase iterations by factor of 256 2018-09-24 12:05:23 -06:00
Steven Polley
2a100b79a7 Update color to plan9 2018-09-24 12:02:02 -06:00
Steven Polley
6d9f9ca112 Update color 2018-09-24 11:56:41 -06:00
2f2e272347 iterations / 256 2018-09-16 17:14:45 -06:00
e359d09858 Change color to Vivid 2018-09-16 16:53:42 -06:00
4f949f35e0 change to plan9 color 2018-09-16 16:44:51 -06:00
9 changed files with 97 additions and 33 deletions

View File

@ -1,21 +1,23 @@
kind: pipeline
name: default
workspace:
base: /go
path: src/deadbeef.codes/steven/mandelmapper
path: src/code.stevenpolley.net/steven/mandelmapper
pipeline:
build:
image: golang:latest
environment:
- GOOS=linux
- GOARCH=arm
- GOARM=7
commands:
- go version
- go get
- go build
publish:
image: plugins/docker
repo: deadbeef.codes:5000/mandelmapper
registry: deadbeef.codes:5000
auto_tag: true
auto_tag_suffix: ${DRONE_COMMIT}
steps:
- name: build
image: golang
pull: always
environment:
GOOS: linux
GOARCH: amd64
CGO_ENABLED: 0
commands:
- go version
- go get
- go build -a -ldflags '-w'
- name: publish
image: plugins/docker
settings:
repo: registry.stevenpolley.net/mandelmapper

View File

@ -1,4 +1,5 @@
FROM deadbeef.codes:5000/raspberrypi3-alpine:3.7
COPY mandelmapper /usr/bin
FROM scratch
LABEL maintainer="himself@stevenpolley.net"
COPY mandelmapper /
EXPOSE 6161:6161
CMD mandelmapper
ENTRYPOINT ["/mandelmapper"]

View File

@ -1,3 +1,6 @@
testing drone ?
release
another drone test plz
[![Build Status](https://drone.deadbeef.codes/api/badges/steven/mandelmapper/status.svg)](https://drone.deadbeef.codes/steven/mandelmapper)
This is currently deployed to a ARMv8 cluster, viewable at https://mandelmap.deadbeef.codes

8
docker-compose.yml Normal file
View File

@ -0,0 +1,8 @@
version: '3.6'
services:
mandel-mapper:
image: registry.deadbeef.codes/mandelmapper:latest
ports:
- 6161:6161
restart: always

5
go.mod Normal file
View File

@ -0,0 +1,5 @@
module deadbeef.codes/steven/mandelmapper
go 1.22
require golang.org/x/image v0.22.0

4
go.sum Normal file
View File

@ -0,0 +1,4 @@
golang.org/x/image v0.18.0 h1:jGzIakQa/ZXI1I0Fxvaa9W7yP25TqT6cHIHn+6CqvSQ=
golang.org/x/image v0.18.0/go.mod h1:4yyo5vMFQjVjUcVk4jEQcU9MGy/rulF5WvUILseCM2E=
golang.org/x/image v0.22.0 h1:UtK5yLUzilVrkjMAZAZ34DXGpASN8i8pj8g+O+yd10g=
golang.org/x/image v0.22.0/go.mod h1:9hPFhljd4zZ1GNSIZJ49sqbp45GKK9t6w+iXvGqZUz4=

View File

@ -361,4 +361,13 @@ var ColorPalettes = []ColorMap{
Color{Color: color.RGBA{0x2a, 0xa1, 0x98, 0xff}},
Color{Color: color.RGBA{0x85, 0x99, 0x00, 0xff}},
}},
{"Pride", []Color{
Color{Step: 0.0, Color: color.RGBA{0xff, 0x00, 0x00, 0xff}},
Color{Step: 0.0, Color: color.RGBA{0xff, 0x7f, 0x00, 0xff}},
Color{Step: 0.0, Color: color.RGBA{0xff, 0xff, 0x00, 0xff}},
Color{Step: 0.0, Color: color.RGBA{0x00, 0xff, 0x00, 0xff}},
Color{Step: 0.0, Color: color.RGBA{0x00, 0x00, 0xff, 0xff}},
Color{Step: 0.0, Color: color.RGBA{0x2e, 0x2b, 0x5f, 0xff}},
Color{Step: 0.0, Color: color.RGBA{0x8b, 0x00, 0xff, 0xff}},
}},
}

View File

@ -1,6 +1,7 @@
package main
import (
"fmt"
"image"
"image/color"
"image/png"
@ -8,17 +9,22 @@ import (
"math"
"math/cmplx"
"net/http"
"os"
"runtime"
"strconv"
"strings"
"sync"
"deadbeef.codes/steven/mandelmapper/palette"
"golang.org/x/image/font"
"golang.org/x/image/font/basicfont"
"golang.org/x/image/math/fixed"
)
const (
Size = 128
Iterations = 1<<16 - 1
Size = 128
//Iterations = (1<<16 - 1) / 256
Iterations = (1<<16 - 1) / 128
)
var (
@ -46,8 +52,8 @@ func main() {
}
colorStep := float64(Iterations)
// colors = interpolateColors("Plan9", colorStep)
colors = interpolateColors("Solarized", colorStep)
colors = interpolateColors("Hippi", colorStep)
log.Fatal(http.ListenAndServe(":6161", nil))
}
@ -65,7 +71,7 @@ func computeThread() {
}
}
//interpolateColors accepts a color palette and number of desired colors and builds a slice of colors by interpolating the gaps
// interpolateColors accepts a color palette and number of desired colors and builds a slice of colors by interpolating the gaps
func interpolateColors(paletteCode string, numberOfColors float64) []color.RGBA {
var factor float64
steps := []float64{}
@ -132,6 +138,7 @@ func linearInterpolation(c1, c2, mu uint32) uint32 {
}
func renderTile(w http.ResponseWriter, r *http.Request) {
r.ParseForm()
components := strings.Split(r.URL.Path, "/")[1:]
if len(components) != 4 || components[0] != "mandelbrot" || components[3][len(components[3])-4:] != ".png" {
@ -167,6 +174,16 @@ func renderTile(w http.ResponseWriter, r *http.Request) {
}
}
wg.Wait()
if r.FormValue("label") == "1" {
addLabel(img, 1, 10, fmt.Sprintf("%d/%d/%d", tileZoom, tileX, tileY))
hostname, err := os.Hostname()
if err != nil {
hostname = fmt.Sprintf("failed to get hostname: %v", err)
}
addLabel(img, 1, 22, hostname)
}
w.Header().Set("Content-Type", "image/png")
png.Encode(w, img)
}
@ -181,3 +198,16 @@ func mandelbrot(c complex128) uint16 {
}
return Iterations
}
func addLabel(img *image.RGBA, x, y int, label string) {
col := color.RGBA{200, 100, 0, 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)
}

10
web.go
View File

@ -13,23 +13,25 @@ func init() {
return
}
r.ParseForm()
fmt.Fprintf(w, `<!DOCTYPE html>
<html>
<head>
<title>MandelMapper</title>
<meta property="og:url" content="http://mc.deadbeef.codes/" />
<meta property="og:url" content="https://mandelmap.deadbeef.codes/" />
<meta property="og:type" content="website" />
<meta property="og:title" content="Mandelbrot Mapper">
<meta property="og:description" content="A Google maps front end to a distributed real-time fractal renderer">
<meta property="og:image" content="https://deadbeef.codes/img/mandelbrot.png" />
<meta property="og:site_name" content="deadbeef.codes">
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAZItO5CjoqDfPLwH_FZ4KcvQFt_L5dQBw"></script>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDJJV_-Q2wIBlzYVzfIbZTapl-8tMoYxw8"></script>
<script>
var mandelbrotTypeOptions = {
getTileUrl: function(coord, zoom) {
return '/mandelbrot/' + zoom + '/' + coord.x + '/' + coord.y + '.png';
return '/mandelbrot/' + zoom + '/' + coord.x + '/' + coord.y + '.png?label=%s';
},
tileSize: new google.maps.Size(128, 128),
maxZoom: (1<<16),
@ -67,6 +69,6 @@ function initialize() {
<body onload="initialize()">
<div id="map_canvas"></div>
</body>
</html>`)
</html>`, r.FormValue("label"))
})
}