- Jump To … +
  analyze.coffee autoload.coffee blender.coffee calculate.coffee caman.coffee convert.coffee event.coffee filter.coffee io.coffee layer.coffee logger.coffee module.coffee pixel.coffee plugin.coffee renderer.coffee store.coffee util.coffee blenders.coffee filters.coffee size.coffee blur.coffee camera.coffee compoundBlur.coffee edges.coffee posterize.coffee presets.coffee rotate.coffee stackBlur.coffee threshold.coffee

- # blender.coffee

- ¶

  Built-in layer blenders. Many of these mimic Photoshop blend modes.

      class Caman.Blender
        @blenders = {}

- ¶

  Registers a blender. Can be used to add your own blenders outside of the core library, if needed.

  @param [String] name Name of the blender. @param [Function] func The blender function.

        @register: (name, func) -> @blenders[name] = func

- ¶

  Executes a blender to combine a layer with its parent.

- ¶

  @param [String] name Name of the blending function to invoke. @param [Object] rgbaLayer RGBA object of the current pixel from the layer. @param [Object] rgbaParent RGBA object of the corresponding pixel in the parent layer. @return [Object] RGBA object representing the blended pixel.

        @execute: (name, rgbaLayer, rgbaParent) ->
          @blenders[name](rgbaLayer, rgbaParent)

      Blender = Caman.Blender