Documentation ¶
Overview ¶
Package thumbnailer can be used to create either a series of thumbnail images or a single thumbnail image with the CreateFromLoader() and SingleFrameFromRewindState() functions respsectively.
The CreateFromLodaer() function will run asynchronously and is good for generating just the images from a new emulation.
The SingleFrameFromRewindState() function meanwhile, is more limited and is used to generate a single TV frame starting from the supplied rewind state.
Index ¶
- Constants
- type Thumbnailer
- func (thmb *Thumbnailer) CreateFromLoader(cartload cartridgeloader.Loader, numFrames int)
- func (thmb *Thumbnailer) EndCreation()
- func (thmb *Thumbnailer) EndRendering() error
- func (thmb *Thumbnailer) IsEmulating() bool
- func (thmb *Thumbnailer) NewFrame(frameInfo television.FrameInfo) error
- func (thmb *Thumbnailer) NewScanline(scanline int) error
- func (thmb *Thumbnailer) Reset()
- func (thmb *Thumbnailer) Resize(frameInfo television.FrameInfo) error
- func (thmb *Thumbnailer) SetPixels(sig []signal.SignalAttributes, last int) error
- func (thmb *Thumbnailer) SingleFrameFromRewindState(state *rewind.State)
- func (thmb *Thumbnailer) String() string
Constants ¶
const UndefinedNumFrames = -1
UndefinedNumFrames indicates the that the thumbnailing emulation should run until it is explicitely stopped with the EndCreation() function (or implicitely with a second call to Create())
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Thumbnailer ¶
Thumbnailer type handles the emulation necessary for thumbnail image generation.
func NewThumbnailer ¶
func NewThumbnailer(prefs *preferences.Preferences) (*Thumbnailer, error)
NewThumbnailer is the preferred method of initialisation for the Thumbnailer type.
func (*Thumbnailer) CreateFromLoader ¶
func (thmb *Thumbnailer) CreateFromLoader(cartload cartridgeloader.Loader, numFrames int)
CreateFromLoader will cause images to be generated by a running emulation initialised with the specified cartridge loader. The emulation will run for a number of frames before ending.
func (*Thumbnailer) EndCreation ¶
func (thmb *Thumbnailer) EndCreation()
EndCreation ends a running emulation that is creating a stream of thumbnails. Safe to use even when no emulation is running.
func (*Thumbnailer) EndRendering ¶
func (thmb *Thumbnailer) EndRendering() error
EndRendering implements the television.PixelRenderer interface.
func (*Thumbnailer) IsEmulating ¶
func (thmb *Thumbnailer) IsEmulating() bool
IsEmulating returns true if the thumbnail emulator is working. Useful for testing whether the cartridgeloader was an emulatable file.
func (*Thumbnailer) NewFrame ¶
func (thmb *Thumbnailer) NewFrame(frameInfo television.FrameInfo) error
NewFrame implements the television.PixelRenderer interface.
func (*Thumbnailer) NewScanline ¶
func (thmb *Thumbnailer) NewScanline(scanline int) error
NewScanline implements the television.PixelRenderer interface.
func (*Thumbnailer) Reset ¶
func (thmb *Thumbnailer) Reset()
Reset implements the television.PixelRenderer interface.
func (*Thumbnailer) Resize ¶
func (thmb *Thumbnailer) Resize(frameInfo television.FrameInfo) error
Resize implements the television.PixelRenderer interface.
func (*Thumbnailer) SetPixels ¶
func (thmb *Thumbnailer) SetPixels(sig []signal.SignalAttributes, last int) error
SetPixels implements the television.PixelRenderer interface.
func (*Thumbnailer) SingleFrameFromRewindState ¶ added in v0.17.0
func (thmb *Thumbnailer) SingleFrameFromRewindState(state *rewind.State)
SingleFrameFromRewindState will run the thumbnailer emulation for a single frame using the state from another emultion as a starting point.
The function must be called in the same goroutine as the emulation that generated the rewind.State.
func (*Thumbnailer) String ¶
func (thmb *Thumbnailer) String() string