Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
agg::row_accessor< T > Class Template Reference

#include <src/agg/agg_rendering_buffer.h>

Public Types

typedef const_row_info< T > row_data
 

Public Member Functions

 row_accessor ()
 
 row_accessor (T *buf, unsigned width, unsigned height, int stride)
 
void attach (T *buf, unsigned width, unsigned height, int stride)
 
AGG_INLINE T * buf ()
 
AGG_INLINE const T * buf () const
 
AGG_INLINE unsigned width () const
 
AGG_INLINE unsigned height () const
 
AGG_INLINE int stride () const
 
AGG_INLINE unsigned stride_abs () const
 
AGG_INLINE T * row_ptr (int, int y, unsigned)
 
AGG_INLINE T * row_ptr (int y)
 
AGG_INLINE const T * row_ptr (int y) const
 
AGG_INLINE row_data row (int y) const
 
template<class RenBuf >
void copy_from (const RenBuf &src)
 
void clear (T value)
 

Private Attributes

T * m_buf
 
T * m_start
 
unsigned m_width
 
unsigned m_height
 
int m_stride
 

Detailed Description

template<class T>
class agg::row_accessor< T >

Member Typedef Documentation

◆ row_data

template<class T >
typedef const_row_info<T> agg::row_accessor< T >::row_data

Constructor & Destructor Documentation

◆ row_accessor() [1/2]

template<class T >
agg::row_accessor< T >::row_accessor ( )
inline
35 :
36 m_buf(0),
37 m_start(0),
38 m_width(0),
39 m_height(0),
40 m_stride(0)
41 {
42 }
T * m_buf
Definition agg_rendering_buffer.h:131
unsigned m_width
Definition agg_rendering_buffer.h:133
unsigned m_height
Definition agg_rendering_buffer.h:134
T * m_start
Definition agg_rendering_buffer.h:132
int m_stride
Definition agg_rendering_buffer.h:135

◆ row_accessor() [2/2]

template<class T >
agg::row_accessor< T >::row_accessor ( T *  buf,
unsigned  width,
unsigned  height,
int  stride 
)
inline
45 :
46 m_buf(0),
47 m_start(0),
48 m_width(0),
49 m_height(0),
50 m_stride(0)
51 {
53 }
AGG_INLINE T * buf()
Definition agg_rendering_buffer.h:70
void attach(T *buf, unsigned width, unsigned height, int stride)
Definition agg_rendering_buffer.h:57
AGG_INLINE unsigned height() const
Definition agg_rendering_buffer.h:73
AGG_INLINE int stride() const
Definition agg_rendering_buffer.h:74
AGG_INLINE unsigned width() const
Definition agg_rendering_buffer.h:72

References agg::row_accessor< T >::attach(), agg::row_accessor< T >::buf(), agg::row_accessor< T >::height(), agg::row_accessor< T >::stride(), and agg::row_accessor< T >::width().

+ Here is the call graph for this function:

Member Function Documentation

◆ attach()

template<class T >
void agg::row_accessor< T >::attach ( T *  buf,
unsigned  width,
unsigned  height,
int  stride 
)
inline
58 {
59 m_buf = m_start = buf;
60 m_width = width;
63 if(stride < 0)
64 {
65 m_start = m_buf - int(height - 1) * stride;
66 }
67 }

References agg::row_accessor< T >::buf(), agg::row_accessor< T >::height(), agg::row_accessor< T >::m_buf, agg::row_accessor< T >::m_height, agg::row_accessor< T >::m_start, agg::row_accessor< T >::m_stride, agg::row_accessor< T >::m_width, agg::row_accessor< T >::stride(), and agg::row_accessor< T >::width().

Referenced by agg::row_accessor< T >::row_accessor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ buf() [1/2]

template<class T >
AGG_INLINE T * agg::row_accessor< T >::buf ( )
inline
70{ return m_buf; }

References agg::row_accessor< T >::m_buf.

Referenced by agg::row_accessor< T >::row_accessor(), and agg::row_accessor< T >::attach().

+ Here is the caller graph for this function:

◆ buf() [2/2]

template<class T >
AGG_INLINE const T * agg::row_accessor< T >::buf ( ) const
inline
71{ return m_buf; }

References agg::row_accessor< T >::m_buf.

◆ clear()

