Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
SkV4 Struct Reference

#include <SkM44.h>

Public Member Functions

bool operator== (const SkV4 &v) const
 
bool operator!= (const SkV4 &v) const
 
SkV4 operator- () const
 
SkV4 operator+ (const SkV4 &v) const
 
SkV4 operator- (const SkV4 &v) const
 
SkV4 operator* (const SkV4 &v) const
 
SkScalar lengthSquared () const
 
SkScalar length () const
 
SkScalar dot (const SkV4 &v) const
 
SkV4 normalize () const
 
const float * ptr () const
 
float * ptr ()
 
float operator[] (int i) const
 
float & operator[] (int i)
 

Static Public Member Functions

static SkScalar Dot (const SkV4 &a, const SkV4 &b)
 
static SkV4 Normalize (const SkV4 &v)
 

Public Attributes

float x
 
float y
 
float z
 
float w
 

Friends

SkV4 operator* (const SkV4 &v, SkScalar s)
 
SkV4 operator* (SkScalar s, const SkV4 &v)
 

Detailed Description

Definition at line 98 of file SkM44.h.

Member Function Documentation

◆ Dot()

static SkScalar SkV4::Dot ( const SkV4 a,
const SkV4 b 
)
inlinestatic

Definition at line 106 of file SkM44.h.

106 {
107 return a.x*b.x + a.y*b.y + a.z*b.z + a.w*b.w;
108 }
static bool b
struct MyStruct a[10]

◆ dot()

SkScalar SkV4::dot ( const SkV4 v) const
inline

Definition at line 126 of file SkM44.h.

126{ return Dot(*this, v); }
static SkScalar Dot(const SkV4 &a, const SkV4 &b)
Definition: SkM44.h:106

◆ length()

SkScalar SkV4::length ( ) const
inline

Definition at line 124 of file SkM44.h.

124{ return SkScalarSqrt(Dot(*this, *this)); }
#define SkScalarSqrt(x)
Definition: SkScalar.h:42

◆ lengthSquared()

SkScalar SkV4::lengthSquared ( ) const
inline

Definition at line 123 of file SkM44.h.

123{ return Dot(*this, *this); }

◆ normalize()

SkV4 SkV4::normalize ( ) const
inline

Definition at line 127 of file SkM44.h.

127{ return Normalize(*this); }
static SkV4 Normalize(const SkV4 &v)
Definition: SkM44.h:109

◆ Normalize()

static SkV4 SkV4::Normalize ( const SkV4 v)
inlinestatic

Definition at line 109 of file SkM44.h.

109{ return v * (1.0f / v.length()); }
SkScalar length() const
Definition: SkM44.h:124

◆ operator!=()

bool SkV4::operator!= ( const SkV4 v) const
inline

Definition at line 104 of file SkM44.h.

104{ return !(*this == v); }

◆ operator*()

SkV4 SkV4::operator* ( const SkV4 v) const
inline

Definition at line 115 of file SkM44.h.

115 {
116 return { x*v.x, y*v.y, z*v.z, w*v.w };
117 }
float w
Definition: SkM44.h:99
float y
Definition: SkM44.h:99
float x
Definition: SkM44.h:99
float z
Definition: SkM44.h:99

◆ operator+()

SkV4 SkV4::operator+ ( const SkV4 v) const
inline

Definition at line 112 of file SkM44.h.

112{ return { x + v.x, y + v.y, z + v.z, w + v.w }; }

◆ operator-() [1/2]

SkV4 SkV4::operator- ( ) const
inline

Definition at line 111 of file SkM44.h.

111{ return {-x, -y, -z, -w}; }

◆ operator-() [2/2]

SkV4 SkV4::operator- ( const SkV4 v) const
inline

Definition at line 113 of file SkM44.h.

113{ return { x - v.x, y - v.y, z - v.z, w - v.w }; }

◆ operator==()

bool SkV4::operator== ( const SkV4 v) const
inline

Definition at line 101 of file SkM44.h.

101 {
102 return x == v.x && y == v.y && z == v.z && w == v.w;
103 }

◆ operator[]() [1/2]

float & SkV4::operator[] ( int  i)
inline

Definition at line 136 of file SkM44.h.

136 {
137 SkASSERT(i >= 0 && i < 4);
138 return this->ptr()[i];
139 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
const float * ptr() const
Definition: SkM44.h:129

◆ operator[]() [2/2]

float SkV4::operator[] ( int  i) const
inline

Definition at line 132 of file SkM44.h.

132 {
133 SkASSERT(i >= 0 && i < 4);
134 return this->ptr()[i];
135 }

◆ ptr() [1/2]

float * SkV4::ptr ( )
inline

Definition at line 130 of file SkM44.h.

130{ return &x; }

◆ ptr() [2/2]

const float * SkV4::ptr ( ) const
inline

Definition at line 129 of file SkM44.h.

129{ return &x; }

Friends And Related Function Documentation

◆ operator* [1/2]

SkV4 operator* ( const SkV4 v,
SkScalar  s 
)
friend

Definition at line 118 of file SkM44.h.

118 {
119 return { v.x*s, v.y*s, v.z*s, v.w*s };
120 }
struct MyStruct s

◆ operator* [2/2]

SkV4 operator* ( SkScalar  s,
const SkV4 v 
)
friend

Definition at line 121 of file SkM44.h.

121{ return v*s; }

Member Data Documentation

◆ w

float SkV4::w

Definition at line 99 of file SkM44.h.

◆ x

float SkV4::x

Definition at line 99 of file SkM44.h.

◆ y

float SkV4::y

Definition at line 99 of file SkM44.h.

◆ z

float SkV4::z

Definition at line 99 of file SkM44.h.


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