
#include <Image/ArrayData.H>
Collaboration diagram for ArrayData< T >:

ArrayData implements a 2-D array, by storing:
All of these data members are immutable, with the exception of the reference count. This reflects the semantics that an ArrayData object is a fixed-size block of data; if a higher-level clients wants to resize(), it does so by creating a new ArrayData of the desired size, and releasing the old ArrayData. This simplifies the memory management: within ArrayData, memory is new[]'ed only in the constructor(s), and delete[]'ed only in the destructor.
ArrayData provides the basics needed to use STL-style iterator algorithms. In particular it offers two pairs of functions to get half-open iterator ranges:
Definition at line 173 of file ArrayData.H.
Public Member Functions | |
| ArrayData () | |
| Default construct an empty (i.e. 0-by-0) array. | |
| ArrayData (const Dims &dims, const InitPolicy ip=NO_INIT) | |
| Construct with the specified dimensions and InitPolicy. | |
| ArrayData (const Dims &dims, const InitPolicy ip, const MemoryPolicy mp, const int device) | |
| Construct with the specified dimensions and InitPolicy and Memory Policy. | |
| ArrayData (const Dims &dims, const T *aa) | |
| Construct with the specified dimensions. | |
| ArrayData (const Dims &dims, const T *aa, const MemoryPolicy mp, const int device, const MemoryPolicy srcmp, const int srcdevice) | |
| Construct with the specified dimensions, input data, and memory policy. | |
| ArrayData (const Dims &dims, T *aa, const StoragePolicy s) | |
| Construct with the specified dimensions and storage policy. | |
| ArrayData (const Dims &dims, T *aa, const StoragePolicy s, const MemoryPolicy mp, const int device, const MemoryPolicy srcmp, const int srcdevice) | |
| Construct with the specified dimensions, storage and memory policies. | |
| ArrayData * | clone () const |
| Return a new'ed copy of *this. | |
| ArrayData * | clone (const MemoryPolicy mp, const int device) const |
| Return a new'ed copy of *this using the given memory policy. | |
| ~ArrayData () throw () | |
| Release the pointed-to data if our storage policy is MAKE_OWN_COPY. | |
| const T * | data () const throw () |
| Returns a read-only pointer to the data array. | |
| const T * | end () const throw () |
| Returns a read-only pointer to one-past-the-end of the data array. | |
| T * | dataw () throw () |
| Returns a read-write pointer to the data array (the "w" means "write"). | |
| T * | endw () throw () |
| Returns a read-write pointer to one-past-the-end of the data array. | |
| const Dims & | dims () const throw () |
| Returns the dimensions (i.e. width, height) of the 2-D data array. | |
| int | w () const throw () |
| Returns the width of the data array (i.e. the number of columns). | |
| int | h () const throw () |
| Returns the height of the data array (i.e. the number of rows). | |
| void | acquire () throw () |
| Increment the reference count. | |
| void | release () throw () |
| Decrement the reference count and delete self if the count goes to zero. | |
| bool | isShared () const throw () |
| Query whether this object is shared (i.e. ref count > 1). | |
| int | refCount () const throw () |
| For debugging/testing only. | |
| MemoryPolicy | getMemoryPolicy () const |
| Return memory policy of underlying array data. | |
| int | getMemoryDevice () const |
| Return memory policy of underlying array data. | |
|
|||||||||
|
Default construct an empty (i.e. 0-by-0) array.
Definition at line 661 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_set(). Referenced by ArrayData< T >::clone(). |
|
||||||||||||||||
|
Construct with the specified dimensions and InitPolicy.
Definition at line 675 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_set(), ArrayHelper< T, isTrivial >::minimal_initialize(), Dims::sz(), ArrayHelper< T, isTrivial >::zero_initialize(), and ZEROS. |
|
||||||||||||||||||||||||
|
Construct with the specified dimensions and InitPolicy and Memory Policy.
Definition at line 694 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_set(), ArrayHelper< T, isTrivial >::minimal_initialize(), Dims::sz(), ArrayHelper< T, isTrivial >::zero_initialize(), and ZEROS. |
|
||||||||||||||||
|
Construct with the specified dimensions. If the passed-in T* array is non-null, copy that data into the constructed object. Definition at line 711 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_set(), ArrayHelper< T, isTrivial >::copy_initialize(), and Dims::sz(). |
|
||||||||||||||||||||||||||||||||
|
Construct with the specified dimensions, input data, and memory policy. If the passed-in T* array is non-null, copy that data into the constructed object. Use the given memory policy Definition at line 726 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_set(), ArrayHelper< T, isTrivial >::copy_initialize(), and Dims::sz(). |
|
||||||||||||||||||||
|
Construct with the specified dimensions and storage policy. If the passed-in T* array is non-null, then if the storage policy is MAKE_OWN_COPY we make a copy of the data, but if the storage policy is WRITE_THRU then we "borrow" the data. Definition at line 741 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_set(), ArrayHelper< T, isTrivial >::copy_initialize(), MAKE_OWN_COPY, ArrayHelper< T, isTrivial >::minimal_initialize(), and Dims::sz(). |
|
||||||||||||||||||||||||||||||||||||
|
Construct with the specified dimensions, storage and memory policies. If the passed-in T* array is non-null, then if the storage policy is MAKE_OWN_COPY we make a copy of the data, but if the storage policy is WRITE_THRU then we "borrow" the data. Definition at line 765 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_set(), ArrayHelper< T, isTrivial >::copy_initialize(), LFATAL, MAKE_OWN_COPY, ArrayHelper< T, isTrivial >::minimal_initialize(), and Dims::sz(). |
|
|||||||||
|
Release the pointed-to data if our storage policy is MAKE_OWN_COPY.
Definition at line 812 of file ArrayData.H. References ArrayHelper< T, isTrivial >::destruct(), MAKE_OWN_COPY, Dims::sz(), and wrap_invt_deallocate(). |
|
|||||||||
|
Increment the reference count.
Definition at line 858 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_get(), rutz::mutex_atomic_int::atomic_incr(), and check_acquisition(). |
|
||||||||||||||||
|
Return a new'ed copy of *this using the given memory policy. The cloned copy will always be MAKE_OWN_COPY, even if *this is WRITE_THRU. Definition at line 805 of file ArrayData.H. References ArrayData< T >::ArrayData(). |
|
|||||||||
|
Return a new'ed copy of *this. The cloned copy will always be MAKE_OWN_COPY, even if *this is WRITE_THRU. Definition at line 793 of file ArrayData.H. References ArrayData< T >::ArrayData(), CUDA_HOST_DEVICE_NUM, and HOST_MEMORY. |
|
|||||||||
|
Returns a read-only pointer to the data array. With end(), forms an STL-style half-open const_iterator range. Definition at line 823 of file ArrayData.H. |
|
|||||||||
|
Returns a read-write pointer to the data array (the "w" means "write"). With endw(), forms an STL-style half-open iterator range. Definition at line 833 of file ArrayData.H. Referenced by VideoFrame::fromStream(), VideoFrame::getFlippedHoriz(), VideoFrame::makeBobDeinterlaced(), MgzDecoder::readFrame(), RGB24_to_RGB32(), RGB24_to_RGB555(), RGB24_to_RGB565(), YUV24_to_UYVYx(), YUV24_to_YUV410P(), YUV24_to_YUV411(), YUV24_to_YUV411P(), YUV24_to_YUV420P(), YUV24_to_YUV422P(), YUV24_to_YUV444(), YUV24_to_YUV444P(), YUV24_to_YUYV(), yuv411p_to_VideoFrame(), yuv420p_to_VideoFrame(), and yuv422p_to_VideoFrame(). |
|
|||||||||
|
Returns the dimensions (i.e. width, height) of the 2-D data array.
Definition at line 843 of file ArrayData.H. |
|
|||||||||
|
Returns a read-only pointer to one-past-the-end of the data array. With data(), forms an STL-style half-open const_iterator range. Definition at line 828 of file ArrayData.H. References Dims::sz(). |
|
|||||||||
|
Returns a read-write pointer to one-past-the-end of the data array. With dataw(), forms an STL-style half-open iterator range. Definition at line 838 of file ArrayData.H. References Dims::sz(). Referenced by RGB24_to_RGB32(), RGB24_to_RGB555(), RGB24_to_RGB565(), YUV24_to_UYVYx(), YUV24_to_YUV411(), YUV24_to_YUV444(), and YUV24_to_YUYV(). |
|
|||||||||
|
Return memory policy of underlying array data.
Definition at line 895 of file ArrayData.H. |
|
|||||||||
|
Return memory policy of underlying array data.
Definition at line 888 of file ArrayData.H. |
|
|||||||||
|
Returns the height of the data array (i.e. the number of rows).
Definition at line 853 of file ArrayData.H. References Dims::h(). |
|
|||||||||
|
Query whether this object is shared (i.e. ref count > 1).
Definition at line 874 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_get(). |
|
|||||||||
|
For debugging/testing only. Returns the current reference count. Definition at line 881 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_get(). |
|
|||||||||
|
Decrement the reference count and delete self if the count goes to zero.
Definition at line 867 of file ArrayData.H. References rutz::mutex_atomic_int::atomic_decr_test_zero(). |
|
|||||||||
|
Returns the width of the data array (i.e. the number of columns).
Definition at line 848 of file ArrayData.H. References Dims::w(). |
1.4.4