Grok  9.5.0
Public Member Functions | Public Attributes | List of all members
grk::grkBuffer2d< T, A > Struct Template Reference

#include <MemManager.h>

Inheritance diagram for grk::grkBuffer2d< T, A >:
grk::grkBuffer< T, A > grk::grkRect< uint32_t >

Public Member Functions

 grkBuffer2d (T *buffer, bool ownsData, uint32_t w, uint32_t strd, uint32_t h)
 
 grkBuffer2d (uint32_t w, uint32_t strd, uint32_t h)
 
 grkBuffer2d (uint32_t w, uint32_t h)
 
 grkBuffer2d (const grkRectU32 *b)
 
 grkBuffer2d (void)
 
 grkBuffer2d (const grkBuffer2d &rhs)
 
grkBuffer2doperator= (const grkBuffer2d &rhs)
 
grkBuffer2doperator= (const grkBuffer2d *rhs)
 
virtual ~grkBuffer2d ()=default
 
bool alloc2d (bool clear)
 
void attach (T *buffer, uint32_t strd)
 
void acquire (T *buffer, uint32_t strd)
 
void transfer (T **buffer, uint32_t *strd)
 
bool isWindowValid (grkRectU32 win)
 Returns whether window bounds are valid (non empty and within buffer bounds) More...
 
bool read (grkRectU32 window, int32_t *dest, const uint32_t destColStride, const uint32_t destStride)
 Read the contents of a rectangular window into a user buffer. More...
 
bool write (grkRectU32 window, const int32_t *src, const uint32_t srcColStride, const uint32_t srcStride)
 Write the contents of a rectangular window from a user buffer. More...
 
bool copy_data (T *dest, uint32_t dest_w, uint32_t dest_h, uint32_t dest_stride) const
 
template<typename F >
void copy (const grkBuffer2d &rhs, F filter)
 
T * getBuffer (void) const
 
- Public Member Functions inherited from grk::grkRect< uint32_t >
 grkRect (uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1)
 
 grkRect (const grkRect &rhs)
 
 grkRect (void)
 
void print (void) const
 
std::string boundsString ()
 
bool is_valid (void) const
 
bool non_empty (void) const
 
bool contains (grkPoint< uint32_t > pt)
 
grkRect< uint32_t > & operator= (const grkRect< uint32_t > &rhs)
 
grkRect< uint32_t > & operator= (const grkRect< uint32_t > *rhs)
 
bool operator== (const grkRect< uint32_t > &rhs) const
 
void set (grkRect< uint32_t > *rhs)
 
void set (grkRect< uint32_t > rhs)
 
grkRect< uint32_t > rectceildivpow2 (uint32_t power) const
 
grkRect< uint32_t > rectceildiv (uint32_t den) const
 
grkRect< uint32_t > rectceildiv (uint32_t denx, uint32_t deny) const
 
grkRect< uint32_t > intersection (const grkRect< uint32_t > rhs) const
 
grkRect< uint32_t > intersection (const grkRect< uint32_t > *rhs) const
 
bool isContainedIn (const grkRect< uint32_t > rhs) const
 
void clip (const grkRect< uint32_t > *rhs)
 
bool non_empty_intersection (const grkRect< uint32_t > *rhs) const
 
grkRect< uint32_t > rectUnion (const grkRect< uint32_t > *rhs) const
 
grkRect< uint32_t > rectUnion (const grkRect< uint32_t > &rhs) const
 
uint64_t area (void) const
 
uint32_t width () const
 
uint32_t height () const
 
grkLine< uint32_t > dimX ()
 
grkLine< uint32_t > dimY ()
 
grkRect< uint32_t > pan (int64_t x, int64_t y) const
 
void panInplace (int64_t x, int64_t y)
 
grkRect< uint32_t > & grow (uint32_t boundary)
 
grkRect< uint32_t > & grow (uint32_t boundaryx, uint32_t boundaryy)
 
grkRect< uint32_t > & grow (uint32_t boundary, uint32_t maxX, uint32_t maxY)
 
grkRect< uint32_t > & grow (uint32_t boundaryx, uint32_t boundaryy, uint32_t maxX, uint32_t maxY)
 
grkRect< uint32_t > & grow (uint32_t boundary, grkRect< uint32_t > bounds)
 
grkRect< uint32_t > & grow (uint32_t boundaryx, uint32_t boundaryy, grkRect< uint32_t > bounds)
 
uint32_t parityX (void)
 
uint32_t parityY (void)
 

Public Attributes

uint32_t stride
 
- Public Attributes inherited from grk::grkRect< uint32_t >
uint32_t x0
 
uint32_t y0
 
uint32_t x1
 
uint32_t y1
 

Additional Inherited Members

- Private Member Functions inherited from grk::grkBuffer< T, A >
 grkBuffer (T *buffer, size_t off, size_t length, bool ownsData)
 
 grkBuffer (T *buffer, size_t length)
 
 grkBuffer ()
 
 grkBuffer (T *buffer, size_t length, bool ownsData)
 
virtual ~grkBuffer ()
 
 grkBuffer (const grkBuffer &rhs)
 
grkBufferoperator= (const grkBuffer &rhs)
 
grkBufferoperator= (const grkBuffer *rhs)
 
virtual bool alloc (size_t length)
 
virtual void dealloc ()
 
void attach (T *buffer)
 
void acquire (T *buffer)
 
void transfer (T **buffer)
 
size_t remainingLength (void)
 
void incrementOffset (ptrdiff_t off)
 
T * currPtr (void) const
 
