tinygo.org/x/drivers@v0.27.1-0.20240509133757-7dbca2a54349/image/png/callback.go (about) 1 package png 2 3 var ( 4 callback Callback = func(data []uint16, x, y, w, h, width, height int16) {} 5 callbackBuf []uint16 6 ) 7 8 // A portion of the image data consisting of data, x, y, w, and h is passed to 9 // Callback. The size of the whole image is passed as width and height. 10 type Callback func(data []uint16, x, y, w, h, width, height int16) 11 12 // SetCallback registers the buffer and fn required for Callback. Callback can 13 // be called multiple times by calling Decode(). 14 func SetCallback(buf []uint16, fn Callback) { 15 callbackBuf = buf 16 callback = fn 17 }