cgv
Loading...
Searching...
No Matches
cgv::data::data_view_base Class Reference

base class of both implementations of the data view managing the component format, the dimension of the view and the step sizes More...

#include <data_view.h>

Inheritance diagram for cgv::data::data_view_base:
cgv::data::data_view_impl< const_data_view, const unsigned char * > cgv::data::data_view_impl< data_view, unsigned char * > cgv::data::data_view_impl< D, P > cgv::data::const_data_view cgv::data::data_view

Public Member Functions

 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_formatget_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_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

const data_formatformat
 
bool owns_format
 whether to own the data format
 
unsigned int dim
 
size_t step_sizes [4]
 

Detailed Description

base class of both implementations of the data view managing the component format, the dimension of the view and the step sizes

Definition at line 15 of file data_view.h.

Constructor & Destructor Documentation

◆ data_view_base()

cgv::data::data_view_base::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.

Definition at line 40 of file data_view.cxx.

References cgv::data::packing_info::align(), cgv::data::data_format::get_alignment(), cgv::data::component_format::get_entry_size(), cgv::data::data_format::get_nr_dimensions(), and owns_format.

◆ ~data_view_base()

cgv::data::data_view_base::~data_view_base ( )
virtual

delete format if it is owned

Definition at line 65 of file data_view.cxx.

References owns_format.

Member Function Documentation

◆ get_dim()

unsigned int cgv::data::data_view_base::get_dim ( ) const

return the dimension of the data view, which is less or equal to the dimension of the data format

Definition at line 84 of file data_view.cxx.

◆ get_format()

◆ get_step_size()

size_t cgv::data::data_view_base::get_step_size ( unsigned int  dim) const

return the step size in bytes in the i-th dimension

Definition at line 89 of file data_view.cxx.

Referenced by cgv::data::data_view::reflect_horizontally(), and cgv::render::gl::image_drawable::save_images().

◆ manage_format()

void cgv::data::data_view_base::manage_format ( bool  enable = true)

whether to manage the data format pointer

Definition at line 59 of file data_view.cxx.

References owns_format.

Referenced by cgv::render::gl::gl_context::read_frame_buffer().

◆ set_format()

void cgv::data::data_view_base::set_format ( const data_format _format)

set a new data format

Definition at line 78 of file data_view.cxx.

Member Data Documentation

◆ dim

unsigned int cgv::data::data_view_base::dim
protected

Definition at line 21 of file data_view.h.

◆ format

const data_format* cgv::data::data_view_base::format
protected

Definition at line 18 of file data_view.h.

◆ owns_format

bool cgv::data::data_view_base::owns_format
protected

whether to own the data format

Definition at line 20 of file data_view.h.

Referenced by data_view_base(), manage_format(), cgv::data::const_data_view::operator=(), cgv::data::data_view::operator=(), and ~data_view_base().

◆ step_sizes

size_t cgv::data::data_view_base::step_sizes[4]
protected

Definition at line 22 of file data_view.h.


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