crop and rotate

madbutter's icon

Someone please help me - my Jitter is rusty and I'm trying to do something that for the life of me I can't seem to get to work. I'm trying to arbitrarily crop images on the fly, then rotate and scale only the cropped portion using jot.rota, filling the rest of the window with black (or folded or wrapped versions of the cropped image). I've tried cropping by sending the same srcrect and dstrect params to jit.qt but when I then send the video to jit.rota it scales and rotates the original 320x240 shape, including the cropped black parts. I tried jit.submatrix and that did the scaling and rotating as I wanted but the image is chewed up.
anyone? thanks,-bob

vade's icon

are you setting @usersrcdim 1 with jit.matrix, otherwise sending
srcdimstart/srcdimend wont work. I imagine that would be the
preferred way to do it though.

v a d e //

www.vade.info
abstrakt.vade.info

madbutter's icon

Hi Vade,
Thanks for the response but thats not the problem - I am setting @usersrcdim 1 and the matrix *is* cropping properly. The problem is that when I then send the stream to jit.rota and scale and rotate, I can't fill the screen with rotated/scaled versions of the cropped area. What is rotated and scaled is the "full" 320x240 image including the black boxes around the cropped area.
SoftVNS has an actual crop object and when I use that (instead of using a Jitter option) and send that stream to the softVNS rotate object the image scales and rotates within the cropped rectangle - ie the corners get clipped when the image is rotated slightly. The cropped area is like a window that the image scales and rotates within - I want it to use the whole 320x240 space.

jonathan lee marcus's icon

could you post a patch to the list? there may be an error you aren't
noticing and that we might catch.

best,
jonathan

Scott Fitzgerald's icon

look at the boundmode attributes in jit.rota. 2 and 4 may be what
youre looking for.

madbutter's icon

Here's a simplified version of the patch.

Max Patch
Copy patch and select New From Clipboard in Max.

Adam Kendall's icon

Bob,

You need to keep your dstrect dimensions at 0 0 320 240.

Adam

Adam Kendall's icon

Sorry, that last post wasn't right.

Adam

Scott Fitzgerald's icon

try jit.submatrix :

Max Patch
Copy patch and select New From Clipboard in Max.

yibidy's icon

Can someone please help me. I need to crop a video file without distorting the image. It seem like the options suggested above don't actually crop the edges of a image, but instead, warp it by making it either larger or smaller. I spent hours trying to figure this out, please help.

mzed's icon

Jitter tutorial 14 has everything you need.