Prusa MINI Firmware overview
XYval< T > Struct Template Reference

#include <types.h>

Collaboration diagram for XYval< T >:

Public Member Functions

FI void set (const T px)
 
FI void set (const T px, const T py)
 
FI void reset ()
 
FImagnitude () const
 
FI operator T* ()
 
FI operator bool ()
 
FI XYval< T > copy () const
 
FI XYval< T > ABS () const
 
FI XYval< int16_t > asInt ()
 
FI XYval< int16_t > asInt () const
 
FI XYval< int32_t > asLong ()
 
FI XYval< int32_t > asLong () const
 
FI XYval< float > asFloat ()
 
FI XYval< float > asFloat () const
 
FI XYval< float > reciprocal () const
 
FI XYval< float > asLogical () const
 
FI XYval< float > asNative () const
 
FI operator XYZval< T > ()
 
FI operator XYZval< T > () const
 
FI operator XYZEval< T > ()
 
FI operator XYZEval< T > () const
 
FI T & operator[] (const int i)
 
const FI T & operator[] (const int i) const
 
FI XYval< T > & operator= (const T v)
 
FI XYval< T > & operator= (const XYZval< T > &rs)
 
FI XYval< T > & operator= (const XYZEval< T > &rs)
 
FI XYval< T > operator+ (const XYval< T > &rs) const
 
FI XYval< T > operator+ (const XYval< T > &rs)
 
FI XYval< T > operator- (const XYval< T > &rs) const
 
FI XYval< T > operator- (const XYval< T > &rs)
 
FI XYval< T > operator* (const XYval< T > &rs) const
 
FI XYval< T > operator* (const XYval< T > &rs)
 
FI XYval< T > operator/ (const XYval< T > &rs) const
 
FI XYval< T > operator/ (const XYval< T > &rs)
 
FI XYval< T > operator+ (const XYZval< T > &rs) const
 
FI XYval< T > operator+ (const XYZval< T > &rs)
 
FI XYval< T > operator- (const XYZval< T > &rs) const
 
FI XYval< T > operator- (const XYZval< T > &rs)
 
FI XYval< T > operator* (const XYZval< T > &rs) const
 
FI XYval< T > operator* (const XYZval< T > &rs)
 
FI XYval< T > operator/ (const XYZval< T > &rs) const
 
FI XYval< T > operator/ (const XYZval< T > &rs)
 
FI XYval< T > operator+ (const XYZEval< T > &rs) const
 
FI XYval< T > operator+ (const XYZEval< T > &rs)
 
FI XYval< T > operator- (const XYZEval< T > &rs) const
 
FI XYval< T > operator- (const XYZEval< T > &rs)
 
FI XYval< T > operator* (const XYZEval< T > &rs) const
 
FI XYval< T > operator* (const XYZEval< T > &rs)
 
FI XYval< T > operator/ (const XYZEval< T > &rs) const
 
FI XYval< T > operator/ (const XYZEval< T > &rs)
 
FI XYval< T > operator* (const float &v) const
 
FI XYval< T > operator* (const float &v)
 
FI XYval< T > operator* (const int &v) const
 
FI XYval< T > operator* (const int &v)
 
FI XYval< T > operator/ (const float &v) const
 
FI XYval< T > operator/ (const float &v)
 
FI XYval< T > operator/ (const int &v) const
 
FI XYval< T > operator/ (const int &v)
 
FI XYval< T > operator>> (const int &v) const
 
FI XYval< T > operator>> (const int &v)
 
FI XYval< T > operator<< (const int &v) const
 
FI XYval< T > operator<< (const int &v)
 
FI XYval< T > & operator+= (const XYval< T > &rs)
 
FI XYval< T > & operator-= (const XYval< T > &rs)
 
FI XYval< T > & operator*= (const XYval< T > &rs)
 
FI XYval< T > & operator+= (const XYZval< T > &rs)
 
FI XYval< T > & operator-= (const XYZval< T > &rs)
 
FI XYval< T > & operator*= (const XYZval< T > &rs)
 
FI XYval< T > & operator+= (const XYZEval< T > &rs)
 
