Documentation ¶
Overview ¶
Package decoder is responsible for split the video or gif to frames
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface { // Decode decode a file into multi frames Decode(r io.Reader, progress chan<- int) (frames []image.Image, err error) DecodeFromFile(filename string, progress chan<- int) (frames []image.Image, err error) }
Decoder interface define the basic operation to decode the gif or video
func NewDecoder ¶
NewDecoder is factory method to create the player base on file type
type GifDecoder ¶
type GifDecoder struct { }
GifDecoder responsible for decoding the gif and implement the Decoder interface
func (*GifDecoder) Decode ¶
func (gifDecoder *GifDecoder) Decode(reader io.Reader, progress chan<- int) (frames []image.Image, err error)
Decode for GifDeCoder decode the gif file to multi frames
func (*GifDecoder) DecodeFromFile ¶
func (gifDecoder *GifDecoder) DecodeFromFile(gifFilename string, progress chan<- int) (frames []image.Image, err error)
DecodeFromFile decode the gif file by filename to multi frames
type ImageDecoder ¶
type ImageDecoder struct { }
ImageDecoder is responsible for decoding image
func (*ImageDecoder) Decode ¶
func (decoder *ImageDecoder) Decode(reader io.Reader, progress chan<- int) (frames []image.Image, err error)
Decode for ImageDecoder decoding a image and return a frame slice that only contain one frame.
func (*ImageDecoder) DecodeFromFile ¶
func (decoder *ImageDecoder) DecodeFromFile(filename string, progress chan<- int) (frames []image.Image, err error)
DecodeFromFile decode the file to frames by filename
Click to show internal directories.
Click to hide internal directories.