Documentation ¶
Index ¶
- Constants
- func CreateImage(pixels [][]uint8, palettes [256]PaletteDefinition) (*image.RGBA, error)
- func FormatMilliseconds(ts uint32) string
- func GetImageBytesJPEG(img *image.RGBA) ([]byte, error)
- func RLEDecode(bytes []byte) ([][]uint8, error)
- func RunOCR(ocr *gosseract.Client, img []byte) (string, error)
- type CompositionObject
- type DisplaySet
- func (d *DisplaySet) AppendSRT(ocr *gosseract.Client, f *os.File, i uint, ets string) error
- func (d *DisplaySet) IsEpochEnd() bool
- func (d *DisplaySet) IsEpochStart() bool
- func (d *DisplaySet) OCR(ocr *gosseract.Client) (string, error)
- func (d *DisplaySet) Print()
- func (d *DisplaySet) StartTS() string
- type ObjectData
- type PGS
- type PaletteData
- type PaletteDefinition
- type PresentationCompositionData
- type Section
- type SectionData
- type WindowDefinition
- type WindowsData
Constants ¶
View Source
const ( PDS uint8 = 0x14 // Palettes definition ODS uint8 = 0x15 // Object definition PCS uint8 = 0x16 // Presentation composition WDS uint8 = 0x17 // Windows definition END uint8 = 0x80 )
View Source
const CompositionObjectExtendedSize = 16
View Source
const CompositionObjectSize = 8
View Source
const JSONIndent = " "
View Source
const MagicBytes = "PG" // 0x5047
View Source
const ObjectMinSize = 7
View Source
const PaletteSize = 5
View Source
const PresentationCompositionSize = 11
View Source
const SegmentHeaderSize = 13
View Source
const TimestampAccuracy = 90 // Hz
View Source
const WindowDefinitionSize = 9
Variables ¶
This section is empty.
Functions ¶
func CreateImage ¶
func CreateImage(pixels [][]uint8, palettes [256]PaletteDefinition) (*image.RGBA, error)
func FormatMilliseconds ¶
Types ¶
type CompositionObject ¶
type CompositionObject struct { ObjID uint16 WinID uint8 Cropped uint8 Hpos uint16 Vpos uint16 HCropPos uint16 VCropPos uint16 CropWidth uint16 CropHeight uint16 }
func NewCompositionObject ¶
func NewCompositionObject(bytes []byte) (CompositionObject, error)
type DisplaySet ¶
func (*DisplaySet) IsEpochEnd ¶
func (d *DisplaySet) IsEpochEnd() bool
func (*DisplaySet) IsEpochStart ¶
func (d *DisplaySet) IsEpochStart() bool
func (*DisplaySet) OCR ¶
func (d *DisplaySet) OCR(ocr *gosseract.Client) (string, error)
func (*DisplaySet) Print ¶
func (d *DisplaySet) Print()
func (*DisplaySet) StartTS ¶
func (d *DisplaySet) StartTS() string
type ObjectData ¶
type ObjectData struct { ID uint16 Version uint8 Last uint8 Length uint32 // uint24 Width uint16 Height uint16 Data []byte `json:"-"` }
func NewObjectData ¶
func NewObjectData(bytes []byte) (ObjectData, error)
type PGS ¶
type PGS struct {
Sections []DisplaySet
}
func (*PGS) GetSectionEndTimestamp ¶
func (*PGS) PrintDisplaySet ¶
func (*PGS) PrintSectionType ¶
type PaletteData ¶
type PaletteData struct { ID uint8 Version uint8 NumPalettes uint8 Palettes [256]PaletteDefinition `json:"-"` }
func NewPaletteData ¶
func NewPaletteData(bytes []byte) (PaletteData, error)
type PaletteDefinition ¶
type PresentationCompositionData ¶
type PresentationCompositionData struct { Width uint16 Height uint16 Framerate uint8 Num uint16 State uint8 PaletteUpdate uint8 PaletteID uint8 NumComps uint8 Comps []CompositionObject }
func NewPresentationData ¶
func NewPresentationData(bytes []byte) (PresentationCompositionData, error)
type Section ¶
type Section struct { PTS uint32 DTS uint32 Type uint8 Size uint16 Data SectionData }
func NewSection ¶
type SectionData ¶
type SectionData interface{}
type WindowDefinition ¶
type WindowsData ¶
type WindowsData struct { NumWindows uint8 Windows []WindowDefinition }
func NewWindowsData ¶
func NewWindowsData(bytes []byte) (WindowsData, error)
Click to show internal directories.
Click to hide internal directories.