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

#include <MemManager.h>

Inheritance diagram for grk::grk_buf2d< T, A >:
grk::grk_buf< T, A > grk::grk_rect< uint32_t >

Public Member Functions

 grk_buf2d (T *buffer, bool ownsData, uint32_t w, uint32_t strd, uint32_t h)
 
 grk_buf2d (uint32_t w, uint32_t strd, uint32_t h)
 
 grk_buf2d (uint32_t w, uint32_t h)
 
 grk_buf2d (const grk_rect32 *b)
 
 grk_buf2d (void)
 
 grk_buf2d (const grk_buf2d &rhs)
 
grk_buf2d_simple< T > simple (void) const
 
grk_buf2d_simple< float > simpleF (void) const
 
grk_buf2doperator= (const grk_buf2d &rhs)
 
grk_buf2doperator= (const grk_buf2d *rhs)
 
virtual ~grk_buf2d ()=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 (grk_rect32 win)
 Returns whether window bounds are valid (non empty and within buffer bounds) More...
 
bool read (grk_rect32 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 (grk_rect32 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 grk_buf2d &rhs, F filter)
 
T * getBuffer (void) const
 
- Public Member Functions inherited from grk::grk_rect< uint32_t >
 grk_rect (uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1)
 
 grk_rect (const grk_rect &rhs)
 
 grk_rect (const grk_rect *rhs)
 
 grk_rect (void)
 
virtual ~grk_rect ()=default
 
virtual void print (void) const
 
std::string boundsString () const
 
bool valid (void) const
 
bool empty (void) const
 
bool contains (grk_pt< uint32_t > pt)
 
grk_rect< uint32_t > & operator= (const grk_rect< uint32_t > &rhs)
 
grk_rect< uint32_t > & operator= (const grk_rect< uint32_t > *rhs)
 
bool operator== (const grk_rect< uint32_t > &rhs) const
 
void set (grk_rect< uint32_t > *rhs)
 
void set (grk_rect< uint32_t > rhs)
 
grk_rect< uint32_t > scaleDownCeil (uint32_t den) const
 
grk_rect< uint32_t > scaleDownCeil (uint64_t denx, uint64_t deny) const
 
grk_rect< uint32_t > scale (uint32_t scalex, uint32_t scaley) const
 
grk_rect< uint32_t > scaleDown (uint64_t denx, uint64_t deny) const
 
grk_rect< uint32_t > scaleDownPow2 (uint32_t powx, uint32_t powy) const
 
grk_rect< uint32_t > scaleDownPow2 (grk_pt< uint32_t > pow) const
 
grk_rect< uint32_t > scaleDownCeilPow2 (uint32_t power) const
 
grk_rect< uint32_t > scaleDownCeilPow2 (uint32_t powx, uint32_t powy) const
 
grk_rect< uint32_t > intersection (const grk_rect< uint32_t > rhs) const
 
grk_rect< uint32_t > intersection (const grk_rect< uint32_t > *rhs) const
 
bool isContainedIn (const grk_rect< uint32_t > rhs) const
 
grk_rect< uint32_t > clip (const grk_rect< uint32_t > *rhs) const
 
grk_rect< uint32_t > clip (const grk_rect< uint32_t > &rhs) const
 
void clipIPL (const grk_rect< uint32_t > *rhs)
 
bool nonEmptyIntersection (const grk_rect< uint32_t > *rhs) const
 
grk_rect< uint32_t > rectUnion (const grk_rect< uint32_t > *rhs) const
 
grk_rect< uint32_t > rectUnion (const grk_rect< uint32_t > &rhs) const
 
uint64_t area (void) const
 
uint32_t width () const
 
uint32_t height () const
 
grk_line< uint32_t > dimX () const
 
grk_line< uint32_t > dimY () const
 
grk_rect< uint32_t > pan (int64_t x, int64_t y) const
 
grk_rect< uint32_t > & growIPL (uint32_t boundary)
 
grk_rect< uint32_t > & growIPL (uint32_t boundaryx, uint32_t boundaryy)
 
grk_rect< uint32_t > & growIPL (uint32_t boundary, uint32_t maxX, uint32_t maxY)
 
grk_rect< uint32_t > & growIPL (uint32_t boundaryx, uint32_t boundaryy, uint32_t maxX, uint32_t maxY)
 
grk_rect< uint32_t > & growIPL (uint32_t boundary, grk_rect< uint32_t > bounds)
 
grk_rect< uint32_t > & growIPL (uint32_t boundaryx, uint32_t boundaryy, grk_rect< uint32_t > bounds)
 
uint32_t parityX (void) const
 
uint32_t parityY (void) const
 

Public Attributes

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

Additional Inherited Members

- Protected Member Functions inherited from grk::grk_buf< T, A >
 grk_buf (T *buffer, size_t off, size_t length, bool ownsData)
 
 grk_buf (T *buffer, size_t length)
 
 grk_buf ()
 
 grk_buf (T *buffer, size_t length, bool ownsData)
 
virtual ~grk_buf ()
 
 grk_buf (const grk_buf &rhs)
 
grk_bufoperator= (const grk_buf &rhs)
 
grk_bufoperator= (const grk_buf *rhs)
 
bool canRead (void)
 
read (void)
 
bool write (T val)
 
bool write (T *b, size_t size)
 
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
 
- Protected Member Functions inherited from grk::grk_rect< uint32_t >
 grk_rect (uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1)
 
 grk_rect (const grk_rect &rhs)
 
 grk_rect (const grk_rect *rhs)
 
 grk_rect (void)
 
virtual ~grk_rect ()=default
 
virtual void print (void) const
 
std::string boundsString () const
 
bool valid (void) const
 
bool empty (void) const
 
bool contains (grk_pt< uint32_t > pt)
 
grk_rect< uint32_t > & operator= (const grk_rect< uint32_t > &rhs)
 
grk_rect< uint32_t > & operator= (const grk_rect< uint32_t > *rhs)
 
bool operator== (const grk_rect< uint32_t > &rhs) const
 
void set (grk_rect< uint32_t > *rhs)
 
void set (grk_rect< uint32_t > rhs)
 
grk_rect< uint32_t > scaleDownCeil (uint32_t den) const
 
grk_rect< uint32_t > scaleDownCeil (uint64_t denx, uint64_t deny) const
 
grk_rect< uint32_t > scale (uint32_t scalex, uint32_t scaley) const
 
grk_rect< uint32_t > scaleDown (uint64_t denx, uint64_t deny) const
 
grk_rect< uint32_t > scaleDownPow2 (uint32_t powx, uint32_t powy) const
 
grk_rect< uint32_t > scaleDownPow2 (grk_pt< uint32_t > pow) const
 
grk_rect< uint32_t > scaleDownCeilPow2 (uint32_t power) const
 
grk_rect< uint32_t > scaleDownCeilPow2 (uint32_t powx, uint32_t powy) const
 
grk_rect< uint32_t > intersection (const grk_rect< uint32_t > rhs) const
 
grk_rect< uint32_t > intersection (const grk_rect< uint32_t > *rhs) const
 
bool isContainedIn (const grk_rect< uint32_t > rhs) const
 
grk_rect< uint32_t > clip (const grk_rect< uint32_t > *rhs) const
 
grk_rect< uint32_t > clip (const grk_rect< uint32_t > &rhs) const
 
void clipIPL (const grk_rect< uint32_t > *rhs)
 
bool nonEmptyIntersection (const grk_rect< uint32_t > *rhs) const
 
grk_rect< uint32_t > rectUnion (const grk_rect< uint32_t > *rhs) const
 
grk_rect< uint32_t > rectUnion (const grk_rect< uint32_t > &rhs) const
 
uint64_t area (void) const
 
uint32_t width () const
 
uint32_t height () const
 
grk_line< uint32_t > dimX () const
 
grk_line< uint32_t > dimY () const
 
grk_rect< uint32_t > pan (int64_t x, int64_t y) const
 
grk_rect< uint32_t > & growIPL (uint32_t boundary)
 
grk_rect< uint32_t > & growIPL (uint32_t boundaryx, uint32_t boundaryy)
 
grk_rect< uint32_t > & growIPL (uint32_t boundary, uint32_t maxX, uint32_t maxY)
 
grk_rect< uint32_t > & growIPL (uint32_t boundaryx, uint32_t boundaryy, uint32_t maxX, uint32_t maxY)
 
grk_rect< uint32_t > & growIPL (uint32_t boundary, grk_rect< uint32_t > bounds)
 
grk_rect< uint32_t > & growIPL (uint32_t boundaryx, uint32_t boundaryy, grk_rect< uint32_t > bounds)
 
uint32_t parityX (void) const
 
uint32_t parityY (void) const
 
- Protected Attributes inherited from grk::grk_buf< T, A >
T * buf
 
size_t offset
 
size_t len
 
bool owns_data
 
- Protected Attributes inherited from grk::grk_rect< uint32_t >
uint32_t x0
 
uint32_t y0
 
uint32_t x1
 
uint32_t y1
 

Constructor & Destructor Documentation

◆ grk_buf2d() [1/6]

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

◆ grk_buf2d() [2/6]

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

◆ grk_buf2d() [3/6]

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

◆ grk_buf2d() [4/6]

template<typename T , template< typename TT > typename A>
grk::grk_buf2d< T, A >::grk_buf2d ( const grk_rect32 b)
inlineexplicit

◆ grk_buf2d() [5/6]

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

◆ grk_buf2d() [6/6]

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

◆ ~grk_buf2d()

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

Member Function Documentation

◆ acquire()

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

◆ alloc2d()

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

◆ attach()

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

◆ copy()

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

◆ copy_data()

template<typename T , template< typename TT > typename A>
bool grk::grk_buf2d< 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::grk_buf2d< T, A >::getBuffer ( void  ) const
inline

◆ isWindowValid()

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

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

Parameters
winwindow.
Returns
true or false.

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

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ read()

template<typename T , template< typename TT > typename A>
bool grk::grk_buf2d< T, A >::read ( grk_rect32  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_UNUSED, and grk::grk_buf2d< T, A >::isWindowValid().

◆ simple()

template<typename T , template< typename TT > typename A>
grk_buf2d_simple<T> grk::grk_buf2d< T, A >::simple ( void  ) const
inline

◆ simpleF()

template<typename T , template< typename TT > typename A>
grk_buf2d_simple<float> grk::grk_buf2d< T, A >::simpleF ( void  ) const
inline

◆ transfer()

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

◆ write()

template<typename T , template< typename TT > typename A>
bool grk::grk_buf2d< T, A >::write ( grk_rect32  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_UNUSED, and grk::grk_buf2d< T, A >::isWindowValid().

Member Data Documentation

◆ stride

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

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