Built-in Extensions

moviemaker2.ext.multid

class moviemaker2.ext.multid.Multid(target, stack, values, p)[source]
__init__(target, stack, values, p)[source]

values is an iterable. There will be as many layers superimposed as there are items in values. p is used to store the values from values. For each value, an Extension is generated, with that value, which is appended to the stack on call time. target is the supplier of layers called for each value by one of the Extensions.

__call__(ps)[source]

moviemaker2.ext.render

class moviemaker2.ext.render.Render(fn)[source]

Runs the rendering. Initially supported timelines are 'realtime' and 'frametime'.

__init__(fn)[source]
  • fn is the supplier of PIL images.
__call__(framerate, directory, extension=None, prefix=None, nthreads=None, startrealtime=None, stoprealtime=None, startframetime=None, stopframetime=None, render_queue=None, framestep=None)[source]
  • framerate is fps.
  • directory is the output directory, extension the filename extension. prefix will be prepended to the filename.
  • Rendering will use nthreads threads.
  • Times can be given either by frametime or by realtime. The frametimes given have precedence over the realtimes given.
  • render_queue is optional, giving a capsule where to post progress.
  • args and kwargs are handed over to the Layer this BoundRenderLayer was bound to upon initialisation time.
  • During rendering, the frametime is stepped with framestep.

Renders to HDD and puts ImageCapsules into render_queue if given.

moviemaker2.ext.render_capsules

Capsules to be used with rendering.

class moviemaker2.ext.render_capsules.AnnounceCapsule(nframes)[source]

Holds the number of frames to be rendered.

__init__(nframes)[source]

nframes is the number of frames to be rendered. shape is the shape of the images transferred later.

class moviemaker2.ext.render_capsules.ResultCapsule(image, frameindex, error=None)[source]

Holds an image and its frameindex.

__init__(image, frameindex, error=None)[source]

image is a PIL image representing a frame resulting from rendering. frameidx is the index of the frame, always starting with 0. error (boolean) tells if there was an error.

moviemaker2.ext.tk

class moviemaker2.ext.tk.RenderFrame(master, nbins=None, *frame_args, **frame_kwargs)[source]

A Tkinter.Frame which can render events with graphical feedback. The .start() method must be called once to start the polling mechanism.

Use the .render_queue as argument to a Renderer’s .render() method.

__init__(master, nbins=None, *frame_args, **frame_kwargs)[source]

nbins is the number of sections used for the status bar. frame_args and frame_kwargs go to the Frame class.

setup(nslots)[source]

Sets the slots and bin number. nslots is the number of frames to be rendered. nbins should be some reasonably smaller number.

start()[source]

Starts the polling mechanism essential for visual feedback.

poll()[source]

Grabs all items from the .render_queue, displays the latest frame, and enables all frames’ status slot.

Will poll again after 100 ms.

class moviemaker2.ext.tk.StatusBar(master, nbins=None, *frame_args, **frame_kwargs)[source]

Creates a widget with lots of Labels to display progress in a multithreaded rendering program.

__init__(master, nbins=None, *frame_args, **frame_kwargs)[source]

nbins is the number of bins to use. For each bin, a Label will be created (at least 1px wide). All other args and kwargs go to Frame.

setup(nslots)[source]

Setup the StatusBar. If nbins > nslots, nbins is set to nslots.

enable(slot)[source]

Turns on the label with index slot.

check_set_green()[source]

Checks if the process is finished.

error(slot)[source]

Signals an error in slot SLOT.

Table Of Contents

Previous topic

moviemaker2.transforms

This Page