Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
skvx::Vec< 4, T > Struct Template Reference

#include <SkVx.h>

Public Member Functions

SKVX_ALWAYS_INLINE Vec ()=default
 
SKVX_ALWAYS_INLINE Vec (T s)
 
SKVX_ALWAYS_INLINE Vec (T x, T y, T z, T w)
 
SKVX_ALWAYS_INLINE Vec (Vec< 2, T > xy, T z, T w)
 
SKVX_ALWAYS_INLINE Vec (T x, T y, Vec< 2, T > zw)
 
SKVX_ALWAYS_INLINE Vec (Vec< 2, T > xy, Vec< 2, T > zw)
 
SKVX_ALWAYS_INLINE Vec (std::initializer_list< T > xs)
 
SKVX_ALWAYS_INLINE T operator[] (int i) const
 
SKVX_ALWAYS_INLINE Toperator[] (int i)
 
SKVX_ALWAYS_INLINE void store (void *ptr) const
 
SKVX_ALWAYS_INLINE Vec< 2, T > & xy ()
 
SKVX_ALWAYS_INLINE Vec< 2, T > & zw ()
 
SKVX_ALWAYS_INLINE Tx ()
 
SKVX_ALWAYS_INLINE Ty ()
 
SKVX_ALWAYS_INLINE Tz ()
 
SKVX_ALWAYS_INLINE Tw ()
 
SKVX_ALWAYS_INLINE Vec< 2, Txy () const
 
SKVX_ALWAYS_INLINE Vec< 2, Tzw () const
 
SKVX_ALWAYS_INLINE T x () const
 
SKVX_ALWAYS_INLINE T y () const
 
SKVX_ALWAYS_INLINE T z () const
 
SKVX_ALWAYS_INLINE T w () const
 
SKVX_ALWAYS_INLINE Vec< 4, Tyxwz () const
 
SKVX_ALWAYS_INLINE Vec< 4, Tzwxy () const
 

Static Public Member Functions

static SKVX_ALWAYS_INLINE Vec Load (const void *ptr)
 

Public Attributes

Vec< 2, Tlo
 
Vec< 2, Thi
 

Detailed Description

template<typename T>
struct skvx::Vec< 4, T >

Definition at line 123 of file SkVx.h.

Constructor & Destructor Documentation

◆ Vec() [1/7]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 4, T >::Vec ( )
default

◆ Vec() [2/7]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 4, T >::Vec ( T  s)
inline

Definition at line 127 of file SkVx.h.

127: lo(s), hi(s) {}
struct MyStruct s
Vec< 2, T > hi
Definition SkVx.h:170
Vec< 2, T > lo
Definition SkVx.h:170

◆ Vec() [3/7]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 4, T >::Vec ( T  x,
T  y,
T  z,
T  w 
)
inline

Definition at line 128 of file SkVx.h.

128: lo(x,y), hi(z,w) {}
SKVX_ALWAYS_INLINE T & x()
Definition SkVx.h:154
SKVX_ALWAYS_INLINE T & y()
Definition SkVx.h:155
SKVX_ALWAYS_INLINE T & z()
Definition SkVx.h:156
SKVX_ALWAYS_INLINE T & w()
Definition SkVx.h:157

◆ Vec() [4/7]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 4, T >::Vec ( Vec< 2, T xy,
T  z,
T  w 
)
inline

Definition at line 129 of file SkVx.h.

129: lo(xy), hi(z,w) {}
SKVX_ALWAYS_INLINE Vec< 2, T > & xy()
Definition SkVx.h:152

◆ Vec() [5/7]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 4, T >::Vec ( T  x,
T  y,
Vec< 2, T zw 
)
inline

Definition at line 130 of file SkVx.h.

130: lo(x,y), hi(zw) {}
SKVX_ALWAYS_INLINE Vec< 2, T > & zw()
Definition SkVx.h:153

◆ Vec() [6/7]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 4, T >::Vec ( Vec< 2, T xy,
Vec< 2, T zw 
)
inline

Definition at line 131 of file SkVx.h.

131: lo(xy), hi(zw) {}

◆ Vec() [7/7]

template<typename T >
SKVX_ALWAYS_INLINE skvx::Vec< 4, T >::Vec ( std::initializer_list< T xs)
inline

Definition at line 133 of file SkVx.h.

133 {
134 T vals[4] = {0};
135 assert(xs.size() <= (size_t)4);
136 memcpy(vals, xs.begin(), std::min(xs.size(), (size_t)4)*sizeof(T));
137
138 this->lo = Vec<2,T>::Load(vals + 0);
139 this->hi = Vec<2,T>::Load(vals + 2);
140 }
#define T
static SKVX_ALWAYS_INLINE Vec Load(const void *ptr)
Definition SkVx.h:109

Member Function Documentation

◆ Load()

