public ActionResult Make_Rect() { Face[] retval = new Face[3]; retval[0] = new Face { x = rng.Next(0, 650), y = rng.Next(0, 550), w = 150, h = 50, timestamp = 0, ID = (ulong) rng.Next(0, 100000) }; retval[1] = new Face { x = rng.Next(0, 650), y = rng.Next(0, 550), w = 150, h = 50, timestamp = 0, ID = (ulong) rng.Next(0, 100000) }; retval[2] = new Face { x = rng.Next(0, 650), y = rng.Next(0, 550), w = 150, h = 50, timestamp = 0, ID = (ulong) rng.Next(0, 100000) }; return Json(retval, JsonRequestBehavior.AllowGet); }
public Face[] to_Ary() { Face[] retval = new Face[size]; for (int i=0; i < size; i++) { retval[i] = frame[i]; } return retval; }
/* This guy takes a face we've drawn and adds it to ALL frames sharing its timestamp, however this means the drawn face only persists for one second */ public bool add_Face(Face f) { int tstp = f.ref_tstp; foreach (Symbolic_Frame fr in video) { if (fr.symb_tstp == tstp) { fr.add_Face(f); } } return true; }
/* Worth considering making a effects method call in Face which aggregates effects if we add a few more and we can use to batch edit them inside the if statement */ public void edit_effects(Face f) { foreach (Symbolic_Frame sf in video) { foreach (Face fc in sf.frame) { if (fc.ID == f.ID) { fc.blurred = f.blurred; } } } }
public void add_Face(Face f) { frame.Add(f); f.timestamp = act_tstp; size += 1; }
public ActionResult recieveFace(Face rect) { // sym_vid.add_Face(rect); rect.ID = (ulong) rng.Next(0, 100000); return Json(rect, JsonRequestBehavior.AllowGet); }
// GET: Editor public ActionResult Index() { sym_vid.populate(); /* This method will eventually have at least one arg for passing facetracker data */ ViewData["next"] = new Face { x = 0, y = 0, w = 150, h = 50, timestamp = 0 }; return View("AJAX_testbed"); }