Table of Contents

Struct Rect2d

Namespace
OpenCvSharp
Assembly
OpenCvSharp.dll

Stores a set of four double-precision floating-point numbers that represent the location and size of a rectangle

[Serializable]
public record struct Rect2d : IEquatable<Rect2d>
Implements
Inherited Members

Constructors

Rect2d(Point2d, Size2d)

Constructor

Rect2d(double, double, double, double)

Stores a set of four double-precision floating-point numbers that represent the location and size of a rectangle

Fields

Height

The height of the rectangle.

Width

The width of the rectangle.

X

The x-coordinate of the upper-left corner of the rectangle.

Y

The y-coordinate of the upper-left corner of the rectangle.

Properties

Bottom

Gets the y-coordinate that is the sum of the Y and Height property values of this Rect2d structure.

BottomRight

Coordinate of the right-most rectangle corner [Point2d(X+Width, Y+Height)]

Left

Gets the x-coordinate of the left edge of this Rect2d structure.

Location

Coordinate of the left-most rectangle corner [Point2d(X, Y)]

Right

Gets the x-coordinate that is the sum of X and Width property values of this Rect2d structure.

Size

Size of the rectangle [CvSize(Width, Height)]

Top

Gets the y-coordinate of the top edge of this Rect2d structure.

TopLeft

Coordinate of the left-most rectangle corner [Point2d(X, Y)]

Methods

Add(Point2d)

Shifts rectangle by a certain offset

Add(Size2d)

Shifts rectangle by a certain offset

Contains(Point2d)

Determines if the specified point is contained within the rectangular region defined by this Rectangle.

Contains(Rect2d)

Determines if the specified rectangle is contained within the rectangular region defined by this Rectangle.

Contains(double, double)

Determines if the specified point is contained within the rectangular region defined by this Rectangle.

FromLTRB(double, double, double, double)
Inflate(Rect, int, int)

Creates and returns an inflated copy of the specified Rect2d structure.

Inflate(Size2d)

Inflates this Rect by the specified amount.

Inflate(double, double)

Inflates this Rect by the specified amount.

Intersect(Rect2d)

Determines the Rect2d structure that represents the intersection of two rectangles.

Intersect(Rect2d, Rect2d)

Determines the Rect2d structure that represents the intersection of two rectangles.

IntersectsWith(Rect2d)

Determines if this rectangle intersects with rect.

Subtract(Point2d)

Shifts rectangle by a certain offset

Subtract(Size2d)

Shifts rectangle by a certain offset

ToRect()
Union(Rect2d)

Gets a Rect2d structure that contains the union of two Rect2d structures.

Union(Rect2d, Rect2d)

Gets a Rect2d structure that contains the union of two Rect2d structures.

Operators

operator +(Rect2d, Point2d)

Shifts rectangle by a certain offset

operator +(Rect2d, Size2d)

Expands or shrinks rectangle by a certain amount

operator &(Rect2d, Rect2d)

Determines the Rect2d structure that represents the intersection of two rectangles.

operator |(Rect2d, Rect2d)

Gets a Rect2d structure that contains the union of two Rect2d structures.

operator -(Rect2d, Point2d)

Shifts rectangle by a certain offset

operator -(Rect2d, Size2d)

Expands or shrinks rectangle by a certain amount