Files
sago35 f2e5278965 image: add support for image/jpeg and image/png (#303)
* Copy from go1.17 image package
* Remove unnecessary files
* Reduce memory usage
* Add examples/ili9341/slideshow
* image: add ./image/README.md
* image: change convert2bin to . /cmd
* Makefile: add ./cmd to NOTEST
2021-09-18 12:18:02 +02:00

18 lines
553 B
Go

package png
var (
callback Callback = func(data []uint16, x, y, w, h, width, height int16) {}
callbackBuf []uint16
)
// A portion of the image data consisting of data, x, y, w, and h is passed to
// Callback. The size of the whole image is passed as width and height.
type Callback func(data []uint16, x, y, w, h, width, height int16)
// SetCallback registers the buffer and fn required for Callback. Callback can
// be called multiple times by calling Decode().
func SetCallback(buf []uint16, fn Callback) {
callbackBuf = buf
callback = fn
}