mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-07-26 10:38:41 +00:00
f2e5278965
* 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
20 lines
642 B
Go
20 lines
642 B
Go
package jpeg
|
|
|
|
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.
|
|
// If the callback is not called, add the implementation to
|
|
// image/png.readImagePass.
|
|
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
|
|
}
|