Documentation
¶
Overview ¶
Package thumbnailer can be used to create a single thumbnail or a series of thumbnail images with the CreateFromLoader() or CreateFromState() functions.
Thumbnailers can be created to run synchronously or asynchronously.
Index ¶
- Constants
- type Thumbnailer
- func (thmb *Thumbnailer) CreateFromLoader(cartload cartridgeloader.Loader, numFrames int)
- func (thmb *Thumbnailer) CreateFromState(state *rewind.State, 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) 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) CreateFromState ¶
func (thmb *Thumbnailer) CreateFromState(state *rewind.State, numFrames int)
CreateFromState will cause images to be returned generated by a running emulation starting from the supplied state. The emulation will run for a number of frames before ending.
See comment for rewind.GetState() about how to use handle rewind.State.
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) String ¶
func (thmb *Thumbnailer) String() string