Documentation
¶
Index ¶
- Constants
- func ContainSoundData(soundData audio.L8) []byte
- func Write(dest io.Writer, container Container, cp text.Codepage) error
- type Audio
- type Cache
- func (cache *Cache) Audio(key resource.Key) (sound audio.L8, err error)
- func (cache *Cache) Container(key resource.Key) (Container, error)
- func (cache *Cache) InvalidateResources(ids []resource.ID)
- func (cache *Cache) SizeWarning(key resource.Key) bool
- func (cache *Cache) Subtitles(key resource.Key, language resource.Language) (SubtitleList, error)
- func (cache *Cache) Video(key resource.Key) ([]Scene, error)
- type Container
- type Frame
- type HighResFrame
- type HighResScene
- type Scene
- type Subtitle
- type SubtitleList
- type Subtitles
- type Video
Constants ¶
const ( HighResDefaultWidth = 600 HighResDefaultHeight = 300 )
Constants for video.
Variables ¶
This section is empty.
Functions ¶
func ContainSoundData ¶
ContainSoundData packs a sound data into a container and encodes it.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache retrieves movie container from a localizer and keeps them decoded until they are invalidated.
func (*Cache) Container ¶ added in v1.4.0
Container retrieves and caches the underlying movie, and returns the complete container.
func (*Cache) InvalidateResources ¶
InvalidateResources lets the cache remove any movies from resources that are specified in the given slice.
func (*Cache) SizeWarning ¶ added in v1.4.0
SizeWarning returns true if the given movie is cached and is larger than the underlying archive would support.
type HighResFrame ¶ added in v1.4.0
type HighResFrame struct {
// contains filtered or unexported fields
}
HighResFrame contains the compressed information of a high-resolution picture in a scene.
func (HighResFrame) WithDisplayTime ¶ added in v1.4.0
func (frame HighResFrame) WithDisplayTime(displayTime time.Duration) HighResFrame
WithDisplayTime returns a new instance with the given display time set.
type HighResScene ¶ added in v1.4.0
type HighResScene struct {
// contains filtered or unexported fields
}
HighResScene is a set of frames with high-resolution compression.
func HighResSceneFrom ¶ added in v1.4.0
HighResSceneFrom compresses given scene and returns the compression result.
func (HighResScene) WithFrameDisplayTime ¶ added in v1.4.0
func (scene HighResScene) WithFrameDisplayTime(displayTime time.Duration) HighResScene
WithFrameDisplayTime returns a new scene instance with the given display time set for all frames.
type Scene ¶ added in v1.4.0
Scene describes a series of frames that share a common palette. Ideally, they also share the same framerate.
type SubtitleList ¶ added in v1.4.0
type SubtitleList struct {
Entries []Subtitle
}
SubtitleList describes the textual representation of a movie in one language.
type Subtitles ¶ added in v1.4.0
type Subtitles struct {
PerLanguage [resource.LanguageCount]SubtitleList
}
Subtitles contains all the subtitles in all languages.
func (Subtitles) ArePresent ¶ added in v1.4.0
ArePresent returns true if at least one language makes use of subtitles.
type Video ¶ added in v1.4.0
type Video struct { // Width is the width of the video in pixel. Width uint16 // Height is the height of the video in pixel. Height uint16 // Scenes contain the frames of the video. Scenes []HighResScene }
Video describes the visual part of a movie.
func (Video) Decompress ¶ added in v1.4.0
Decompress unpacks all the frames of all scenes.
func (Video) StartPalette ¶ added in v1.4.0
StartPalette returns the palette of the first scene. If no scene is present, a black palette is returned.