(shape Shape, alpha int)
| 101 | } |
| 102 | |
| 103 | func (model *Model) Add(shape Shape, alpha int) { |
| 104 | before := copyRGBA(model.Current) |
| 105 | lines := shape.Rasterize() |
| 106 | color := computeColor(model.Target, model.Current, lines, alpha) |
| 107 | drawLines(model.Current, color, lines) |
| 108 | score := differencePartial(model.Target, before, model.Current, model.Score, lines) |
| 109 | |
| 110 | model.Score = score |
| 111 | model.Shapes = append(model.Shapes, shape) |
| 112 | model.Colors = append(model.Colors, color) |
| 113 | model.Scores = append(model.Scores, score) |
| 114 | |
| 115 | model.Context.SetRGBA255(color.R, color.G, color.B, color.A) |
| 116 | shape.Draw(model.Context, model.Scale) |
| 117 | } |
| 118 | |
| 119 | func (model *Model) Step(shapeType ShapeType, alpha, repeat int) int { |
| 120 | state := model.runWorkers(shapeType, alpha, 1000, 100, 16) |
no test coverage detected