- Private Attributes inherited from grk::grkBuffer< T, A >
T * buf
 
size_t offset
 
size_t len
 
bool owns_data
 

Constructor & Destructor Documentation

◆ grkBuffer2d() [1/6]

template<typename T , template< typename TT > typename A>
grk::grkBuffer2d< T, A >::grkBuffer2d ( T *  buffer,
bool  ownsData,
uint32_t  w,
uint32_t  strd,
uint32_t  h 
)
inline

◆ grkBuffer2d() [2/6]

template<typename T , template< typename TT > typename A>
grk::grkBuffer2d< T, A >::grkBuffer2d ( uint32_t  w,
uint32_t  strd,
uint32_t  h 
)
inline

◆ grkBuffer2d() [3/6]

template<typename T , template< typename TT > typename A>
grk::grkBuffer2d< T, A >::grkBuffer2d ( uint32_t  w,
uint32_t  h 
)
inline

◆ grkBuffer2d() [4/6]

template<typename T , template< typename TT > typename A>
grk::grkBuffer2d< T, A >::grkBuffer2d ( const grkRectU32 b)
inlineexplicit

◆ grkBuffer2d() [5/6]

template<typename T , template< typename TT > typename A>
grk::grkBuffer2d< T, A >::grkBuffer2d ( void  )
inline

◆ grkBuffer2d() [6/6]

template<typename T , template< typename TT > typename A>
grk::grkBuffer2d< T, A >::grkBuffer2d ( const grkBuffer2d< T, A > &  rhs)
inlineexplicit

◆ ~grkBuffer2d()

template<typename T , template< typename TT > typename A>
virtual grk::grkBuffer2d< T, A >::~grkBuffer2d ( )
virtualdefault

Member Function Documentation

◆ acquire()

template<typename T , template< typename TT > typename A>
void grk::grkBuffer2d< T, A >::acquire ( T *  buffer,
uint32_t  strd 
)
inline

◆ alloc2d()

template<typename T , template< typename TT > typename A>
bool grk::grkBuffer2d< T, A >::alloc2d ( bool  clear)
inline

◆ attach()

template<typename T , template< typename TT > typename A>
void grk::grkBuffer2d< T, A >::attach ( T *  buffer,
uint32_t  strd 
)
inline

◆ copy()

template<typename T , template< typename TT > typename A>
template<typename F >
void grk::grkBuffer2d< T, A >::copy ( const grkBuffer2d< T, A > &  rhs,
filter 
)
inline

◆ copy_data()

template<typename T , template< typename TT > typename A>
bool grk::grkBuffer2d< T, A >::copy_data ( T *  dest,
uint32_t  dest_w,
uint32_t  dest_h,
uint32_t  dest_stride 
) const
inline

◆ getBuffer()

template<typename T , template< typename TT > typename A>
T* grk::grkBuffer2d< T, A >::getBuffer ( void  ) const
inline

◆ isWindowValid()

template<typename T , template< typename TT > typename A>
bool grk::grkBuffer2d< T, A >::isWindowValid ( grkRectU32  win)
inline

Returns whether window bounds are valid (non empty and within buffer bounds)

Parameters
winwindow.
Returns
true or false.

References grk::grkRect< uint32_t >::x0, grk::grkRect< T >::x0, grk::grkRect< T >::x1, grk::grkRect< uint32_t >::x1, grk::grkRect< T >::y0, grk::grkRect< uint32_t >::y1, and grk::grkRect< T >::y1.

Referenced by grk::grkBuffer2d< T, A >::read(), and grk::grkBuffer2d< T, A >::write().

◆ operator=() [1/2]

template<typename T , template< typename TT > typename A>
grkBuffer2d& grk::grkBuffer2d< T, A >::operator= ( const grkBuffer2d< T, A > &  rhs)
inline

◆ operator=() [2/2]

template<typename T , template< typename TT > typename A>
grkBuffer2d& grk::grkBuffer2d< T, A >::operator= ( const grkBuffer2d< T, A > *  rhs)
inline

◆ read()

template<typename T , template< typename TT > typename A>
bool grk::grkBuffer2d< T, A >::read ( grkRectU32  window,
int32_t *  dest,
const uint32_t  destColStride,
const uint32_t  destStride 
)
inline

Read the contents of a rectangular window into a user buffer.

Parameters
windowwindow to read from.
destuser buffer to fill
dest_col_stridespacing (in elements, not in bytes) in x dimension between consecutive elements of the user buffer.
dest_line_stridespacing (in elements, not in bytes) in y dimension between consecutive elements of the user buffer.

References grk::grkBuffer2d< T, A >::isWindowValid().

◆ transfer()

template<typename T , template< typename TT > typename A>
void grk::grkBuffer2d< T, A >::transfer ( T **  buffer,
uint32_t *  strd 
)
inline

◆ write()

template<typename T , template< typename TT > typename A>
bool grk::grkBuffer2d< T, A >::write ( grkRectU32  window,
const int32_t *  src,
const uint32_t  srcColStride,
const uint32_t  srcStride 
)
inline

Write the contents of a rectangular window from a user buffer.

Parameters
window: window to write to buffer
srcuser buffer to fill.
src_col_stridespacing (in elements, not in bytes) in x dimension between consecutive elements of the user buffer.
src_line_stridespacing (in elements, not in bytes) in y dimension between consecutive elements of the user buffer.

References grk::grkBuffer2d< T, A >::isWindowValid().

Member Data Documentation

◆ stride

template<typename T , template< typename TT > typename A>
uint32_t grk::grkBuffer2d< T, A >::stride

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