func (g *InteractiveHeatmapSpeedGenerator) RenderHeatmap() error {

	gradient := g.Funscript.getGradientTable(g.NumSegments)

	img := image.NewRGBA(image.Rect(0, 0, g.Width, g.Height))
	for x := 0; x < g.Width; x++ {
		c := gradient.GetInterpolatedColorFor(float64(x) / float64(g.Width))
		draw.Draw(img, image.Rect(x, 0, x+1, g.Height), &image.Uniform{c}, image.Point{}, draw.Src)
	}

	// add 10 minute marks
	maxts := g.Funscript.Actions[len(g.Funscript.Actions)-1].At
	const tick = 600000
	var ts int64 = tick
	c, _ := colorful.Hex("#000000")
	for ts < maxts {
		x := int(float64(ts) / float64(maxts) * float64(g.Width))
		draw.Draw(img, image.Rect(x-1, g.Height/2, x+1, g.Height), &image.Uniform{c}, image.Point{}, draw.Src)
		ts += tick
	}

	outpng, err := os.Create(g.HeatmapPath)
	if err != nil {
		return err
	}
	defer outpng.Close()

	err = png.Encode(outpng, img)
	return err
}
// funscript needs to have intensity updated first
funscript needs to have intensity updated first
// funscript needs to have intensity updated first
func (g *InteractiveHeatmapSpeedGenerator) RenderHeatmap() error {
	gradient := g.Funscript.getGradientTable(g.NumSegments)
	img := image.NewRGBA(image.Rect(0, 0, g.Width, g.Height))
	for x := 0; x < g.Width; x++ {
		c := gradient.GetInterpolatedColorFor(float64(x) / float64(g.Width))
		draw.Draw(img, image.Rect(x, 0, x+1, g.Height), &image.Uniform{c}, image.Point{}, draw.Src)
	}
	maxts := g.Funscript.Actions[len(g.Funscript.Actions)-1].At
	const tick = 600000
	var ts int64 = tick
	c, _ := colorful.Hex("#000000")
	for ts < maxts {
		x := int(float64(ts) / float64(maxts) * float64(g.Width))
		draw.Draw(img, image.Rect(x-1, g.Height/2, x+1, g.Height), &image.Uniform{c}, image.Point{}, draw.Src)
		ts += tick
	}
	outpng, err := os.Create(g.HeatmapPath)
	if err != nil {
		return err
	}
	defer outpng.Close()
	err = png.Encode(outpng, img)
	return err
}
func ( g * InteractiveHeatmapSpeedGenerator ) RenderHeatmap ( ) error { gradient := g . Funscript . getGradientTable ( g . NumSegments ) img := image . NewRGBA ( image . Rect ( 0 , 0 , g . Width , g . Height ) ) for x := 0 ; x < g . Width ; x ++ { c := gradient . GetInterpolatedColorFor ( float64 ( x ) / float64 ( g . Width ) ) draw . Draw ( img , image . Rect ( x , 0 , x + 1 , g . Height ) , & image . Uniform { c } , image . Point { } , draw . Src ) } maxts := g . Funscript . Actions [ len ( g . Funscript . Actions ) - 1 ] . At const tick = 600000 var ts int64 = tick c , _ := colorful . Hex ( " " ) for ts < maxts { x := int ( float64 ( ts ) / float64 ( maxts ) * float64 ( g . Width ) ) draw . Draw ( img , image . Rect ( x - 1 , g . Height / 2 , x + 1 , g . Height ) , & image . Uniform { c } , image . Point { } , draw . Src ) ts += tick } outpng , err := os . Create ( g . HeatmapPath ) if err != nil { return err } defer outpng . Close ( ) err = png . Encode ( outpng , img ) return err }
funscript needs to have intensity updated first
funscript needs to have intensity updated first
// add 10 minute marks