()
| 13 | var fontMask image.Image |
| 14 | |
| 15 | func init() { |
| 16 | im, err := png.Decode(bytes.NewBuffer(fontData)) |
| 17 | if err != nil { |
| 18 | log.Fatalln(err) |
| 19 | } |
| 20 | size := im.Bounds().Size() |
| 21 | mask := image.NewRGBA(im.Bounds()) |
| 22 | for y := 0; y < size.Y; y++ { |
| 23 | for x := 0; x < size.X; x++ { |
| 24 | r, _, _, _ := im.At(x, y).RGBA() |
| 25 | if r > 0 { |
| 26 | mask.Set(x, y, color.Opaque) |
| 27 | } |
| 28 | } |
| 29 | } |
| 30 | fontMask = mask |
| 31 | } |
| 32 | |
| 33 | func CreateGenericThumbnail(text string) image.Image { |
| 34 | im := image.NewRGBA(image.Rect(0, 0, 256, 240)) |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…