Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
agg::rect_base< T > Struct Template Reference

#include <src/agg/agg_basics.h>

+ Inheritance diagram for agg::rect_base< T >:
+ Collaboration diagram for agg::rect_base< T >:

Public Types

typedef T value_type
 
typedef rect_base< T > self_type
 

Public Member Functions

 rect_base ()
 
 rect_base (T x1_, T y1_, T x2_, T y2_)
 
void init (T x1_, T y1_, T x2_, T y2_)
 
const self_typenormalize ()
 
bool clip (const self_type &r)
 
bool is_valid () const
 
bool hit_test (T x, T y) const
 
bool overlaps (const self_type &r) const
 

Public Attributes

x1
 
y1
 
x2
 
y2
 

Detailed Description

template<class T>
struct agg::rect_base< T >

Member Typedef Documentation

◆ self_type

template<class T >
typedef rect_base<T> agg::rect_base< T >::self_type

◆ value_type

template<class T >
typedef T agg::rect_base< T >::value_type

Constructor & Destructor Documentation

◆ rect_base() [1/2]

template<class T >
agg::rect_base< T >::rect_base ( )
inline
289{}

◆ rect_base() [2/2]

template<class T >
agg::rect_base< T >::rect_base ( x1_,
y1_,
x2_,
y2_ 
)
inline
290 :
291 x1(x1_), y1(y1_), x2(x2_), y2(y2_) {}
T y1
Definition agg_basics.h:287
T y2
Definition agg_basics.h:287
T x2
Definition agg_basics.h:287
T x1
Definition agg_basics.h:287

Member Function Documentation

◆ clip()

template<class T >
bool agg::rect_base< T >::clip ( const self_type r)
inline
307 {
308 if(x2 > r.x2) x2 = r.x2;
309 if(y2 > r.y2) y2 = r.y2;
310 if(x1 < r.x1) x1 = r.x1;
311 if(y1 < r.y1) y1 = r.y1;
312 return x1 <= x2 && y1 <= y2;
313 }

References agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

Referenced by agg::pixfmt_alpha_blend_gray< Blender, RenBuf, Step, Offset >::attach(), agg::pixfmt_alpha_blend_rgb< Blender, RenBuf, Step, Offset >::attach(), agg::renderer_base< PixelFormat >::blend_bar(), agg::renderer_base< PixelFormat >::clip_box(), and agg::renderer_base< PixelFormat >::copy_bar().

+ Here is the caller graph for this function:

◆ hit_test()

template<class T >
bool agg::rect_base< T >::hit_test ( x,
y 
) const
inline
321 {
322 return (x >= x1 && x <= x2 && y >= y1 && y <= y2);
323 }

References agg::rect_base< T >::x1, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

◆ init()

template<class T >
void agg::rect_base< T >::init ( x1_,
y1_,
x2_,
y2_ 
)
inline
294 {
295 x1 = x1_; y1 = y1_; x2 = x2_; y2 = y2_;
296 }

References agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

◆ is_valid()

template<class T >
bool agg::rect_base< T >::is_valid ( ) const
inline

◆ normalize()

template<class T >
const self_type & agg::rect_base< T >::normalize ( )
inline
299 {
300 T t;
301 if(x1 > x2) { t = x1; x1 = x2; x2 = t; }
302 if(y1 > y2) { t = y1; y1 = y2; y2 = t; }
303 return *this;
304 }

References agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

Referenced by agg::renderer_base< PixelFormat >::blend_bar(), agg::rasterizer_sl_clip< Conv >::clip_box(), agg::renderer_base< PixelFormat >::clip_box(), and agg::renderer_base< PixelFormat >::copy_bar().

+ Here is the caller graph for this function:

◆ overlaps()

template<class T >
bool agg::rect_base< T >::overlaps ( const self_type r) const
inline
326 {
327 return !(r.x1 > x2 || r.x2 < x1
328 || r.y1 > y2 || r.y2 < y1);
329 }

References agg::rect_base< T >::x1, agg::rect_base< T >::x2, agg::rect_base< T >::y1, and agg::rect_base< T >::y2.

Member Data Documentation

◆ x1

◆ x2

◆ y1

◆ y2


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