FI XYval< T > & operator-= (const XYZEval< T > &rs)
 
FI XYval< T > & operator*= (const XYZEval< T > &rs)
 
FI XYval< T > & operator*= (const float &v)
 
FI XYval< T > & operator*= (const int &v)
 
FI XYval< T > & operator>>= (const int &v)
 
FI XYval< T > & operator<<= (const int &v)
 
FI bool operator== (const XYval< T > &rs)
 
FI bool operator== (const XYZval< T > &rs)
 
FI bool operator== (const XYZEval< T > &rs)
 
FI bool operator== (const XYval< T > &rs) const
 
FI bool operator== (const XYZval< T > &rs) const
 
FI bool operator== (const XYZEval< T > &rs) const
 
FI bool operator!= (const XYval< T > &rs)
 
FI bool operator!= (const XYZval< T > &rs)
 
FI bool operator!= (const XYZEval< T > &rs)
 
FI bool operator!= (const XYval< T > &rs) const
 
FI bool operator!= (const XYZval< T > &rs) const
 
FI bool operator!= (const XYZEval< T > &rs) const
 
FI XYval< T > operator- ()
 
const FI XYval< T > operator- () const
 

Public Attributes

union {
   struct {
      T   x
 
      T   y
 
   } 
 
   struct {
      T   a
 
      T   b
 
   } 
 
   T   pos [2]
 
}; 
 

Member Function Documentation

◆ set() [1/2]

template<typename T>
FI void XYval< T >::set ( const px)
189 { x = px; }
Here is the caller graph for this function:

◆ set() [2/2]

template<typename T>
FI void XYval< T >::set ( const px,
const py 
)
190 { x = px; y = py; }

◆ reset()

template<typename T>
FI void XYval< T >::reset ( )
191 { x = y = 0; }

◆ magnitude()

template<typename T>
FI T XYval< T >::magnitude ( ) const
192 { return (T)sqrtf(x*x + y*y); }

◆ operator T*()

template<typename T>
FI XYval< T >::operator T* ( )
193 { return pos; }

◆ operator bool()

template<typename T>
FI XYval< T >::operator bool ( )
194 { return x || y; }

◆ copy()

template<typename T>
FI XYval<T> XYval< T >::copy ( ) const
195 { return *this; }

◆ ABS()

template<typename T>
FI XYval<T> XYval< T >::ABS ( ) const
196 { return { T(_ABS(x)), T(_ABS(y)) }; }

◆ asInt() [1/2]

template<typename T>
FI XYval<int16_t> XYval< T >::asInt ( )
197 { return { int16_t(x), int16_t(y) }; }

◆ asInt() [2/2]

template<typename T>
FI XYval<int16_t> XYval< T >::asInt ( ) const
198 { return { int16_t(x), int16_t(y) }; }

◆ asLong() [1/2]

template<typename T>
FI XYval<int32_t> XYval< T >::asLong ( )
199 { return { int32_t(x), int32_t(y) }; }

◆ asLong() [2/2]

template<typename T>
FI XYval<int32_t> XYval< T >::asLong ( ) const
200 { return { int32_t(x), int32_t(y) }; }

◆ asFloat() [1/2]

template<typename T>
FI XYval<float> XYval< T >::asFloat ( )
201 { return { float(x), float(y) }; }
Here is the caller graph for this function:

◆ asFloat() [2/2]

template<typename T>
FI XYval<float> XYval< T >::asFloat ( ) const
202 { return { float(x), float(y) }; }

◆ reciprocal()

template<typename T>
FI XYval<float> XYval< T >::reciprocal ( ) const
203 { return { _RECIP(x), _RECIP(y) }; }

◆ asLogical()

template<typename T>
FI XYval<float> XYval< T >::asLogical ( ) const
204 { XYval<float> o = asFloat(); toLogical(o); return o; }

◆ asNative()

template<typename T>
FI XYval<float> XYval< T >::asNative ( ) const
205 { XYval<float> o = asFloat(); toNative(o); return o; }

◆ operator XYZval< T >() [1/2]

template<typename T>
FI XYval< T >::operator XYZval< T > ( )
206 { return { x, y }; }

