Example #1
0
File: main.c Project: rcrowder/Burt
void frame_diff (cc3_frame_diff_pkt_t * pkt)
{
	uint8_t old_coi = cc3_g_pixbuf_frame.coi;
	cc3_pixbuf_frame_set_coi (pkt->coi);

	cc3_image_t img;
	img.channels = 1;
	img.width = cc3_g_pixbuf_frame.width;
	img.height = 1; // 1 row for scanline processing
	img.pix = (void*)tempBuffer;

	if (cc3_frame_diff_scanline_start (pkt) != 0)
	{
		while (cc3_pixbuf_read_rows (img.pix, 1))
		{
			cc3_frame_diff_scanline (&img, pkt);
		}

		cc3_frame_diff_scanline_finish (pkt);
	}
	else
		printf ("frame diff start error\r");

	cc3_pixbuf_frame_set_coi (old_coi);

}
Example #2
0
/**
 * Wrapper for the cc3 library's cc3_frame_diff_scanline function.
 * Just gets the framediff object and the image object passed in from lua,
 * calls the c function and then sticks the integer returned onto the stack.
 */
int framediff_scanline(lua_State *_l) {
    cc3_image_t *img = checkimage(_l);
    cc3_frame_diff_pkt_t *pkt = checkframediff(_l, 2);

    int rv = cc3_frame_diff_scanline(img, pkt);
    lua_pushinteger(_l, rv);
    
    return 1;
}