Documentation ¶
Overview ¶
Package animation contains the functionality to convert an array of images to animations
Index ¶
- Constants
- type FileData
- type Helper
- func (h *Helper) CreateAnimationGif(fData *FileData) (content []byte, err error)
- func (h *Helper) CreateAnimationGifGo(fData *FileData) (content []byte, err error)
- func (h *Helper) CreateAnimationMkv(fData *FileData) (content []byte, err error)
- func (h *Helper) CreateAnimationWebp(fData *FileData) (content []byte, err error)
Constants ¶
const FileFormatGif = ".gif"
FileFormatGif is the file extension for the GIF format
const FileFormatMkv = ".mkv"
FileFormatMkv is the file extension for the MKV format
const FileFormatWebp = ".webp"
FileFormatWebp is the file extension for the WEBP format
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileData ¶
type FileData struct { Frames [][]byte MsDelays []int FilePaths []string PreviousPath string WorkPath string ConvertedFrames bool }
FileData is the object to create and handle possible steps during the animation creation process f.e. in case frames have to get converted to a different file format
type Helper ¶
type Helper struct {
// contains filtered or unexported fields
}
Helper contains the output settings and encapsulates the animation creation functions
func NewAnimationHelper ¶
func NewAnimationHelper() *Helper
NewAnimationHelper returns a Helper struct with the default settings
func (*Helper) CreateAnimationGif ¶
CreateAnimationGif creates a .gif (Graphics Interchange Format) file from the passed fileData. If ImageMagick GIF creation fails we use a fallback method to retrieve a lower quality gif made with golang libraries
func (*Helper) CreateAnimationGifGo ¶
CreateAnimationGifGo is a fallback function to create a GIF file with the golang image libraries quality suffers a lot (256 colors max f.e.), so ImageMagick conversion would be preferable
func (*Helper) CreateAnimationMkv ¶
CreateAnimationMkv tries to create an .mkv video with the passed file data using ImageMagick