Forums > Javascript

Using jit.iter and jit.spill in JavaScript

April 19, 2007 | 5:50 pm

I have an application that uses JitterMatrix objects in JavaScript. Some of the matrices have a 2D array in a single plane with 1024 cells. I would like to rapidly and efficiently traverse these matrices retrieving the cell values, but not use the JitterMatrix.getcell() method within a for-loop. Is it possible to use a jit.iter or jit.spill object within JavaScript to quickly extract JitterMatrix array data? If so, I’ve been unable so far to find any JavaScript examples of how to use these 2 objects. The Jitter tutorial PDF mentions that they can be used, but I didn’t see any JavaScript examples of their usage. I also searched in the Jitter JavaScript examples directories of the installation materials, but couldn’t find anything there, either.

Any advice would be greatly appreciated.

Thanks.


April 20, 2007 | 9:56 pm

On Apr 19, 2007, at 10:50 AM, Steve Bursch wrote:

>
> I have an application that uses JitterMatrix objects in
> JavaScript. Some of the matrices have a 2D array in a single plane
> with 1024 cells. I would like to rapidly and efficiently traverse
> these matrices retrieving the cell values, but not use the
> JitterMatrix.getcell() method within a for-loop. Is it possible to
> use a jit.iter or jit.spill object within JavaScript to quickly
> extract JitterMatrix array data?

Sorry, these object won’t work within JS. The JS equivalent would be
exactly the getcell strategy you describe. However, if you’re going
to process the values you might want to try and use jit.expr even
from within JS. See the tutorials and the jsglsurface-example.pat for
some demonstrations of this jit.expr from JS technique.

-Joshua


April 20, 2007 | 10:02 pm

Okay, thanks. I’ll take a look at the jit.expr object.

—Steve


June 5, 2013 | 3:00 pm

Hey folks, I was trying to instantiate a jit.iter in my javascript like so…

var jititer = new JitterObject("jit.iter");

But get the following error…

jsjitterobject_Constructor: null class pointer jit_iter

From the post above it would appear that jit.iter is not supported in js.
Is this still the case? I want to iterate through a matrix, what is the best
method to do this in js now?

Thanks,

Anthony


June 5, 2013 | 3:48 pm

Hey Anthony,

As JKC mentioned above, the best way to do this is still JitterMatrix.getcell().

-Ben


Viewing 5 posts - 1 through 5 (of 5 total)