Пример #1
0
static value openflkinect_update_color_pixels(value ref, value colorArray)
{
  val_check_kind(ref, k_Kinect);
  Kinect* k = static_cast<Kinect*>(val_data(ref));

  int* ints = val_array_int(colorArray);
  if ( ! ints )
  {
    return alloc_bool(false);
  }

  if ( k->isCapturing() == false )
  {
    return alloc_bool(false);
  }

  int* color = k->colorPixels();
  int dims = k->getDeviceOptions().numColorPixels();
  memcpy(ints, color, dims*sizeof(int));
  return alloc_bool(true);
}