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

#include <src/agg/agg_rendering_buffer.h>

+ Collaboration diagram for agg::row_ptr_cache< T >:

Public Types

typedef const_row_info< T > row_data
 

Public Member Functions

 row_ptr_cache ()
 
 row_ptr_cache (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
 
T const *constrows () const
 
template<class RenBuf >
void copy_from (const RenBuf &src)
 
void clear (T value)
 

Private Attributes

T * m_buf
 
pod_array< T * > m_rows
 
unsigned m_width
 
unsigned m_height
 
int m_stride
 

Detailed Description

template<class T>
class agg::row_ptr_cache< T >

Member Typedef Documentation

◆ row_data

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

Constructor & Destructor Documentation

◆ row_ptr_cache() [1/2]

template<class T >
agg::row_ptr_cache< T >::row_ptr_cache ( )
inline
148 :
149 m_buf(0),
150 m_rows(),
151 m_width(0),
152 m_height(0),
153 m_stride(0)
154 {
155 }
unsigned m_width
Definition agg_rendering_buffer.h:263
unsigned m_height
Definition agg_rendering_buffer.h:264
pod_array< T * > m_rows
Definition agg_rendering_buffer.h:262
int m_stride
Definition agg_rendering_buffer.h:265
T * m_buf
Definition agg_rendering_buffer.h:261

◆ row_ptr_cache() [2/2]

template<class T >
agg::row_ptr_cache< T >::row_ptr_cache ( T *  buf,
unsigned  width,
unsigned  height,
int  stride 
)
inline
158 :
159 m_buf(0),
160 m_rows(),
161 m_width(0),
162 m_height(0),
163 m_stride(0)
164 {
166 }
AGG_INLINE int stride() const
Definition agg_rendering_buffer.h:201
void attach(T *buf, unsigned width, unsigned height, int stride)
Definition agg_rendering_buffer.h:169
AGG_INLINE T * buf()
Definition agg_rendering_buffer.h:197
AGG_INLINE unsigned width() const
Definition agg_rendering_buffer.h:199
AGG_INLINE unsigned height() const
Definition agg_rendering_buffer.h:200

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

+ Here is the call graph for this function:

Member Function Documentation

◆ attach()

template<class T >
void agg::row_ptr_cache< T >::attach ( T *  buf,
unsigned  width,
unsigned  height,
int  stride 
)
inline
170 {
171 m_buf = buf;
172 m_width = width;
175 if(height > m_rows.size())
176 {
178 }
179
180 T* row_ptr = m_buf;
181
182 if(stride < 0)
183 {
184 row_ptr = m_buf - int(height - 1) * stride;
185 }
186
187 T** rows = &m_rows[0];
188
189 while(height--)
190 {
191 *rows++ = row_ptr;
192 row_ptr += stride;
193 }
194 }
unsigned size() const
Definition agg_array.h:142
void resize(unsigned size)
Definition agg_array.h:127
T const *const * rows() const
Definition agg_rendering_buffer.h:220
AGG_INLINE T * row_ptr(int, int y, unsigned)
Definition agg_rendering_buffer.h:208

References agg::row_ptr_cache< T >::buf(), agg::row_ptr_cache< T >::height(), agg::row_ptr_cache< T >::m_buf, agg::row_ptr_cache< T >::m_height, agg::row_ptr_cache< T >::m_rows, agg::row_ptr_cache< T >::m_stride, agg::row_ptr_cache< T >::m_width, agg::pod_array< T >::resize(), agg::row_ptr_cache< T >::row_ptr(), agg::row_ptr_cache< T >::rows(), agg::pod_array< T >::size(), agg::row_ptr_cache< T >::stride(), and agg::row_ptr_cache< T >::width().

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

+ 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_ptr_cache< T >::buf ( )
inline
197{ return m_buf; }

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

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

+ Here is the caller graph for this function:

◆ buf() [2/2]

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

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

◆ clear()

template<class T >
void agg::row_ptr_cache< T >::clear ( value)
inline
244 {
245 unsigned y;
246 unsigned w = width();
247 unsigned stride = stride_abs();
248 for(y = 0; y < height(); y++)
249 {
250 T* p = row_ptr(0, y, w);
251 unsigned x;
252 for(x = 0; x < stride; x++)
253 {
254 *p++ = value;
255 }
256 }
257 }
AGG_INLINE unsigned stride_abs() const
Definition agg_rendering_buffer.h:202
const Scalar & y
Definition MathFunctions.h:552
TCoord< P > x(const P &p)
Definition geometry_traits.hpp:297

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

+ Here is the call graph for this function:

◆ copy_from()

template<class T >
template<class RenBuf >
void agg::row_ptr_cache< T >::copy_from ( const RenBuf &  src)
inline
225 {
226 unsigned h = height();
227 if(src.height() < h) h = src.height();
228
229 unsigned l = stride_abs();
230 if(src.stride_abs() < l) l = src.stride_abs();
231
232 l *= sizeof(T);
233
234 unsigned y;
235 unsigned w = width();
236 for (y = 0; y < h; y++)
237 {
238 memcpy(row_ptr(0, y, w), src.row_ptr(y), l);
239 }
240 }

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

+ Here is the call graph for this function:

◆ height()

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

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

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

+ Here is the caller graph for this function:

◆ row()

template<class T >
AGG_INLINE row_data agg::row_ptr_cache< T >::row ( int  y) const
inline
215 {
216 return row_data(0, m_width-1, m_rows[y]);
217 }
const_row_info< T > row_data
Definition agg_rendering_buffer.h:145

References agg::row_ptr_cache< T >::m_rows, and agg::row_ptr_cache< T >::m_width.

◆ row_ptr() [1/3]

template<class T >
AGG_INLINE T * agg::row_ptr_cache< T >::row_ptr ( int  y)
inline
212{ return m_rows[y]; }

References agg::row_ptr_cache< T >::m_rows.

◆ row_ptr() [2/3]

template<class T >
AGG_INLINE const T * agg::row_ptr_cache< T >::row_ptr ( int  y) const
inline
213{ return m_rows[y]; }

References agg::row_ptr_cache< T >::m_rows.

◆ row_ptr() [3/3]

template<class T >
AGG_INLINE T * agg::row_ptr_cache< T >::row_ptr ( int  ,
int  y,
unsigned   
)
inline
209 {
210 return m_rows[y];
211 }

References agg::row_ptr_cache< T >::m_rows.

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

+ Here is the caller graph for this function:

◆ rows()

template<class T >
T const *const * agg::row_ptr_cache< T >::rows ( ) const
inline
220{ return &m_rows[0]; }

References agg::row_ptr_cache< T >::m_rows.

Referenced by agg::row_ptr_cache< T >::attach().

+ Here is the caller graph for this function:

◆ stride()

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

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

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

+ Here is the caller graph for this function:

◆ stride_abs()

template<class T >
AGG_INLINE unsigned agg::row_ptr_cache< T >::stride_abs ( ) const
inline
203 {
204 return (m_stride < 0) ? unsigned(-m_stride) : unsigned(m_stride);
205 }

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

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

+ Here is the caller graph for this function:

◆ width()

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

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

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

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_buf

◆ m_height

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

◆ m_rows

◆ m_stride

◆ m_width

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

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