Joe Maller: Joe's Debug and Explore Filters: Joe's 3x3 Matrix Values Tester

A simple filter which helps to visualize the contents of a numerical matrix.

This filter is simply a value reporter for numerical matrix values in a 3x3 matrix. Joe's 3x3 Convolve Matrix Tester and Joe's 3x3 RGB Matrix Tester use different processes to help visualize the relationship between numeric matrix values and their visual results.

 

How it works

First, the nine slider variables are inserted into a matrix array:

mat = {AA, AB, AC, BA, BB, BC, CA, CB, CA};

The rest of this filter is dedicated to reporting the values selected by the matrix sliders.

Writing Text to the Screen

Text can be customized by setting the text attributes. These attributes only need to be set once per script, unless two different text strings use different formatting. Otherwise the attributes will apply to all strings following their definition.

The following code to sets the text style to Verdana Bold, Center Justified with a height equal to image height divided by 5:

settextfont("verdana");
setTextstyle(kbold);
setTextjustify(kcenterjustify);
setTextSize(h/5);

Each slider has a matching text string. Before the slider variables can be drawn as text, their values must be converted from numbers to text. There is a difference, and Final Cut Pro will choke on numbers where text should be. Each slider has the following two lines of text to draw it onscreen:

NumToString(AA, reporter, kinteger);
DrawString(reporter, -0.25 * w, -0.25 * h + h/5/3, 2, dest, fontcolor, aspectof(dest));

Source Code

Unlocked versions of this and all of Joe's Debugging and Exploration Filters are included for free with the trial and paid versions of Joe's Filters. Or use the source code below to build your own.


(copy and paste the code into FXBuilder)
 
page last modified: