Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
SkDVector Struct Reference

#include <SkPathOpsPoint.h>

Public Member Functions

SkDVectorset (const SkVector &pt)
 
void operator+= (const SkDVector &v)
 
void operator-= (const SkDVector &v)
 
void operator/= (const double s)
 
void operator*= (const double s)
 
SkVector asSkVector () const
 
double cross (const SkDVector &a) const
 
double crossCheck (const SkDVector &a) const
 
double crossNoNormalCheck (const SkDVector &a) const
 
double dot (const SkDVector &a) const
 
double length () const
 
double lengthSquared () const
 
SkDVectornormalize ()
 
bool isFinite () const
 

Public Attributes

double fX
 
double fY
 

Detailed Description

Definition at line 19 of file SkPathOpsPoint.h.

Member Function Documentation

◆ asSkVector()

SkVector SkDVector::asSkVector ( ) const
inline

Definition at line 53 of file SkPathOpsPoint.h.

53 {
55 return v;
56 }
#define SkDoubleToScalar(x)
Definition SkScalar.h:64

◆ cross()

double SkDVector::cross ( const SkDVector a) const
inline

Definition at line 59 of file SkPathOpsPoint.h.

59 {
60 return fX * a.fY - fY * a.fX;
61 }
struct MyStruct a[10]

◆ crossCheck()

double SkDVector::crossCheck ( const SkDVector a) const
inline

Definition at line 65 of file SkPathOpsPoint.h.

65 {
66 double xy = fX * a.fY;
67 double yx = fY * a.fX;
68 return AlmostEqualUlps(xy, yx) ? 0 : xy - yx;
69 }
bool AlmostEqualUlps(const SkPoint &pt1, const SkPoint &pt2)

◆ crossNoNormalCheck()

double SkDVector::crossNoNormalCheck ( const SkDVector a) const
inline

Definition at line 72 of file SkPathOpsPoint.h.

72 {
73 double xy = fX * a.fY;
74 double yx = fY * a.fX;
75 return AlmostEqualUlpsNoNormalCheck(xy, yx) ? 0 : xy - yx;
76 }
bool AlmostEqualUlpsNoNormalCheck(float a, float b)

◆ dot()

double SkDVector::dot ( const SkDVector a) const
inline

Definition at line 78 of file SkPathOpsPoint.h.

78 {
79 return fX * a.fX + fY * a.fY;
80 }

◆ isFinite()

bool SkDVector::isFinite ( ) const
inline

Definition at line 97 of file SkPathOpsPoint.h.

97 {
98 return SkIsFinite(fX, fY);
99 }
static bool SkIsFinite(T x, Pack... values)

◆ length()

double SkDVector::length ( ) const
inline

Definition at line 82 of file SkPathOpsPoint.h.

82 {
83 return sqrt(lengthSquared());
84 }
SIN Vec< N, float > sqrt(const Vec< N, float > &x)
Definition SkVx.h:706
double lengthSquared() const

◆ lengthSquared()

double SkDVector::lengthSquared ( ) const
inline

Definition at line 86 of file SkPathOpsPoint.h.

86 {
87 return fX * fX + fY * fY;
88 }

◆ normalize()

SkDVector & SkDVector::normalize ( )
inline

Definition at line 90 of file SkPathOpsPoint.h.

90 {
91 double inverseLength = sk_ieee_double_divide(1, this->length());
92 fX *= inverseLength;
93 fY *= inverseLength;
94 return *this;
95 }
static constexpr double sk_ieee_double_divide(double numer, double denom)
double length() const

◆ operator*=()

void SkDVector::operator*= ( const double  s)
inline

Definition at line 48 of file SkPathOpsPoint.h.

48 {
49 fX *= s;
50 fY *= s;
51 }
struct MyStruct s

◆ operator+=()

void SkDVector::operator+= ( const SkDVector v)
inline

Definition at line 30 of file SkPathOpsPoint.h.

30 {
31 fX += v.fX;
32 fY += v.fY;
33 }

◆ operator-=()

void SkDVector::operator-= ( const SkDVector v)
inline

Definition at line 36 of file SkPathOpsPoint.h.

36 {
37 fX -= v.fX;
38 fY -= v.fY;
39 }

◆ operator/=()

void SkDVector::operator/= ( const double  s)
inline

Definition at line 42 of file SkPathOpsPoint.h.

42 {
43 fX /= s;
44 fY /= s;
45 }

◆ set()

SkDVector & SkDVector::set ( const SkVector pt)
inline

Definition at line 23 of file SkPathOpsPoint.h.

23 {
24 fX = pt.fX;
25 fY = pt.fY;
26 return *this;
27 }
float fX
x-axis value
float fY
y-axis value

Member Data Documentation

◆ fX

double SkDVector::fX

Definition at line 20 of file SkPathOpsPoint.h.

◆ fY

double SkDVector::fY

Definition at line 21 of file SkPathOpsPoint.h.


The documentation for this struct was generated from the following file: