You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For interactive programs, it is useful to be able to decode large images in pieces in order to improve responsiveness. I have implemented a draft version of a "streaming" API which returns Subimages on a go channel if a channel is passed to the jpeg.Decode function. See here:
If no channel is provided, the Decode function should perform as before. This is useful but not fully implemented yet since rgb.Image does not implement the Subimage function that is available for most of the built-in image types (DecodeRGB and DecodeIntoRGB return Subimages with the wrong bounds).
Example:
fd,err := os.Open(filename)
ch := make(chan image.Image)
go func() {
for im := range(ch) {
...
}
}()
i,err := jpeg.Decode(fd,&jpeg.DecoderOptions{},ch)
...
Any thoughts on this implementation are appreciated. Currently it is not possible to specify the number of lines (or max pixels) to return in each Subimage. This could possibly be added as an option in jpeg.DecoderOptions.
The text was updated successfully, but these errors were encountered:
For interactive programs, it is useful to be able to decode large images in pieces in order to improve responsiveness. I have implemented a draft version of a "streaming" API which returns Subimages on a go channel if a channel is passed to the jpeg.Decode function. See here:
https://github.com/gmp216/go-libjpeg/tree/streaming
If no channel is provided, the Decode function should perform as before. This is useful but not fully implemented yet since rgb.Image does not implement the Subimage function that is available for most of the built-in image types (DecodeRGB and DecodeIntoRGB return Subimages with the wrong bounds).
Example:
Any thoughts on this implementation are appreciated. Currently it is not possible to specify the number of lines (or max pixels) to return in each Subimage. This could possibly be added as an option in jpeg.DecoderOptions.
The text was updated successfully, but these errors were encountered: