MCPcopy Create free account
hub / github.com/fogleman/nes / init

Function init

ui/font.go:15–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13var fontMask image.Image
14
15func 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
33func CreateGenericThumbnail(text string) image.Image {
34 im := image.NewRGBA(image.Rect(0, 0, 256, 240))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…