mirror of
https://github.com/gen2brain/cam2ip.git
synced 2025-12-16 04:18:39 +00:00
Add support for native V4L implementation on Linux/RPi
This commit is contained in:
26
image/decode.go
Normal file
26
image/decode.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// +build !jpeg
|
||||
|
||||
// Package image.
|
||||
package image
|
||||
|
||||
import (
|
||||
"image"
|
||||
"io"
|
||||
|
||||
jpeg "github.com/antonini/golibjpegturbo"
|
||||
)
|
||||
|
||||
// NewDecoder returns a new Decoder.
|
||||
func NewDecoder(r io.Reader) *Decoder {
|
||||
return &Decoder{r}
|
||||
}
|
||||
|
||||
// Decoder struct.
|
||||
type Decoder struct {
|
||||
r io.Reader
|
||||
}
|
||||
|
||||
// Decode decodes image from JPEG.
|
||||
func (d Decoder) Decode() (image.Image, error) {
|
||||
return jpeg.Decode(d.r)
|
||||
}
|
||||
Reference in New Issue
Block a user