Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Kernel

Kernel

Core Image Kernel

see

Filter

Hierarchy

  • Kernel

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Kernel(source: string): Kernel
  • new Kernel(source: string): Kernel
  • Creates a Kernel object with a specified source.

    Parameters

    • source: string

    Returns Kernel

  • Creates a Kernel object from the a specified file path.

    Parameters

    • source: string

    Returns Kernel

Properties

attributes

attributes: object

Sets the attributes "function arguments" for the kernel.

Attribute definition:

param

The name of the value we're going to set.

param

The type of the value.

Possible value types are KernelAttributeTypeFloat, KernelAttributeTypeVec2, KernelAttributeTypeVec3, KernelAttributeTypeVec4, and KernelAttributeTypeImage

code

brightenEffectKernel.attributes = [ { name: "amount", type: KernelAttributeTypeFloat, } ];

We're adding one attribute here named amount and is of type float. BrightenEffect.cikernel defines an apply function with the following

signature:

kernel vec4 apply (sampler src, float amount);

The first parameter is always sampler, and is the sampler of the track that we assign the kernel to inside render using instruction.addKernel (brightenEffectKernel, "camera");

endcode
type

Array

extent

extent: Array<number>

Sets the extent for this kernel. The 'extent' is the bounding box of all non-clear pixels produced by the kernel.

type

Array

Methods

getValue

  • getValue(key: string): any
  • Gets a value for the specified key.

    Parameters

    • key: string

    Returns any

setValue

  • setValue(value: any, key: string): void
  • Sets the specified value for the specified key.

    KernelAttributeTypeFloat KernelAttributeTypeVec2 KernelAttributeTypeVec3 KernelAttributeTypeVec4 KernelAttributeTypeSampler

    Parameters

    • value: any
    • key: string

    Returns void

Generated using TypeDoc