animation

package
v1.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package animation contains the functionality to convert an array of images to animations

Index

Constants

View Source
const FileFormatGif = ".gif"

FileFormatGif is the file extension for the GIF format

View Source
const FileFormatMkv = ".mkv"

FileFormatMkv is the file extension for the MKV format

View Source
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

func (h *Helper) CreateAnimationGif(fData *FileData) (content []byte, err error)

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

func (h *Helper) CreateAnimationGifGo(fData *FileData) (content []byte, err error)

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

func (h *Helper) CreateAnimationMkv(fData *FileData) (content []byte, err error)

CreateAnimationMkv tries to create an .mkv video with the passed file data using ImageMagick

func (*Helper) CreateAnimationWebp

func (h *Helper) CreateAnimationWebp(fData *FileData) (content []byte, err error)

CreateAnimationWebp tries create a .webp animated picture from the passed file data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL