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:
sago35
2021-09-18 19:18:02 +09:00
committed by GitHub
parent 259593e608
commit f2e5278965
52 changed files with 19324 additions and 1 deletions
+19
View File
@@ -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
}