writer2

package
v0.0.0-...-c131409 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2019 License: MIT Imports: 11 Imported by: 3

Documentation

Overview

Package writer create SSA/ASS Subtitle Script

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DummyVideo

func DummyVideo(framerate float64, w, h int, hexc string, cb bool, timeS int) string

DummyVideo blank video file.

Types

type Dialog

type Dialog struct {
	Layer     int
	Start     string
	End       string
	StyleName string
	Actor     string
	Effect    string
	Text      string
	Tags      string
	Comment   bool
}

Dialog Represent the subtitle"s lines.

func NewDialog

func NewDialog(text string) *Dialog

NewDialog create a new Dialog Struct with defaults

type Script

type Script struct {
	Dialog             []*Dialog
	Style              map[string]*Style
	Comment            string
	Resolution         [2]int // WIDTH, HEIGHT map[string]string
	VideoPath          string
	VideoZoom          float64
	VideoPosition      int
	VideoAR            float64
	MetaFilename       string
	MetaTitle          string
	MetaOriginalScript string
	MetaTranslation    string
	MetaTiming         string
	Audio              string
}

Script SSA/ASS Subtitle Script.

func NewScript

func NewScript() *Script

NewScript create a new Script Struct with defaults

func (*Script) AddDialog

func (s *Script) AddDialog(d *Dialog)

AddDialog add a Dialog to SSA/ASS Script.

func (*Script) AddStyle

func (s *Script) AddStyle(sty *Style)

AddStyle add a Style to SSA/ASS Script.

func (*Script) Save

func (s *Script) Save(fn string)

Save write an SSA/ASS Subtitle Script.

func (*Script) String

func (s *Script) String() string

String get the generated SSA/ASS Script as a String

type Style

type Style struct {
	Name      string
	FontName  string
	FontSize  int
	Color     [4]*color.Color //Primary, Secondary, Bord, Shadow
	Bold      bool
	Italic    bool
	Underline bool
	StrikeOut bool
	Scale     [2]float64 // WIDTH, HEIGHT map[string]string
	Spacing   float64
	Angle     int
	OpaqueBox bool
	Bord      float64
	Shadow    float64
	Alignment int
	Margin    [3]int // L, R, V map[string]string
	Encoding  int
}

Style represent subtitle"s styles.

func NewStyle

func NewStyle(name string) *Style

NewStyle create a new Style Struct with defaults

Jump to

Keyboard shortcuts

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