@Name(value="cv::Point_") @NoOffset public static class opencv_core.Point extends IntPointer
x
and y
.
An instance of the class is interchangeable with C structures, CvPoint and CvPoint2D32f . There is also a cast operator to convert point coordinates to the specified type. The conversion from floating-point coordinates to integer coordinates is done by rounding. Commonly, the conversion uses this operation for each of the coordinates. Besides the class members listed in the declaration above, the following operations on points are implemented:
pt1 = pt2 + pt3;
pt1 = pt2 - pt3;
pt1 = pt2 * a;
pt1 = a * pt2;
pt1 = pt2 / a;
pt1 += pt2;
pt1 -= pt2;
pt1 *= a;
pt1 /= a;
double value = norm(pt); // L2 norm
pt1 == pt2;
pt1 != pt2;
For your convenience, the following type aliases are defined:
typedef Point_<int> Point2i;
typedef Point2i Point;
typedef Point_<float> Point2f;
typedef Point_<double> Point2d;
Example:
Point2f a(0.3f, 0.f), b(0.f, 0.4f);
Point pt = (a + b)*10.f;
cout << pt.x << ", " << pt.y << endl;
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator
Constructor and Description |
---|
opencv_core.Point() |
opencv_core.Point(int _x,
int _y) |
opencv_core.Point(long size)
Native array allocator.
|
opencv_core.Point(opencv_core.Point pt) |
opencv_core.Point(opencv_core.Size sz) |
opencv_core.Point(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
cross(opencv_core.Point pt)
cross-product
|
double |
ddot(opencv_core.Point pt)
dot product computed in double-precision arithmetics
|
int |
dot(opencv_core.Point pt)
dot product
|
boolean |
inside(opencv_core.Rect r)
checks whether the point is inside the specified rectangle
|
opencv_core.Point |
position(long position) |
opencv_core.Point |
put(opencv_core.Point pt) |
int |
x() |
opencv_core.Point |
x(int x) |
int |
y() |
opencv_core.Point |
y(int y) |
asBuffer, capacity, get, get, get, get, getString, getStringCodePoints, limit, put, put, put, put, putString
address, asByteBuffer, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, hashCode, isNull, limit, maxBytes, memchr, memcmp, memcpy, memmove, memset, offsetof, position, put, setNull, sizeof, toString, totalBytes, withDeallocator, zero
public opencv_core.Point(Pointer p)
Pointer.Pointer(Pointer)
.public opencv_core.Point(long size)
Pointer.position(long)
.public opencv_core.Point()
public opencv_core.Point(int _x, int _y)
public opencv_core.Point(@Const@ByRef opencv_core.Point pt)
public opencv_core.Point(@Const@ByRef opencv_core.Size sz)
public opencv_core.Point position(long position)
position
in class IntPointer
@ByRef @Name(value="operator =") public opencv_core.Point put(@Const@ByRef opencv_core.Point pt)
public int dot(@Const@ByRef opencv_core.Point pt)
public double ddot(@Const@ByRef opencv_core.Point pt)
public double cross(@Const@ByRef opencv_core.Point pt)
@Cast(value="bool") public boolean inside(@Const@ByRef opencv_core.Rect r)
public int x()
public opencv_core.Point x(int x)
public int y()
public opencv_core.Point y(int y)
Copyright © 2016. All rights reserved.