SCImageKernel:
Filter:
Classes | GUI > Views

SCImageKernel

kernel class to use with SCImage
Location: NOT INSTALLED!

Description

// very experimental :)

Currently this class represents the CoreImage CIKernel you can apply to a SCImage. The Kernel language is a subset of the OpenGL Shading Language. more information about the Kernel Language can be found here : http://developer.apple.com/documentation/GraphicsImaging/Reference/CIKernelLangRef/Introduction/chapter_1_section_1.html

and here: http://developer.apple.com/documentation/GraphicsImaging/Reference/CIKernelLangRef/chapter_2_section_1.html#//apple_ref/doc/uid/TP40004397-CH206-TPXREF101

here is the translation table between Kernel language Objects and SuperCollider objects

Kernel Language ObjectSuperCollider Object
samplerSCImage
__colorColor
floatNumber
vec2, vec3, vec4Array
__tableSCImage (basically the __table modifier just use Images as a data providers - LUT)

Class Methods

.new

creates a new SCImageKernel

Arguments:

shader

optional. the shader code string. nil by default

values

optional. the values that match the kernel proc function defined in the shader string. nil by default

bounds

optional. not used for now. nil by default

Inherited class methods

Instance Methods

.shader

get or set the shader string.

.values

get or set the values array. When setting the object indexes in the values Array must match the argument declaration order as defined in the main kernel vec4 routine. See examples for more info.

.isValid

very basic verification to tell if all arguments of the shader are set.

.compile

compile the SCImageKernel object (and cache it).

NOTE: when rendered the first time, the kernel object is always compiled first. If you plan to change the shader string after, you must explicitely compile it to make it effective.

Inherited instance methods

Examples