Documentation ¶
Index ¶
- type Duration
- type Iterator
- type Span
- func (s Span) Add(b Span, fps int) Span
- func (s Span) ApplyFPS(fps int) Span
- func (s Span) Clear() Span
- func (s Span) ContainsFrame(frame int) bool
- func (s Span) Duration() Duration
- func (s Span) End() int
- func (s Span) Length() int
- func (s Span) Move(ns int) Span
- func (s Span) Range() (int, int)
- func (s Span) Start() int
- type TimeCode
- func (tc *TimeCode) ForFrames(count int) *Iterator
- func (tc *TimeCode) FrameNum() int
- func (tc *TimeCode) FrameRate() int
- func (tc *TimeCode) FrameRateF() float64
- func (tc *TimeCode) IsRunning() bool
- func (tc *TimeCode) Next()
- func (tc *TimeCode) Set(s string) (*TimeCode, error)
- func (tc *TimeCode) StartTimeCode() TimeCodeFragment
- func (tc *TimeCode) TimeCode() TimeCodeFragment
- func (tc *TimeCode) Until(s string) (*Iterator, error)
- func (tc *TimeCode) Write(w io.Writer) error
- type TimeCodeFragment
- func (tc TimeCodeFragment) Add(d, h, m, s, f int) TimeCodeFragment
- func (tc TimeCodeFragment) AddFrames(count int) TimeCodeFragment
- func (tc TimeCodeFragment) After(b TimeCodeFragment) bool
- func (tc TimeCodeFragment) Before(b TimeCodeFragment) bool
- func (tc TimeCodeFragment) Day() int
- func (tc TimeCodeFragment) DayF() float64
- func (tc TimeCodeFragment) DayS() string
- func (tc TimeCodeFragment) Equals(b TimeCodeFragment) bool
- func (tc TimeCodeFragment) Frame() int
- func (tc TimeCodeFragment) FrameF() float64
- func (tc TimeCodeFragment) FrameRate() int
- func (tc TimeCodeFragment) FrameRateF() float64
- func (tc TimeCodeFragment) FrameS() string
- func (tc TimeCodeFragment) FramesRemaining() int
- func (tc TimeCodeFragment) Hour() int
- func (tc TimeCodeFragment) HourF() float64
- func (tc TimeCodeFragment) HourS() string
- func (tc TimeCodeFragment) IsStartSecond() bool
- func (tc TimeCodeFragment) Minute() int
- func (tc TimeCodeFragment) MinuteF() float64
- func (tc TimeCodeFragment) MinuteS() string
- func (tc TimeCodeFragment) NotAfter(b TimeCodeFragment) bool
- func (tc TimeCodeFragment) Offset() int
- func (tc TimeCodeFragment) Second() int
- func (tc TimeCodeFragment) SecondF() float64
- func (tc TimeCodeFragment) SecondS() string
- func (tc TimeCodeFragment) TimeCode() string
- func (tc TimeCodeFragment) Write(w io.Writer) error
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Duration ¶
func ParseDuration ¶
type Iterator ¶
type Iterator struct {
// contains filtered or unexported fields
}
Iterator is returned by TimeCode for advancing it for a set period. Each call to Next() will advance the TimeCode.
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
func (Span) Clear ¶
Clear returns a Span which starts where this one does but ends at the same position. Duration will be reset but set to the same unit as the source.
func (Span) ContainsFrame ¶
type TimeCode ¶
type TimeCode struct {
// contains filtered or unexported fields
}
TimeCode handles the management of Timecodes during an animation
func NewTimeCode ¶
NewTimeCode creates a TimeCode with the specified frame rate
func (*TimeCode) FrameNum ¶
FrameNum is the overall frame number, starting at 1. This can be used when forming file names for individual frame images
func (*TimeCode) FrameRateF ¶
func (*TimeCode) IsRunning ¶
IsRunning returns true if the TimeCode is running. Specifically once a frame has been rendered it is running.
func (*TimeCode) Set ¶
Set sets the starting TimeCode. This is in the format "hh:mm:ss:ff" although a short form "hh:mm:ss" is valid in which case ff will be 0.
This will return an error if the TimeCode has been used for a frame, e.g. Next() has been called.
func (*TimeCode) StartTimeCode ¶
func (tc *TimeCode) StartTimeCode() TimeCodeFragment
StartTimeCode returns the time code of the first frame
func (*TimeCode) TimeCode ¶
func (tc *TimeCode) TimeCode() TimeCodeFragment
TimeCode returns the time code for the current frame
type TimeCodeFragment ¶
type TimeCodeFragment struct {
// contains filtered or unexported fields
}
func ParseTimeCode ¶
func ParseTimeCode(s string, frameRate int) (TimeCodeFragment, error)
func ReadTimeCodeFragment ¶
func ReadTimeCodeFragment(r io.Reader) (TimeCodeFragment, error)
func (TimeCodeFragment) Add ¶
func (tc TimeCodeFragment) Add(d, h, m, s, f int) TimeCodeFragment
func (TimeCodeFragment) AddFrames ¶
func (tc TimeCodeFragment) AddFrames(count int) TimeCodeFragment
func (TimeCodeFragment) After ¶
func (tc TimeCodeFragment) After(b TimeCodeFragment) bool
func (TimeCodeFragment) Before ¶
func (tc TimeCodeFragment) Before(b TimeCodeFragment) bool
func (TimeCodeFragment) Day ¶
func (tc TimeCodeFragment) Day() int
func (TimeCodeFragment) DayF ¶
func (tc TimeCodeFragment) DayF() float64
func (TimeCodeFragment) DayS ¶
func (tc TimeCodeFragment) DayS() string
DayS returns the hour component as a 2 digit string, useful in rendering
func (TimeCodeFragment) Equals ¶
func (tc TimeCodeFragment) Equals(b TimeCodeFragment) bool
func (TimeCodeFragment) Frame ¶
func (tc TimeCodeFragment) Frame() int
Frame returns the frame within the current second
func (TimeCodeFragment) FrameF ¶
func (tc TimeCodeFragment) FrameF() float64
func (TimeCodeFragment) FrameRate ¶
func (tc TimeCodeFragment) FrameRate() int
FrameRate of the clip
func (TimeCodeFragment) FrameRateF ¶
func (tc TimeCodeFragment) FrameRateF() float64
func (TimeCodeFragment) FrameS ¶
func (tc TimeCodeFragment) FrameS() string
FrameS returns the frame component as a 2 digit string, useful in rendering
func (TimeCodeFragment) FramesRemaining ¶
func (tc TimeCodeFragment) FramesRemaining() int
FramesRemaining returns the number of frames remaining in the current second. This is simply frameRate - frame.
func (TimeCodeFragment) Hour ¶
func (tc TimeCodeFragment) Hour() int
Hour returns the hour component as an int
func (TimeCodeFragment) HourF ¶
func (tc TimeCodeFragment) HourF() float64
func (TimeCodeFragment) HourS ¶
func (tc TimeCodeFragment) HourS() string
HourS returns the hour component as a 2 digit string, useful in rendering
func (TimeCodeFragment) IsStartSecond ¶
func (tc TimeCodeFragment) IsStartSecond() bool
IsStartSecond returns true if the current frame is the first of a whole second.
func (TimeCodeFragment) Minute ¶
func (tc TimeCodeFragment) Minute() int
Minute returns the minute component as an int
func (TimeCodeFragment) MinuteF ¶
func (tc TimeCodeFragment) MinuteF() float64
func (TimeCodeFragment) MinuteS ¶
func (tc TimeCodeFragment) MinuteS() string
MinuteS returns the minute component as a 2 digit string, useful in rendering
func (TimeCodeFragment) NotAfter ¶
func (tc TimeCodeFragment) NotAfter(b TimeCodeFragment) bool
func (TimeCodeFragment) Offset ¶
func (tc TimeCodeFragment) Offset() int
Offset returns the number of seconds since "00:00:00" for the clip
func (TimeCodeFragment) Second ¶
func (tc TimeCodeFragment) Second() int
Second returns the second component as an int
func (TimeCodeFragment) SecondF ¶
func (tc TimeCodeFragment) SecondF() float64
func (TimeCodeFragment) SecondS ¶
func (tc TimeCodeFragment) SecondS() string
SecondS returns the second component as a 2 digit string, useful in rendering
func (TimeCodeFragment) TimeCode ¶
func (tc TimeCodeFragment) TimeCode() string