◆ operator XYZval< T >() [2/2]

template<typename T>
FI XYval< T >::operator XYZval< T > ( ) const
207 { return { x, y }; }

◆ operator XYZEval< T >() [1/2]

template<typename T>
FI XYval< T >::operator XYZEval< T > ( )
208 { return { x, y }; }

◆ operator XYZEval< T >() [2/2]

template<typename T>
FI XYval< T >::operator XYZEval< T > ( ) const
209 { return { x, y }; }

◆ operator[]() [1/2]

template<typename T>
FI T& XYval< T >::operator[] ( const int  i)
210 { return pos[i]; }

◆ operator[]() [2/2]

template<typename T>
const FI T& XYval< T >::operator[] ( const int  i) const
211 { return pos[i]; }

◆ operator=() [1/3]

template<typename T>
FI XYval<T>& XYval< T >::operator= ( const v)
212 { set(v, v ); return *this; }

◆ operator=() [2/3]

template<typename T>
FI XYval<T>& XYval< T >::operator= ( const XYZval< T > &  rs)
213 { set(rs.x, rs.y); return *this; }

◆ operator=() [3/3]

template<typename T>
FI XYval<T>& XYval< T >::operator= ( const XYZEval< T > &  rs)
214 { set(rs.x, rs.y); return *this; }

◆ operator+() [1/6]

template<typename T>
FI XYval<T> XYval< T >::operator+ ( const XYval< T > &  rs) const
215 { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }

◆ operator+() [2/6]

template<typename T>
FI XYval<T> XYval< T >::operator+ ( const XYval< T > &  rs)
216 { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }

◆ operator-() [1/8]

template<typename T>
FI XYval<T> XYval< T >::operator- ( const XYval< T > &  rs) const
217 { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }

◆ operator-() [2/8]

template<typename T>
FI XYval<T> XYval< T >::operator- ( const XYval< T > &  rs)
218 { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }

◆ operator*() [1/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const XYval< T > &  rs) const
219 { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }

◆ operator*() [2/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const XYval< T > &  rs)
220 { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }

◆ operator/() [1/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const XYval< T > &  rs) const
221 { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }

◆ operator/() [2/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const XYval< T > &  rs)
222 { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }

◆ operator+() [3/6]

template<typename T>
FI XYval<T> XYval< T >::operator+ ( const XYZval< T > &  rs) const
223 { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }

◆ operator+() [4/6]

template<typename T>
FI XYval<T> XYval< T >::operator+ ( const XYZval< T > &  rs)
224 { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }

◆ operator-() [3/8]

template<typename T>
FI XYval<T> XYval< T >::operator- ( const XYZval< T > &  rs) const
225 { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }

◆ operator-() [4/8]

template<typename T>
FI XYval<T> XYval< T >::operator- ( const XYZval< T > &  rs)
226 { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }

◆ operator*() [3/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const XYZval< T > &  rs) const
227 { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }

◆ operator*() [4/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const XYZval< T > &  rs)
228 { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }

◆ operator/() [3/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const XYZval< T > &  rs) const
229 { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }

◆ operator/() [4/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const XYZval< T > &  rs)
230 { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }

◆ operator+() [5/6]

template<typename T>
FI XYval<T> XYval< T >::operator+ ( const XYZEval< T > &  rs) const
231 { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }

◆ operator+() [6/6]

template<typename T>
FI XYval<T> XYval< T >::operator+ ( const XYZEval< T > &  rs)
232 { XYval<T> ls = *this; ls.x += rs.x; ls.y += rs.y; return ls; }

◆ operator-() [5/8]

template<typename T>
FI XYval<T> XYval< T >::operator- ( const XYZEval< T > &  rs) const
233 { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }

◆ operator-() [6/8]

template<typename T>
FI XYval<T> XYval< T >::operator- ( const XYZEval< T > &  rs)
234 { XYval<T> ls = *this; ls.x -= rs.x; ls.y -= rs.y; return ls; }

◆ operator*() [5/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const XYZEval< T > &  rs) const
235 { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }

◆ operator*() [6/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const XYZEval< T > &  rs)
236 { XYval<T> ls = *this; ls.x *= rs.x; ls.y *= rs.y; return ls; }