template<class T >
void agg::row_accessor< T >::clear ( value)
inline
114 {
115 unsigned y;
116 unsigned w = width();
117 unsigned stride = stride_abs();
118 for(y = 0; y < height(); y++)
119 {
120 T* p = row_ptr(0, y, w);
121 unsigned x;
122 for(x = 0; x < stride; x++)
123 {
124 *p++ = value;
125 }
126 }
127 }
AGG_INLINE T * row_ptr(int, int y, unsigned)
Definition agg_rendering_buffer.h:81
AGG_INLINE unsigned stride_abs() const
Definition agg_rendering_buffer.h:75
const Scalar & y
Definition MathFunctions.h:552
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

References agg::row_accessor< T >::height(), agg::row_accessor< T >::row_ptr(), agg::row_accessor< T >::stride(), agg::row_accessor< T >::stride_abs(), and agg::row_accessor< T >::width().

+ Here is the call graph for this function:

◆ copy_from()

template<class T >
template<class RenBuf >
void agg::row_accessor< T >::copy_from ( const RenBuf &  src)
inline
95 {
96 unsigned h = height();
97 if(src.height() < h) h = src.height();
98
99 unsigned l = stride_abs();
100 if(src.stride_abs() < l) l = src.stride_abs();
101
102 l *= sizeof(T);
103
104 unsigned y;
105 unsigned w = width();
106 for (y = 0; y < h; y++)
107 {
108 memcpy(row_ptr(0, y, w), src.row_ptr(y), l);
109 }
110 }

References agg::row_accessor< T >::height(), agg::row_accessor< T >::row_ptr(), agg::row_accessor< T >::stride_abs(), and agg::row_accessor< T >::width().

+ Here is the call graph for this function:

◆ height()

template<class T >
AGG_INLINE unsigned agg::row_accessor< T >::height ( ) const
inline
73{ return m_height; }

References agg::row_accessor< T >::m_height.

Referenced by agg::row_accessor< T >::row_accessor(), agg::row_accessor< T >::attach(), agg::row_accessor< T >::clear(), and agg::row_accessor< T >::copy_from().

+ Here is the caller graph for this function:

◆ row()

template<class T >
AGG_INLINE row_data agg::row_accessor< T >::row ( int  y) const
inline
88 {
89 return row_data(0, m_width-1, row_ptr(y));
90 }
const_row_info< T > row_data
Definition agg_rendering_buffer.h:32

References agg::row_accessor< T >::m_width, and agg::row_accessor< T >::row_ptr().

+ Here is the call graph for this function:

◆ row_ptr() [1/3]

template<class T >
AGG_INLINE T * agg::row_accessor< T >::row_ptr ( int  y)
inline

◆ row_ptr() [2/3]

template<class T >
AGG_INLINE const T * agg::row_accessor< T >::row_ptr ( int  y) const
inline

◆ row_ptr() [3/3]

template<class T >
AGG_INLINE T * agg::row_accessor< T >::row_ptr ( int  ,
int  y,
unsigned   
)
inline
82 {
83 return m_start + y * m_stride;
84 }

References agg::row_accessor< T >::m_start, and agg::row_accessor< T >::m_stride.

Referenced by agg::row_accessor< T >::clear(), agg::row_accessor< T >::copy_from(), and agg::row_accessor< T >::row().

+ Here is the caller graph for this function:

◆ stride()

template<class T >
AGG_INLINE int agg::row_accessor< T >::stride ( ) const
inline
74{ return m_stride; }

References agg::row_accessor< T >::m_stride.

Referenced by agg::row_accessor< T >::row_accessor(), agg::row_accessor< T >::attach(), and agg::row_accessor< T >::clear().

+ Here is the caller graph for this function:

◆ stride_abs()

template<class T >
AGG_INLINE unsigned agg::row_accessor< T >::stride_abs ( ) const
inline
76 {
77 return (m_stride < 0) ? unsigned(-m_stride) : unsigned(m_stride);
78 }

References agg::row_accessor< T >::m_stride.

Referenced by agg::row_accessor< T >::clear(), and agg::row_accessor< T >::copy_from().

+ Here is the caller graph for this function:

◆ width()

template<class T >
AGG_INLINE unsigned agg::row_accessor< T >::width ( ) const
inline
72{ return m_width; }

References agg::row_accessor< T >::m_width.

Referenced by agg::row_accessor< T >::row_accessor(), agg::row_accessor< T >::attach(), agg::row_accessor< T >::clear(), and agg::row_accessor< T >::copy_from().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_buf

◆ m_height

template<class T >
unsigned agg::row_accessor< T >::m_height
private

◆ m_start

◆ m_stride

◆ m_width

template<class T >
unsigned agg::row_accessor< T >::m_width
private

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