template<typename T >
static SKVX_ALWAYS_INLINE Vec skvx::Vec< 4, T >::Load ( const void *  ptr)
inlinestatic

Definition at line 145 of file SkVx.h.

145 {
146 return sk_unaligned_load<Vec>(ptr);
147 }

◆ operator[]() [1/2]

template<typename T >
SKVX_ALWAYS_INLINE T & skvx::Vec< 4, T >::operator[] ( int  i)
inline

Definition at line 143 of file SkVx.h.

143{ return i<2 ? this->lo[i] : this->hi[i-2]; }

◆ operator[]() [2/2]

template<typename T >
SKVX_ALWAYS_INLINE T skvx::Vec< 4, T >::operator[] ( int  i) const
inline

Definition at line 142 of file SkVx.h.

142{ return i<2 ? this->lo[i] : this->hi[i-2]; }

◆ store()

template<typename T >
SKVX_ALWAYS_INLINE void skvx::Vec< 4, T >::store ( void *  ptr) const
inline

Definition at line 148 of file SkVx.h.

148 {
149 memcpy(ptr, this, sizeof(Vec));
150 }
SKVX_ALWAYS_INLINE Vec()=default

◆ w() [1/2]

template<typename T >
SKVX_ALWAYS_INLINE T & skvx::Vec< 4, T >::w ( )
inline

Definition at line 157 of file SkVx.h.

157{ return hi.hi.val; }
Vec< 1, T > hi
Definition SkVx.h:210

◆ w() [2/2]

template<typename T >
SKVX_ALWAYS_INLINE T skvx::Vec< 4, T >::w ( ) const
inline

Definition at line 164 of file SkVx.h.

164{ return hi.hi.val; }

◆ x() [1/2]

template<typename T >
SKVX_ALWAYS_INLINE T & skvx::Vec< 4, T >::x ( )
inline

Definition at line 154 of file SkVx.h.

154{ return lo.lo.val; }
Vec< 1, T > lo
Definition SkVx.h:210

◆ x() [2/2]

template<typename T >
SKVX_ALWAYS_INLINE T skvx::Vec< 4, T >::x ( ) const
inline

Definition at line 161 of file SkVx.h.

161{ return lo.lo.val; }

◆ xy() [1/2]

template<typename T >
SKVX_ALWAYS_INLINE Vec< 2, T > & skvx::Vec< 4, T >::xy ( )
inline

Definition at line 152 of file SkVx.h.

152{ return lo; }

◆ xy() [2/2]

template<typename T >
SKVX_ALWAYS_INLINE Vec< 2, T > skvx::Vec< 4, T >::xy ( ) const
inline

Definition at line 159 of file SkVx.h.

159{ return lo; }

◆ y() [1/2]

template<typename T >
SKVX_ALWAYS_INLINE T & skvx::Vec< 4, T >::y ( )
inline

Definition at line 155 of file SkVx.h.

155{ return lo.hi.val; }

◆ y() [2/2]

template<typename T >
SKVX_ALWAYS_INLINE T skvx::Vec< 4, T >::y ( ) const
inline

Definition at line 162 of file SkVx.h.

162{ return lo.hi.val; }

◆ yxwz()

template<typename T >
SKVX_ALWAYS_INLINE Vec< 4, T > skvx::Vec< 4, T >::yxwz ( ) const
inline

Definition at line 167 of file SkVx.h.

167{ return shuffle<1,0,3,2>(*this); }

◆ z() [1/2]

template<typename T >
SKVX_ALWAYS_INLINE T & skvx::Vec< 4, T >::z ( )
inline

Definition at line 156 of file SkVx.h.

156{ return hi.lo.val; }

◆ z() [2/2]

template<typename T >
SKVX_ALWAYS_INLINE T skvx::Vec< 4, T >::z ( ) const
inline

Definition at line 163 of file SkVx.h.

163{ return hi.lo.val; }

◆ zw() [1/2]

template<typename T >
SKVX_ALWAYS_INLINE Vec< 2, T > & skvx::Vec< 4, T >::zw ( )
inline

Definition at line 153 of file SkVx.h.

153{ return hi; }

◆ zw() [2/2]

template<typename T >
SKVX_ALWAYS_INLINE Vec< 2, T > skvx::Vec< 4, T >::zw ( ) const
inline

Definition at line 160 of file SkVx.h.

160{ return hi; }

◆ zwxy()

template<typename T >
SKVX_ALWAYS_INLINE Vec< 4, T > skvx::Vec< 4, T >::zwxy ( ) const
inline

Definition at line 168 of file SkVx.h.

168{ return shuffle<2,3,0,1>(*this); }

Member Data Documentation

◆ hi

template<typename T >
Vec<2,T> skvx::Vec< 4, T >::hi

Definition at line 170 of file SkVx.h.

◆ lo

template<typename T >
Vec<2,T> skvx::Vec< 4, T >::lo

Definition at line 170 of file SkVx.h.


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