View Single Post
Old 11th December 2016, 14:10   #6  |  Link
xekon
Registered User
 
Join Date: Jul 2011
Posts: 224
im slowly getting a feel for how things are connected. i found an example in the vapoursynth source invert_example
and im following through the c++ code of gradation and found what I believe is the main processing loop when processing in the mode I am currently using which is mode 1 (RGB + R/G/B)

Code:
for (h = 0; h < height; h++)
{
	for (w = 0; w < width; w++)
	{
		old_pixel = *src++;
		med_pixel = mfd->rvalue[1][(old_pixel & 0xFF0000)>>16] + mfd->gvalue[1][(old_pixel & 0x00FF00)>>8] + mfd->ovalue[3][(old_pixel & 0x0000FF)];
		new_pixel = mfd->rvalue[0][(med_pixel & 0xFF0000)>>16] + mfd->gvalue[0][(med_pixel & 0x00FF00)>>8] + mfd->ovalue[0][(med_pixel & 0x0000FF)];
		*dst++ = new_pixel;
	}
	src = (Pixel32 *)((char *)src + fa->src.modulo);
	dst = (Pixel32 *)((char *)dst + fa->dst.modulo);
}
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.

Last edited by xekon; 11th December 2016 at 14:30.
xekon is offline   Reply With Quote