pgs

package
v0.0.0-...-3302ff9 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompositionObject

type CompositionObject struct {
	ObjectID uint16
	WindowID uint8
	X, Y     uint16 // Offset from the top left pixel of the screen
	Crop     *CompositionObjectCrop
}

type CompositionObjectCrop

type CompositionObjectCrop struct {
	// Offset of the cropped object from the top left pixel of the screen
	X, Y          uint16
	Width, Height uint16 // Dimensions of the cropped object
}

type CompositionState

type CompositionState uint8
const (
	// Epoch Start defines a new display. The Epoch Start contains all
	// functional segments needed to display a new composition on the
	// screen.
	EpochStart CompositionState = 0x80
	// Acquisition Point defines a display refresh. This is used to
	// compose in the middle of the Epoch. It includes functional segments
	// with new objects to be used in a new composition, replacing old
	// objects with the same Object ID.
	AcquisitionPoint CompositionState = 0x40
	// Normal defines a display update, and contains only functional
	// segments with elements that are different from the preceding
	// composition. It’s mostly used to stop displaying objects on the
	// screen by defining a composition with no composition objects (a
	// value of zero in the Number of Composition Objects flag) but also
	// used to define a new composition with new objects and objects
	// defined since the Epoch Start.
	Normal CompositionState = 0x00
)

The composition state can be one of three values

type DisplaySet

type DisplaySet struct {
	PresentationTime time.Duration
	DecodingTime     time.Duration
	PresentationComposition
	Windows []Window
	Palette *Palette
	Object  *Object
}

type Image

type Image struct {
	Width, Height uint16 // Dimensions
	Data          []byte
}

func (*Image) Convert

func (img *Image) Convert(p *Palette) (*image.Paletted, error)

func (Image) String

func (img Image) String() string

type Object

type Object struct {
	ID          uint16 // ID of this object
	Version     uint8  // Version of this object
	First, Last bool
	Image
}

type Palette

type Palette struct {
	ID      uint8
	Version uint8
	Entries []PaletteEntry
}

func (*Palette) String

func (p *Palette) String() string

type PaletteEntry

type PaletteEntry struct {
	ID uint8 // Entry number of the palette
	color.NYCbCrA
}

func (PaletteEntry) String

func (pe PaletteEntry) String() string

type PresentationComposition

type PresentationComposition struct {
	Width, Height     uint16 // Video dimensions in pixels
	FrameRate         uint8  // Always 0x10; can be ignored
	CompositionNumber uint16
	CompositionState  CompositionState // Type of this composition
	PaletteUpdate     bool
	PaletteID         uint8
	Objects           []CompositionObject
}

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.Reader) *Reader

func (*Reader) Read

func (r *Reader) Read() (*DisplaySet, error)

func (*Reader) ReadAll

func (r *Reader) ReadAll() ([]DisplaySet, error)

type SegmentType

type SegmentType uint8
const (
	PCSType SegmentType = 0x16 // Presentation Composition Segment
	WDSType SegmentType = 0x17 // Window Definition Segment
	PDSType SegmentType = 0x14 // Palette Definition Segment
	ODSType SegmentType = 0x15 // Object Definition Segment
	ENDType SegmentType = 0x80 // End of Display Set Segment
)

func (SegmentType) String

func (typ SegmentType) String() string

type Window

type Window struct {
	ID            uint8
	X, Y          uint16
	Width, Height uint16
}

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(w io.Writer) *Writer

func (*Writer) Write

func (w *Writer) Write(ds *DisplaySet) error

func (*Writer) WriteAll

func (w *Writer) WriteAll(stream []DisplaySet) error

Jump to

Keyboard shortcuts

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