Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
Point< T > Struct Template Reference

The Point structure defines the x- and y-coordinates of a point. More...

#include <SimdPoint.hpp>

Public Types

typedef T Type
 

Public Member Functions

 Point ()
 
template<typename TX , typename TY >
SIMD_CONSTEXPR Point (TX tx, TY ty)
 
template<class TP , template< class > class TPoint>
 Point (const TPoint< TP > &p)
 
template<class TS >
 Point (const cv::Size_< TS > &size)
 
SIMD_CONSTEXPR ~Point ()
 
template<class TP , template< class > class TPoint>
 operator TPoint< TP > () const
 
template<typename TP >
Pointoperator= (const Point< TP > &p)
 
template<typename TP >
Pointoperator+= (const Point< TP > &p)
 
template<typename TP >
Pointoperator-= (const Point< TP > &p)
 
template<typename TA >
Pointoperator*= (const TA &a)
 
Pointoperator/= (double a)
 
Point operator<< (ptrdiff_t shift) const
 
Point operator>> (ptrdiff_t shift) const
 
 operator cv::Point2f () const
 

Data Fields

x
 Specifies the x-coordinate of a point.
 
y
 Specifies the y-coordinate of a point.
 

Detailed Description

template<typename T>
struct Simd::Point< T >

The Point structure defines the x- and y-coordinates of a point.

In order to have mutual conversion with OpenCV cv::Point and cv::Size types you have to define macro SIMD_OPENCV_ENABLE:

#include "opencv2/core/core.hpp"
#define SIMD_OPENCV_ENABLE
#include "Simd/SimdPoint.hpp"

int main()
{
    typedef Simd::Point<ptrdiff_t> Point;

    cv::Size cvSize;
    cv::Point cvPoint;
    Point simdPoint;

    simdPoint = cvPoint;
    simdPoint = cvSize;
    cvSize = simdPoint;
    cvPoint = simdPoint;

    return 0;
}

Related Functions.

Member Typedef Documentation

◆ Type

typedef T Type

Type definition.

Constructor & Destructor Documentation

◆ Point() [1/4]

SIMD_INLINE Point

Creates a new Point structure that contains the default (0, 0) coordinates.

◆ Point() [2/4]

SIMD_CONSTEXPR Point ( TX  tx,
TY  ty 
)

Creates a new Point structure that contains the specified coordinates.

Parameters
[in]tx- initial X value.
[in]ty- initial Y value.

◆ Point() [3/4]

Point ( const TPoint< TP > &  p)

Creates a new Point structure on the base of another point of arbitrary type.

Parameters
[in]p- a point of arbitrary type.

◆ Point() [4/4]

Point ( const cv::Size_< TS > &  size)

Creates a new Point structure on the base of OpenCV size type.

Note
You have to define SIMD_OPENCV_ENABLE in order to use this functionality.
Parameters
[in]size- an OpenCV size.

◆ ~Point()

SIMD_INLINE SIMD_CONSTEXPR ~Point

A point destructor.

Member Function Documentation

◆ operator TPoint< TP >()

operator TPoint< TP > ( ) const

Converts itself to point of arbitrary type.

Returns
a point of arbitrary type.

◆ operator=()

Point & operator= ( const Point< TP > &  p)

Performs copying from point of arbitrary type.

Parameters
[in]p- a point of arbitrary type.
Returns
a reference to itself.

◆ operator+=()

Point & operator+= ( const Point< TP > &  p)

Adds to itself point of arbitrary type.

Parameters
[in]p- a point of arbitrary type.
Returns
a reference to itself.

◆ operator-=()

Point & operator-= ( const Point< TP > &  p)

Subtracts from itself point of arbitrary type.

Parameters
[in]p- a point of arbitrary type.
Returns
a reference to itself.

◆ operator*=()

Point & operator*= ( const TA &  a)

Multiplies itself by value of arbitrary type.

Parameters
[in]a- a factor of arbitrary type.
Returns
a reference to itself.

◆ operator/=()

SIMD_INLINE Point< T > & operator/= ( double  a)

Divides itself into given value.

Parameters
[in]a- a value of divider.
Returns
a reference to itself.

◆ operator<<()

SIMD_INLINE Point< T > operator<< ( ptrdiff_t  shift) const

Performs shift bit left for value of point coordinates.

Note
It function is actual for integer types of Point.
Parameters
[in]shift- a shift value.
Returns
a new point with shifted coordinates.

◆ operator>>()

SIMD_INLINE Point< T > operator>> ( ptrdiff_t  shift) const

Performs shift bit right for value of point coordinates.

Note
It function is actual for integer types of Point.
Parameters
[in]shift- a shift value.
Returns
a new point with shifted coordinates.

◆ operator cv::Point2f()

SIMD_INLINE operator cv::Point2f

Casts simd point to OpenCV Point2f

Note
You have to define SIMD_OPENCV_ENABLE in order to use this functionality.