bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.45k stars 1.57k forks source link

RotatedRect.points accepts a single Point2f as an argument, instead of an array of Point2f's #1998

Closed NAsejevs closed 1 year ago

NAsejevs commented 1 year ago
val rotatedRect = new RotatedRect(
  new Point2f(100, 100),
  new Size2f(100, 100),
  45
)

val point = new Point2f()
rotatedRect.points(point)

I would expect rotatedRect.points to accept Array[Point2f] or Point2fVector as a parameter, instead, Point2f is accepted. This seems like an oversight and results in a crash if Point2f is provided.

Maybe I'm doing something wrong?

saudet commented 1 year ago

Call new Point2f(4) to allocate an array of 4.

saudet commented 1 year ago

Duplicate of https://github.com/bytedeco/javacpp/issues/661