Skip to content
Brian Chirls edited this page Jan 16, 2015 · 11 revisions

Seriously

A Seriously object stores and manages a network of nodes to be used in a composition and is used to create new nodes.

Constructor

Seriously(options)

Parameters:

  • options (object): An object containing additional option fields. (optional)
    • defaults: An object containing default values for each type of node. Each node created in this composition will use the default input parameter values given in this object.

Examples:

Create a composition. Most of the time, options will be unnecessary.

    var seriously = new Seriously();

Setting default input values for given node types. Any blend nodes created will have sizeMode set to 'intersection' by default (the original default value is "bottom").

    var seriously = new Seriously({
        blend: {
            sizeMode: 'intersection'
        }
    });

Methods

effect(hook, options)

Create a new effect node

Parameters:

  • hook (string): identifier of type of effect to create. Throws error if effect is not found.
  • options (object): Additional fields to be passed to effect plugin. (optional)

Returns:

A new Effect object

source(source, options)

Wraps an input source in a Source node object that can be connected to the network.

Parameters:

  • source: Identifies the object to be used as input source. Any of the following types:
    • DOMElement: <canvas>, <img> or <video> DOM element
    • string: CSS query string pointing to a <canvas>, <img> or <video> DOM element.
    • ImageData: An object returned by getImageData from a 2D canvas context
    • Array: An array of pixel components arranged as red, green, blue, alpha. Array length must be height x width x 4. width and height must be specified in options parameter, otherwise throws an error.
  • options: An object containing additional option fields. (optional)
    • width: width of source image in pixels.
    • height: height of source image in pixels.
    • flip: boolean value specifying whether image should be flipped vertically. default is false Throws an error if source parameter is missing or of unknown type.

Returns:

A new Source object

If source is called twice with the same object, the second call will return a reference to the first object created.

    var video, seriously, source1, source2;
    
    seriously = Seriously();
    video = document.getElementById('video');
    source1 = seriously.source(video);
    source2 = seriously.source('#video');
    
    source1 === source2; // true!

transform

target

aliases

removeAlias

defaults

go

stop

render

destroy

isDestroyed

incompatible

isNode

isSource

isEffect

isTransform

isTarget

Properties

id

Utilities

The following functions and objects are properties of the global Seriously object.

incompatible

plugin

removePlugin

source

removeSource

transform

removeTransform

target

removeTarget

inputValidators

effects

logger

util

Clone this wiki locally