◆ operator/() [5/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const XYZEval< T > &  rs) const
237 { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }

◆ operator/() [6/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const XYZEval< T > &  rs)
238 { XYval<T> ls = *this; ls.x /= rs.x; ls.y /= rs.y; return ls; }

◆ operator*() [7/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const float &  v) const
239 { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }

◆ operator*() [8/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const float &  v)
240 { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }

◆ operator*() [9/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const int &  v) const
241 { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }

◆ operator*() [10/10]

template<typename T>
FI XYval<T> XYval< T >::operator* ( const int &  v)
242 { XYval<T> ls = *this; ls.x *= v; ls.y *= v; return ls; }

◆ operator/() [7/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const float &  v) const
243 { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }

◆ operator/() [8/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const float &  v)
244 { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }

◆ operator/() [9/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const int &  v) const
245 { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }

◆ operator/() [10/10]

template<typename T>
FI XYval<T> XYval< T >::operator/ ( const int &  v)
246 { XYval<T> ls = *this; ls.x /= v; ls.y /= v; return ls; }

◆ operator>>() [1/2]

template<typename T>
FI XYval<T> XYval< T >::operator>> ( const int &  v) const
247 { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }

◆ operator>>() [2/2]

template<typename T>
FI XYval<T> XYval< T >::operator>> ( const int &  v)
248 { XYval<T> ls = *this; _RS(ls.x); _RS(ls.y); return ls; }

◆ operator<<() [1/2]

template<typename T>
FI XYval<T> XYval< T >::operator<< ( const int &  v) const
249 { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }

◆ operator<<() [2/2]

template<typename T>
FI XYval<T> XYval< T >::operator<< ( const int &  v)
250 { XYval<T> ls = *this; _LS(ls.x); _LS(ls.y); return ls; }

◆ operator+=() [1/3]

template<typename T>
FI XYval<T>& XYval< T >::operator+= ( const XYval< T > &  rs)
251 { x += rs.x; y += rs.y; return *this; }

◆ operator-=() [1/3]

template<typename T>
FI XYval<T>& XYval< T >::operator-= ( const XYval< T > &  rs)
252 { x -= rs.x; y -= rs.y; return *this; }

◆ operator*=() [1/5]

template<typename T>
FI XYval<T>& XYval< T >::operator*= ( const XYval< T > &  rs)
253 { x *= rs.x; y *= rs.y; return *this; }

◆ operator+=() [2/3]

template<typename T>
FI XYval<T>& XYval< T >::operator+= ( const XYZval< T > &  rs)
254 { x += rs.x; y += rs.y; return *this; }

◆ operator-=() [2/3]

template<typename T>
FI XYval<T>& XYval< T >::operator-= ( const XYZval< T > &  rs)
255 { x -= rs.x; y -= rs.y; return *this; }

◆ operator*=() [2/5]

template<typename T>
FI XYval<T>& XYval< T >::operator*= ( const XYZval< T > &  rs)
256 { x *= rs.x; y *= rs.y; return *this; }

◆ operator+=() [3/3]

template<typename T>
FI XYval<T>& XYval< T >::operator+= ( const XYZEval< T > &  rs)
257 { x += rs.x; y += rs.y; return *this; }

◆ operator-=() [3/3]

template<typename T>
FI XYval<T>& XYval< T >::operator-= ( const XYZEval< T > &  rs)
258 { x -= rs.x; y -= rs.y; return *this; }

◆ operator*=() [3/5]

template<typename T>
FI XYval<T>& XYval< T >::operator*= ( const XYZEval< T > &  rs)
259 { x *= rs.x; y *= rs.y; return *this; }

◆ operator*=() [4/5]

template<typename T>
FI XYval<T>& XYval< T >::operator*= ( const float &  v)
260 { x *= v; y *= v; return *this; }

◆ operator*=() [5/5]

template<typename T>
FI XYval<T>& XYval< T >::operator*= ( const int &  v)
261 { x *= v; y *= v; return *this; }

◆ operator>>=()

