mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-16 04:43:25 +00:00
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
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user