setVec<T extends CvVec<Struct>> method

void setVec<T extends CvVec<Struct>>(
  1. int row,
  2. int col,
  3. T val
)

Implementation

void setVec<T extends CvVec>(int row, int col, T val) {
  switch (val) {
    // Vec2b, Vec3b, Vec4b
    case Vec2b():
      cvRun(() => cffi.Mat_SetVec2b(ref, row, col, val.ref));
    case Vec3b():
      cvRun(() => cffi.Mat_SetVec3b(ref, row, col, val.ref));
    case Vec4b():
      cvRun(() => cffi.Mat_SetVec4b(ref, row, col, val.ref));
    // Vec2w, Vec3w, Vec4w
    case Vec2w():
      cvRun(() => cffi.Mat_SetVec2w(ref, row, col, val.ref));
    case Vec3w():
      cvRun(() => cffi.Mat_SetVec3w(ref, row, col, val.ref));
    case Vec4w():
      cvRun(() => cffi.Mat_SetVec4w(ref, row, col, val.ref));
    // Vec2s, Vec3s, Vec4s
    case Vec2s():
      cvRun(() => cffi.Mat_SetVec2s(ref, row, col, val.ref));
    case Vec3s():
      cvRun(() => cffi.Mat_SetVec3s(ref, row, col, val.ref));
    case Vec4s():
      cvRun(() => cffi.Mat_SetVec4s(ref, row, col, val.ref));
    // Vec2i, Vec3i, Vec4i, Vec6i, Vec8i
    case Vec2i():
      cvRun(() => cffi.Mat_SetVec2i(ref, row, col, val.ref));
    case Vec3i():
      cvRun(() => cffi.Mat_SetVec3i(ref, row, col, val.ref));
    case Vec4i():
      cvRun(() => cffi.Mat_SetVec4i(ref, row, col, val.ref));
    case Vec6i():
      cvRun(() => cffi.Mat_SetVec6i(ref, row, col, val.ref));
    case Vec8i():
      cvRun(() => cffi.Mat_SetVec8i(ref, row, col, val.ref));
    // Vec2f, Vec3f, Vec4f, Vec6f
    case Vec2f():
      cvRun(() => cffi.Mat_SetVec2f(ref, row, col, val.ref));
    case Vec3f():
      cvRun(() => cffi.Mat_SetVec3f(ref, row, col, val.ref));
    case Vec4f():
      cvRun(() => cffi.Mat_SetVec4f(ref, row, col, val.ref));
    case Vec6f():
      cvRun(() => cffi.Mat_SetVec6f(ref, row, col, val.ref));
    // Vec2d, Vec3d, Vec4d, Vec6d
    case Vec2d():
      cvRun(() => cffi.Mat_SetVec2d(ref, row, col, val.ref));
    case Vec3d():
      cvRun(() => cffi.Mat_SetVec3d(ref, row, col, val.ref));
    case Vec4d():
      cvRun(() => cffi.Mat_SetVec4d(ref, row, col, val.ref));
    case Vec6d():
      cvRun(() => cffi.Mat_SetVec6d(ref, row, col, val.ref));
    default:
      throw UnsupportedError("setVec<$T>() for ${type.asString()} is not supported!");
  }
}