cgv
|
template class implementing the part of the view that depends on whether the pointer is const or not and manages the data pointer itself. More...
#include <data_view.h>
Public Member Functions | |
data_view_impl (const data_format *_format=0, typename cgv::type::func::transfer_const< P, void * >::type _data_ptr=0) | |
construct a data view from the given format, viewing the complete data set | |
bool | empty () const |
return whether the data pointer is a null pointer | |
template<typename S > | |
cgv::type::func::transfer_const< P, S * >::type | get_ptr () const |
return a data pointer to type S | |
template<typename S > | |
cgv::type::func::transfer_const< P, S * >::type | get_ptr (size_t i) const |
return a pointer to type S for i-th data entry | |
template<typename S > | |
cgv::type::func::transfer_const< P, S * >::type | get_ptr (size_t i, size_t j) const |
return a pointer to type S for (i,j)-th data entry | |
template<typename S > | |
cgv::type::func::transfer_const< P, S * >::type | get_ptr (size_t i, size_t j, size_t k) const |
return a pointer to type S for (i,j,k)-th data entry | |
template<typename S > | |
cgv::type::func::transfer_const< P, S * >::type | get_ptr (size_t i, size_t j, size_t k, size_t l) const |
return a pointer to type S for (i,j,k,l)-th data entry | |
template<typename S > | |
S | get (unsigned ci) const |
constant access to the ci-th component | |
template<typename S > | |
S | get (unsigned ci, size_t i) const |
constant access to the ci-th component of i-th data entry | |
template<typename S > | |
S | get (unsigned ci, size_t i, size_t j) const |
constant access to the ci-th component of (i,j)-th data entry | |
template<typename S > | |
S | get (unsigned ci, size_t i, size_t j, size_t k) const |
constant access to the ci-th component of (i,j,k)-th data entry | |
template<typename S > | |
S | get (unsigned ci, size_t i, size_t j, size_t k, size_t l) const |
constant access to the ci-th component of (i,j,k,l)-th data entry | |
D | operator() (size_t i) const |
access to i-th data entry | |
D | operator() (size_t i, size_t j) const |
access to entry at (i,j) | |
D | operator() (size_t i, size_t j, size_t k) const |
access to entry at (i,j,k) | |
D | operator() (size_t i, size_t j, size_t k, size_t l) const |
access to entry at (i,j,k,l) | |
D | permute (const std::string &permutation) const |
permute the order of the indices, where the permutation argument "kji" implies that after the permutation the operator (i,j,k) returns the same as the operator (k,j,i) before the call to permute. | |
D | transpose () const |
transpose is equivalent to permute("ji") | |
template<typename S > | |
cgv::type::func::transfer_const< P, S * >::type | step_i (S *ptr, std::ptrdiff_t n=1) const |
return a pointer that points to the n-th next location if index i is increase by n | |
template<typename S > | |
cgv::type::func::transfer_const< P, S * >::type | step_j (S *ptr, std::ptrdiff_t n=1) const |
return a pointer that points to the n-th next location if index j is increase by n | |
template<typename S > | |
cgv::type::func::transfer_const< P, S * >::type | step_k (S *ptr, std::ptrdiff_t n=1) const |
return a pointer that points to the n-th next location if index k is increase by n | |
template<typename S > | |
cgv::type::func::transfer_const< P, S * >::type | step_l (S *ptr, std::ptrdiff_t n=1) const |
return a pointer that points to the n-th next location if index l is increase by n | |
![]() | |
data_view_base (const data_format *_format=0) | |
construct the base of a data view from the given format, such that the step sizes and dimension are set to view the complete data set defined in the format. | |
virtual | ~data_view_base () |
delete format if it is owned | |
void | manage_format (bool enable=true) |
whether to manage the data format pointer | |
const data_format * | get_format () const |
return the component format | |
void | set_format (const data_format *_format) |
set a new data format | |
unsigned int | get_dim () const |
return the dimension of the data view, which is less or equal to the dimension of the data format | |
size_t | get_step_size (unsigned int dim) const |
return the step size in bytes in the i-th dimension | |
Protected Member Functions | |
data_view_impl (const data_format *_format, P _data_ptr, unsigned _dim, const size_t *_step_sizes) | |
constructor used to construct sub views onto the data view | |
![]() | |
data_view_base (const data_format *_format, unsigned int _dim, const size_t *_step_sizes) | |
constructor used to construct sub views onto the data view | |
Protected Attributes | |
P | data_ptr |
data pointer of type unsigned char or const unsigned char | |
![]() | |
const data_format * | format |
bool | owns_format |
whether to own the data format | |
unsigned int | dim |
size_t | step_sizes [4] |
template class implementing the part of the view that depends on whether the pointer is const or not and manages the data pointer itself.
Definition at line 47 of file data_view.h.
|
protected |
constructor used to construct sub views onto the data view
Definition at line 94 of file data_view.cxx.
cgv::data::data_view_impl< D, P >::data_view_impl | ( | const data_format * | _format = 0 , |
typename cgv::type::func::transfer_const< P, void * >::type | _data_ptr = 0 |
||
) |
construct a data view from the given format, viewing the complete data set
Definition at line 100 of file data_view.cxx.
bool cgv::data::data_view_impl< D, P >::empty | ( | ) | const |
return whether the data pointer is a null pointer
Definition at line 106 of file data_view.cxx.
Referenced by cgv::data::data_view::combine_components(), cgv::data::data_view::compose(), cgv::media::video::video_reader::read_frame(), cgv::media::image::image_reader::read_image(), cgv::media::image::image_reader::read_image(), cgv::media::image::image_reader::read_image(), cgv::media::image::image_reader::read_line(), cgv::media::image::image_reader::read_line(), cgv::media::image::image_reader::read_palette(), and cgv::media::image::image_reader::read_palette().
|
inline |
constant access to the ci-th component
Definition at line 86 of file data_view.h.
Referenced by cgv::media::volume::volume::get_voxel_component(), and cgv::media::image::bmp_writer::write_image().
|
inline |
constant access to the ci-th component of i-th data entry
Definition at line 90 of file data_view.h.
|
inline |
constant access to the ci-th component of (i,j)-th data entry
Definition at line 94 of file data_view.h.
|
inline |
constant access to the ci-th component of (i,j,k)-th data entry
Definition at line 98 of file data_view.h.
|
inline |
constant access to the ci-th component of (i,j,k,l)-th data entry
Definition at line 102 of file data_view.h.
|
inline |
return a data pointer to type S
Definition at line 61 of file data_view.h.
Referenced by cgv::media::volume::volume::add_new_component(), cgv::data::data_view::combine_components(), cgv::data::data_view::compose(), cgv::render::texture::create_from_image(), cgv::data::data_view::data_view(), cgv::media::volume::volume::get_data_ptr(), cgv::media::volume::volume::get_data_ptr(), cgv::media::volume::volume::get_row_ptr(), cgv::media::volume::volume::get_row_ptr(), cgv::media::volume::volume::get_slice_ptr(), cgv::media::volume::volume::get_slice_ptr(), cgv::media::volume::volume::get_voxel_ptr(), cgv::media::volume::volume::get_voxel_ptr(), cgv::render::gl::load_texture(), cgv::render::gl::gl_context::read_frame_buffer(), cgv::media::image::bmp_reader::read_line(), cgv::media::image::bmp_reader::read_palette(), cgv::media::volume::volume::replace_component(), cgv::render::gl::replace_texture(), cgv::render::gl::image_drawable::save_images(), cgv::media::volume::volume::volume(), cgv::render::context::write_frame_buffer_to_image(), cgv::media::image::bmp_writer::write_image(), and cgv::render::texture::write_to_file().
|
inline |
return a pointer to type S for i-th data entry
Definition at line 66 of file data_view.h.
|
inline |
return a pointer to type S for (i,j)-th data entry
Definition at line 71 of file data_view.h.
|
inline |
return a pointer to type S for (i,j,k)-th data entry
Definition at line 76 of file data_view.h.
|
inline |
return a pointer to type S for (i,j,k,l)-th data entry
Definition at line 81 of file data_view.h.
D cgv::data::data_view_impl< D, P >::operator() | ( | size_t | i | ) | const |
access to i-th data entry
Definition at line 111 of file data_view.cxx.
D cgv::data::data_view_impl< D, P >::operator() | ( | size_t | i, |
size_t | j | ||
) | const |
access to entry at (i,j)
Definition at line 121 of file data_view.cxx.
D cgv::data::data_view_impl< D, P >::operator() | ( | size_t | i, |
size_t | j, | ||
size_t | k | ||
) | const |
access to entry at (i,j,k)
Definition at line 131 of file data_view.cxx.
D cgv::data::data_view_impl< D, P >::operator() | ( | size_t | i, |
size_t | j, | ||
size_t | k, | ||
size_t | l | ||
) | const |
access to entry at (i,j,k,l)
Definition at line 141 of file data_view.cxx.
D cgv::data::data_view_impl< D, P >::permute | ( | const std::string & | permutation | ) | const |
permute the order of the indices, where the permutation argument "kji" implies that after the permutation the operator (i,j,k) returns the same as the operator (k,j,i) before the call to permute.
The permutation string must have at least two entries. If it has n entries it must contain each of the first n letters of "ijkl" exactly once, i.e. "ik" would be invalid, whereas "ikj" is a valid permutation.
Definition at line 151 of file data_view.cxx.
|
inline |
return a pointer that points to the n-th next location if index i is increase by n
Definition at line 126 of file data_view.h.
|
inline |
return a pointer that points to the n-th next location if index j is increase by n
Definition at line 130 of file data_view.h.
|
inline |
return a pointer that points to the n-th next location if index k is increase by n
Definition at line 134 of file data_view.h.
|
inline |
return a pointer that points to the n-th next location if index l is increase by n
Definition at line 138 of file data_view.h.
|
inline |
transpose is equivalent to permute("ji")
Definition at line 121 of file data_view.h.
|
protected |
data pointer of type unsigned char or const unsigned char
Definition at line 51 of file data_view.h.
Referenced by cgv::data::const_data_view::operator=(), and cgv::data::data_view::operator=().