View Single Post
Old 11th December 2016, 15:16   #8  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by xekon View Post
I believe once I have this block using the appropriate vapoursynth API functions that I should be able to get it working, the naming of these variables suggests that it processes the frames by looping through all pixels of each frame, does that mean I would need to use get_read_array() ? the vapoursynth documentation says that returns the frames data. any help with this code block is appreciated.

I have some basic coding experience in java, c++, c#, and now python. But nothing I have ever coded involved image or video manipulation. Mostly web apps that work with databases. I feel like the learning curve is a little steep, but im slowly getting a grasp on this.
get_read_array is a Python function. Aren't you doing this in C(++)? But yeah, if you want to do it in Python you'll want to use get_read_array and get_write_array to access the pixels.

If you're going to use C++, this is the page you need: http://www.vapoursynth.com/doc/api/vapoursynth.h.html
Read about the functions you see in the invert example.

Virtualdub uses packed RGB32, which means that the red, green, blue, and alpha pixels are interleaved in a single array (R0 G0 B0 A0 R1 G1 B1 A1 R2 ...). This is why you have all those shifts and bitwise AND operations. In VapourSynth the red, green, and blue pixels are in individual arrays (R0 R1 R2..., G0 G1 G2 ..., B0 B1 B2 ...), so the equivalent VapourSynth code will be a bit simpler.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote