video config construction refactoring
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package video
|
||||
|
||||
import (
|
||||
"mxl-pattern-generator/internal/flowdef"
|
||||
|
||||
"github.com/qvest-digital/go-mxl/mxl"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Definition flowdef.Video
|
||||
Pattern string
|
||||
}
|
||||
|
||||
func (c Config) ID() string {
|
||||
return c.Definition.ID
|
||||
}
|
||||
|
||||
func (c Config) Width() uint {
|
||||
return c.Definition.FrameWidth
|
||||
}
|
||||
|
||||
func (c Config) Height() uint {
|
||||
return c.Definition.FrameHeight
|
||||
}
|
||||
|
||||
func (c Config) Rate() mxl.Rational {
|
||||
return mxl.Rational{
|
||||
Num: int64(c.Definition.GrainRate.Numerator),
|
||||
Den: int64(c.Definition.GrainRate.Denominator),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user