/** * Wrapper for the cc3 library's cc3_frame_diff_scanline_start function. * Just gets the framediff object passed in from lua, calls the c function, * and then sticks the integer returned onto the lua stack. */ int framediff_scanline_start(lua_State *_l) { cc3_frame_diff_pkt_t *pkt = checkframediff(_l, 1); int rv = cc3_frame_diff_scanline_start(pkt); lua_pushinteger(_l, rv); return 1; // one return value }
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); }