thumbnailer

package
v0.35.3 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: GPL-3.0 Imports: 22 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 Anim added in v0.23.0

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

Anim type handles the emulation necessary for thumbnail image generation.

func NewAnim added in v0.23.0

func NewAnim(prefs *preferences.Preferences, spec string) (*Anim, error)

NewAnim is the preferred method of initialisation for the Anim type

func (*Anim) Create added in v0.23.0

func (thmb *Anim) Create(cartload cartridgeloader.Loader, spec string, numFrames int)

Create 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

Returns when the preview has completed (so PreviewResults() is safe to call once the function has returned)

func (*Anim) EndCreation added in v0.23.0

func (thmb *Anim) EndCreation()

EndCreation ends a running emulation that is creating a stream of thumbnails. Safe to use even when no emulation is running

func (*Anim) EndRendering added in v0.23.0

func (thmb *Anim) EndRendering() error

EndRendering implements the television.PixelRenderer interface

func (*Anim) IsEmulating added in v0.23.0

func (thmb *Anim) IsEmulating() bool

IsEmulating returns true if the thumbnail emulator is working. Useful for testing whether the cartridgeloader was an emulatable file

func (*Anim) NewFrame added in v0.23.0

func (thmb *Anim) NewFrame(frameInfo television.FrameInfo) error

NewFrame implements the television.PixelRenderer interface

func (*Anim) NewScanline added in v0.23.0

func (thmb *Anim) NewScanline(scanline int) error

NewScanline implements the television.PixelRenderer interface

func (*Anim) Notify added in v0.30.0

func (thmb *Anim) Notify(notice notifications.Notice) error

Notify implements the notifications.Notify interface

func (*Anim) Reset added in v0.23.0

func (thmb *Anim) Reset()

Reset implements the television.PixelRenderer interface

func (*Anim) SetPixels added in v0.23.0

func (thmb *Anim) SetPixels(sig []signal.SignalAttributes, last int) error

SetPixels implements the television.PixelRenderer interface

func (*Anim) String added in v0.23.0

func (thmb *Anim) String() string

func (*Anim) UpdateResults added in v0.32.0

func (thmb *Anim) UpdateResults() *preview.Results

UpdateResults returns the more recent results of the preview emulation

type Image added in v0.23.0

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

Image type handles the emulation necessary for thumbnail image generation.

func NewImage added in v0.23.0

func NewImage(prefs *preferences.Preferences, spec string) (*Image, error)

NewImage is the preferred method of initialisation for the Image type

func (*Image) CartYield added in v0.25.0

CartYield implements the coprocessor.CartYieldHook interface.

func (*Image) Create added in v0.23.0

func (thmb *Image) Create(state *rewind.State)

Create 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 (*Image) EndRendering added in v0.23.0

func (thmb *Image) EndRendering() error

EndRendering implements the television.PixelRenderer interface

func (*Image) NewFrame added in v0.23.0

func (thmb *Image) NewFrame(frameInfo television.FrameInfo) error

NewFrame implements the television.PixelRenderer interface

func (*Image) NewScanline added in v0.23.0

func (thmb *Image) NewScanline(scanline int) error

NewScanline implements the television.PixelRenderer interface

func (*Image) Reset added in v0.23.0

func (thmb *Image) Reset()

Reset implements the television.PixelRenderer interface

func (*Image) SetPixels added in v0.23.0

func (thmb *Image) SetPixels(sig []signal.SignalAttributes, last int) error

SetPixels implements the television.PixelRenderer interface

func (*Image) String added in v0.23.0

func (thmb *Image) String() string

Jump to

Keyboard shortcuts

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