@Namespace(value="cv") @NoOffset @Properties(inherit=opencv_core.class) public class RotatedRect extends FloatPointer
Each rectangle is specified by the center point (mass center), length of each side (represented by #Size2f structure) and the rotation angle in degrees.
The sample below demonstrates how to use RotatedRect: \snippet snippets/core_various.cpp RotatedRect_demo ![image](pics/rotatedrect.png)
CamShift, fitEllipse, minAreaRect, CvBox2D
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
RotatedRect()
default constructor
|
RotatedRect(long size)
Native array allocator.
|
RotatedRect(Point2f point1,
Point2f point2,
Point2f point3)
Any 3 end points of the RotatedRect.
|
RotatedRect(Point2f center,
Size2f size,
float angle)
full constructor
|
RotatedRect(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
float |
angle()
returns the rotation angle.
|
RotatedRect |
angle(float setter) |
Rect |
boundingRect()
returns the minimal up-right integer rectangle containing the rotated rectangle
|
Rect2f |
boundingRect2f()
returns the minimal (exact) floating point rectangle containing the rotated rectangle, not intended for use with images
|
Point2f |
center()
returns the rectangle mass center
|
RotatedRect |
center(Point2f setter) |
RotatedRect |
getPointer(long i) |
void |
points(Point2f pts)
returns 4 vertices of the rotated rectangle
|
void |
points(Point2fVector pts) |
RotatedRect |
position(long position) |
Size2f |
size()
returns width and height of the rectangle
|
RotatedRect |
size(Size2f setter) |
asBuffer, capacity, get, get, get, get, limit, put, put, put, put, sizeof
address, asByteBuffer, availablePhysicalBytes, calloc, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public RotatedRect(Pointer p)
Pointer(Pointer)
.public RotatedRect(long size)
Pointer.position(long)
.public RotatedRect()
public RotatedRect(@Const @ByRef Point2f center, @Const @ByRef Size2f size, float angle)
center
- The rectangle mass center.size
- Width and height of the rectangle.angle
- The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc.,
the rectangle becomes an up-right rectangle.public RotatedRect position(long position)
position
in class FloatPointer
public RotatedRect getPointer(long i)
getPointer
in class FloatPointer
public void points(Point2f pts)
pts
- The points array for storing rectangle vertices. The order is _bottomLeft_, _topLeft_, topRight, bottomRight.
\note _Bottom_, _Top_, _Left_ and _Right_ sides refer to the original rectangle (angle is 0),
so after 180 degree rotation _bottomLeft_ point will be located at the top right corner of the
rectangle.public void points(@ByRef Point2fVector pts)
@ByVal public Rect boundingRect()
@ByVal public Rect2f boundingRect2f()
public RotatedRect center(Point2f setter)
public RotatedRect size(Size2f setter)
public float angle()
public RotatedRect angle(float setter)
Copyright © 2024. All rights reserved.