thumbnailer

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2023 License: GPL-3.0, GPL-3.0 Imports: 19 Imported by: 0

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

View Source
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

type Thumbnailer struct {
	Render chan *image.RGBA
	// contains filtered or unexported fields
}

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

Jump to

Keyboard shortcuts

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