Video masking is a technique that allows you to focus an effect on some parts of an image, while leaving other parts uneffected. It's particularly effective when used in the alpha channel of a video, causing some parts of the image to be transparent while other parts remain opaque, allowing for one image to be composited on top of another. The "mask" is a shape, often simply a 1-plane black-and-white or grayscale image, that can be used in the alpha plane to designate which parts of an image should be transparent.
This patch demonstrates how to render objects of both one and two-dimensions which move accross a display window.
This examples shows how you can adjust the hue of an image by adjusting the value of hue angle of the object jit.hue. The left side of the example sets the time in milliseconds to change the hue angle over a certain amount of time. The right hand side of the example uses the incoming sound level to alter the angle.
This patch demonstrates how to manipulate source and destination dimensions in a jit.matrix to arrange windows into matrix locations.
This patch demonstrates how to create a 19x19 matrix that functions as a sort of "go" board, in which each mouse click alternates between placing a white or black square in a cell of the matrix. It's meant to demonstrate how a matrix can be used to store a multidimensional array of states or conditions.
This patch uses a rslider to set the minimum and maximum for random values of the brightness of red ouput by the jit.matrix and the frequency of an cycle~.
A video matrix, such as comes out of jit.movie, has four planes of data, representing alpha, red, green, and blue. The alpha channel contains information about the opacity of the other three planes—a factor that can be used when mixing/compositing with another image. Normally the values in the alpha channel are all set to 1., meaning full opacity. However, if some values in the alpha channel are 0., the image will be transparent in those pixels, allowing another image to show through.
To store an array of integers, you will usually use the table object. To store an array of floating point values, you can use the buffer~ object. Although the buffer~ object is normally used for storing audio data, it can easily be used simply as an array of floats, accessed by the peek~ object, which works even when MSP audio is not on.
This example shows a way to set the contents of a 2D Jitter matrix algorithmically in jit.gen. The task in this case is to fill an empty matrix with a checkerboard pattern of alternating black and white squares, which is to say alternating 0 and 1 cells.
This example shows a couple of different Jitter techniques. It shows how you can very simply use a MIDI control value to alter a Jitter attribute. In this case, the MIDI values from a modulation wheel (continuous controller 1), which range from 0 to 127, are divided by 127.0 to provide an xfade value from 0. to 1. to the jit.xfade object, to crossfade between two movie files.