#include "rtsVolume.h" rtsVolume::rtsVolume() { m_data = NULL; m_size_x = 0; m_size_y = 0; m_size_z = 0; } rtsVolume::rtsVolume(unsigned int size_x, unsigned int size_y, unsigned int size_z) { m_size_x = size_x; m_size_y = size_y; m_size_z = size_z; //allocate space for the data m_data = new unsigned char[m_size_x * m_size_y * m_size_z]; for(int i=0; iinsert(front_back, 0, 0, 0); this->insert(front_back, 0, 0, m_size_z-1); this->insert(left_right, 0, 0, 0); this->insert(left_right, m_size_x-1, 0, 0); this->insert(top_bottom, 0, 0, 0); this->insert(top_bottom, 0, m_size_y-1, 0); } void rtsVolume::invert() { //inverts the data stored in the volume unsigned int length = m_size_x*m_size_y*m_size_z; for(int i=0; i= threshold) m_data[i] = 255; } void rtsVolume::blit3D(const unsigned char* source, unsigned int s_sx, unsigned int s_sy, unsigned int s_sz, unsigned char* dest, unsigned int d_px, unsigned int d_py, unsigned int d_pz, unsigned int d_sx, unsigned int d_sy, unsigned int d_sz) { unsigned int ps, pd; //stores the mapping for the source point to the dest point //find the maximum points that can be blit to (in case source overlaps the edges of dest) unsigned int blit_size_x = min(s_sx, d_sx - d_px); unsigned int blit_size_y = min(s_sy, d_sy - d_py); unsigned int blit_size_z = min(s_sz, d_sz - d_pz); unsigned int source_z_offset = s_sx * s_sy; unsigned int dest_z_offset = d_sx * d_sy; unsigned int z,y; for(z=0; z