CVB.Net 15.0
Area2D Struct Reference

Structure that represents an area of interest in the image. More...

Inherits IAreaOfInterest.

Public Member Functions

 Area2D (Rect r)
 Create an Area2D from the given rectangle r using the identity transformation (equivalent to calling new Area2D(r, AffineMatrix.Identity);) More...
 
 Area2D (Rect r, AffineMatrix2D m)
 Creates an Area2D from the given rectangle r using the transformation m . More...
 
 Area2D (double x0, double y0, double x1, double y1, double x2, double y2)
 Constructor for Area2D. More...
 
 Area2D (Point2Dd p0, Point2Dd p1, Point2Dd p2)
 Constructor for Area2D. More...
 
 Area2D (Point2D p0, Point2D p1, Point2D p2)
 Constructor for Area2D. More...
 
 Area2D (double radius)
 Constructor for Area2D. More...
 
override string ToString ()
 Convert an Area2D object to a string. More...
 
override bool Equals (object obj)
 Comparison function. More...
 
override int GetHashCode ()
 Hash code. More...
 
void Transform (Matrix2D m)
 Transform this Area2D using a Matrix2D. More...
 
void Transform (AffineMatrix2D m)
 Transform this Area2D using a AffineMatrix. More...
 
void Offset (Point2Dd vec)
 Offsets the Area2D structure by the specified amount. Note that the operation is carried out in-place. More...
 
void SwapOrientation ()
 Let the vertices P1 and P2 swap their place, effectively altering the scan direction of the AOI without changing the area covered by the aoi.
 

Static Public Member Functions

static bool operator!= (Area2D lhs, Area2D rhs)
 Comparison operator for Point2D structs. More...
 
static bool operator== (Area2D lhs, Area2D rhs)
 Comparison operator for Area2D structs. More...
 

Static Public Attributes

static readonly Area2D Empty = new Area2D()
 An "Empty" identifier
 

Properties

Point2Dd P0 [get, set]
 P0 of the Area (top left corner)
 
Point2Dd P1 [get, set]
 P1 of the Area (top right corner)
 
Point2Dd P2 [get, set]
 P2 of the Area (bottom left corner)
 
Point2Dd P3 [get]
 Gets the calculated P3 of the Area (bottom right corner)
 
RectD BoundingRectangle [get]
 Gets the bounding box of this area. More...
 
Size2Dd Size [get]
 Size (width and height) of the area of interest
 
double Area [get]
 Size (in pixels) of the area of interest. As the area is a parallelogram the area (in pixels) is not simply "width * height"
 
CoordinateSystemType CoordinateSystem [get]
 Coordinate system, in which this AOI is defined.
 
- Properties inherited from IAreaOfInterest
CoordinateSystemType CoordinateSystem [get]
 Implementers of this interface should specify here inside which coordinate system their Area of interest is to operate.
 
double Area [get]
 Size (in pixels) of the Area of interest
 

Detailed Description

Structure that represents an area of interest in the image.

The pixels of this type are always specified in CoordinateSystemType.ImageCoordinates

Corresponds to the unmanaged type TArea.

.

Constructor & Destructor Documentation

◆ Area2D() [1/6]

Area2D ( Rect  r)

Create an Area2D from the given rectangle r using the identity transformation (equivalent to calling new Area2D(r, AffineMatrix.Identity);)

Parameters
rRectangle to create the Area2D from

◆ Area2D() [2/6]

Area2D ( Rect  r,
AffineMatrix2D  m 
)

Creates an Area2D from the given rectangle r using the transformation m .

Parameters
rRectangle to convert to image coordinates via matrix m .
mAffine matrix to transform pixel coordinates to image coordinates.

◆ Area2D() [3/6]

Area2D ( double  x0,
double  y0,
double  x1,
double  y1,
double  x2,
double  y2 
)

Constructor for Area2D.

Parameters
x0X component of P0 (top left corner)
y0Y component of P0 (top left corner)
x1X component of P1 (top right corner)
y1Y component of P1 (top right corner)
x2X component of P2 (bottom left corner)
y2Y component of P2 (bottom left corner)

◆ Area2D() [4/6]

Area2D ( Point2Dd  p0,
Point2Dd  p1,
Point2Dd  p2 
)

Constructor for Area2D.

Parameters
p0P0 (top left corner of the area)
p1P1 (top right corner of the area)
p2P2 (bottom left corner of the area)

◆ Area2D() [5/6]

Area2D ( Point2D  p0,
Point2D  p1,
Point2D  p2 
)

Constructor for Area2D.

Parameters
p0P0 (top left corner of the area)
p1P1 (top right corner of the area)
p2P2 (bottom left corner of the area)

◆ Area2D() [6/6]

Area2D ( double  radius)

Constructor for Area2D.

Parameters
radiusRadius to construct the area with.

Member Function Documentation

◆ Equals()

override bool Equals ( object  obj)

Comparison function.

Parameters
objObject to compare to
Returns
true if obj == this, false otherwise

◆ GetHashCode()

override int GetHashCode ( )

Hash code.

Returns
Hash code

◆ Offset()

void Offset ( Point2Dd  vec)

Offsets the Area2D structure by the specified amount. Note that the operation is carried out in-place.

Parameters
vecVector by which to offset the area

◆ operator!=()

static bool operator!= ( Area2D  lhs,
Area2D  rhs 
)
static

Comparison operator for Point2D structs.

Parameters
lhsLeft hand side operand
rhsRight hand side operand
Returns
true lhs != rhs, false otherwise

◆ operator==()

static bool operator== ( Area2D  lhs,
Area2D  rhs 
)
static

Comparison operator for Area2D structs.

Parameters
lhsLeft hand side operand
rhsRight hand side operand
Returns
true lhs == rhs, false otherwise

◆ ToString()

override string ToString ( )

Convert an Area2D object to a string.

Returns
Conversion result

◆ Transform() [1/2]

void Transform ( AffineMatrix2D  m)

Transform this Area2D using a AffineMatrix.

Parameters
mMatrix to transform this area with

◆ Transform() [2/2]

void Transform ( Matrix2D  m)

Transform this Area2D using a Matrix2D.

Parameters
mMatrix to transform this area with

Property Documentation

◆ BoundingRectangle

RectD BoundingRectangle
get

Gets the bounding box of this area.

Returns
The bounding rectangle.