clipLine function

bool clipLine(
  1. (int, int) imgSize,
  2. (int, int) pt1,
  3. (int, int) pt2
)

ClipLine clips the line against the image rectangle. For further details, please see: https:///docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf483cb46ad6b049bc35ec67052ef1c2c

Implementation

bool clipLine((int width, int height) imgSize, (int x, int y) pt1, (int x, int y) pt2) {
  bool r = false;
  using((arena) {
    final size = arena<cvg.Size>()
      ..ref.width = imgSize.$1
      ..ref.height = imgSize.$2;
    final cPt1 = calloc<cvg.Point>()
      ..ref.x = pt1.$1
      ..ref.y = pt1.$2;
    final cPt2 = calloc<cvg.Point>()
      ..ref.x = pt1.$1
      ..ref.y = pt1.$2;
    r = _bindings.ClipLine(size.ref, cPt1.ref, cPt2.ref);
  });
  return r;
}