Rect Structure

CVB.Net Documentation
Cvb Rectangle structure.

Namespace:  Stemmer.Cvb
Assembly:  Stemmer.Cvb (in Stemmer.Cvb.dll) Version: 14.0.0.0
Syntax

public struct Rect : IAreaOfInterest

The Rect type exposes the following members.

Constructors

  NameDescription
Public methodRect(Point2D, Size2D)
Constructor for Cvb rectangles.
Public methodRect(Int32, Int32, Int32, Int32)
Constructor for Cvb rectangles.
Top
Properties

  NameDescription
Public propertyArea
Area of the rectangle.
Public propertyBottom
Bottom row of the rectangle (still inside the rectangle).
Public propertyCoordinateSystem
Indicates the coordinate system in which this object is being measured (when used as an area of interest).
Public propertyHeight
Height of the rectangle.
Public propertyIsEmpty
True if width and height are both zero, false otherwise.
Public propertyLeft
First column of the rectangle.
Public propertyLocation
Location of the top left corner of the rectangle.
Public propertyRight
Rightmost column of the rectangle (still inside the rectangle).
Public propertySize
Size of the rectangle.
Public propertyTop
First row of the rectangle.
Public propertyWidth
Width of the rectangle.
Top
Methods

  NameDescription
Public methodStatic memberCeiling
Converts the given rect to a Rect structure by rounding the values of the RectD structure to the next higher integer number.
Public methodContains(Point2D)
Check if a point is located inside this Rect.
Public methodContains(Point2Dd)
Check if a point is located inside this Rect.
Public methodContains(Int32, Int32)
Determines if the specified point is contained with this Rect.
Public methodContains(Point2Dd, Double)
Check if a point is located inside this Rect.
Public methodStatic memberCropExtent
Assuming that a Rect structure contains the extent of something relative to a position inside an image, this function crops the Rect so that the whole content is inside the image.
Public methodEquals
Tests whether obj is a Rect structure with the same/ location and size as this Rect structure.
(Overrides ValueTypeEquals(Object).)
Public methodStatic memberFromLTRB
Creates a Rect structure with the specified edge locations.
Public methodGetHashCode
Returns the hash code for this Rect.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodIntersect(Rect)
Replaces this rectangle with the intersection of itself and the specified rectangle.
Public methodStatic memberIntersect(Rect, Rect)
Returns a Rect structure that represents the intersection of the two input rectangles. If there is no intersection, an empty Rect is returned.
Public methodIntersectsWith
Test if this rectangle intersects with rect.
Public methodStatic memberRound
Converts the given rect to a Rect structure by rounding the values of the RectD structure mathematically.
Public methodToString
String conversion.
(Overrides ValueTypeToString.)
Public methodStatic memberTruncate
Converts the given rect to a Rect structure by rounding the values of the RectD structure to the next lower integer number.
Public methodStatic memberTruncateCeiling
Converts the given rect to a Rect structure by truncating Left and Top and rounding Right and Bottom to the next higher integer number.
Public methodStatic memberUnion
Gets a Rect structure that contains the union of two Rect structures.
Top
Operators

  NameDescription
Public operatorStatic memberEquality
Comparison operator for Rect structures.
Public operatorStatic member(RectD to Rect)
Explicit conversion operator (truncates the values).
Public operatorStatic memberInequality
Comparison operator for Rect structures.
Top
Fields

  NameDescription
Public fieldStatic memberEmpty
Null-element.
Top
Extension Methods

  NameDescription
Public Extension MethodContains
Check if a point is located inside this Rect.
(Defined by RectExtensions.)
Public Extension MethodToRectangle
Convert a Rect to a Rectangle.
(Defined by ImageExtensions.)
Public Extension MethodToWindowsRect
Creates a Rect from this rectangle.
(Defined by RectExtensions.)
Top
Remarks

Unlike System.Drawing.Rectangle, which upholds the convention that Right and Bottom are not part of the rectangle (in other words: Width = Left - Right and Height = Bottom - Top), Common Vision Blox always uses rectangles (or rectangular shaped areas of interest represented by integer parameters left, top, right and bottom) in such a way that right and bottom are still part of the area to be investigated (i.e. Width = Right - Left + 1 and Height = Bottom - Top + 1).

To model this difference correctly we decided to give CVB.Net a rectangle of its own which behaves according to the conventions used in Common Vision Blox.

See Also

Reference