template<typename T>
FI XYval<T>& XYval< T >::operator>>= ( const int &  v)
262 { _RS(x); _RS(y); return *this; }

◆ operator<<=()

template<typename T>
FI XYval<T>& XYval< T >::operator<<= ( const int &  v)
263 { _LS(x); _LS(y); return *this; }

◆ operator==() [1/6]

template<typename T>
FI bool XYval< T >::operator== ( const XYval< T > &  rs)
264 { return x == rs.x && y == rs.y; }
Here is the caller graph for this function:

◆ operator==() [2/6]

template<typename T>
FI bool XYval< T >::operator== ( const XYZval< T > &  rs)
265 { return x == rs.x && y == rs.y; }

◆ operator==() [3/6]

template<typename T>
FI bool XYval< T >::operator== ( const XYZEval< T > &  rs)
266 { return x == rs.x && y == rs.y; }

◆ operator==() [4/6]

template<typename T>
FI bool XYval< T >::operator== ( const XYval< T > &  rs) const
267 { return x == rs.x && y == rs.y; }

◆ operator==() [5/6]

template<typename T>
FI bool XYval< T >::operator== ( const XYZval< T > &  rs) const
268 { return x == rs.x && y == rs.y; }

◆ operator==() [6/6]

template<typename T>
FI bool XYval< T >::operator== ( const XYZEval< T > &  rs) const
269 { return x == rs.x && y == rs.y; }

◆ operator!=() [1/6]

template<typename T>
FI bool XYval< T >::operator!= ( const XYval< T > &  rs)
270 { return !operator==(rs); }

◆ operator!=() [2/6]

template<typename T>
FI bool XYval< T >::operator!= ( const XYZval< T > &  rs)
271 { return !operator==(rs); }

◆ operator!=() [3/6]

template<typename T>
FI bool XYval< T >::operator!= ( const XYZEval< T > &  rs)
272 { return !operator==(rs); }

◆ operator!=() [4/6]

template<typename T>
FI bool XYval< T >::operator!= ( const XYval< T > &  rs) const
273 { return !operator==(rs); }

◆ operator!=() [5/6]

template<typename T>
FI bool XYval< T >::operator!= ( const XYZval< T > &  rs) const
274 { return !operator==(rs); }

◆ operator!=() [6/6]

template<typename T>
FI bool XYval< T >::operator!= ( const XYZEval< T > &  rs) const
275 { return !operator==(rs); }

◆ operator-() [7/8]

template<typename T>
FI XYval<T> XYval< T >::operator- ( )
276 { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }

◆ operator-() [8/8]

template<typename T>
const FI XYval<T> XYval< T >::operator- ( ) const
277 { XYval<T> o = *this; o.x = -x; o.y = -y; return o; }

Member Data Documentation

◆ x

template<typename T>
T XYval< T >::x

◆ y

template<typename T>
T XYval< T >::y

◆ a

template<typename T>
T XYval< T >::a

◆ b

template<typename T>
T XYval< T >::b

◆ pos

template<typename T>
T XYval< T >::pos[2]

◆ @2

union { ... }
XYval::asFloat
FI XYval< float > asFloat()
Definition: types.h:201
_RECIP
#define _RECIP(N)
Definition: types.h:92
XYZval::x
T x
Definition: types.h:286
i
uint8_t i
Definition: screen_test_graph.c:72
toNative
void toNative(xy_pos_t &raw)
Definition: motion.h:274
XYval::pos
T pos[2]
Definition: types.h:187
XYval::set
FI void set(const T px)
Definition: types.h:189
_ABS
#define _ABS(N)
Definition: types.h:93
XYZEval::x
T x
Definition: types.h:383
_LS
#define _LS(N)
Definition: types.h:94
XYval
Definition: types.h:99
XYval::x
T x
Definition: types.h:185
XYval::operator==
FI bool operator==(const XYval< T > &rs)
Definition: types.h:264
XYZval::y
T y
Definition: types.h:286
_RS
#define _RS(N)
Definition: types.h:95
XYval::y
T y
Definition: types.h:185
toLogical
void toLogical(xy_pos_t &raw)
Definition: motion.h:271
XYZEval::y
T y
Definition: types.h:383