Skip to content

Commit

Permalink
Added side bar to doxygen
Browse files Browse the repository at this point in the history
  • Loading branch information
tsing committed Feb 7, 2017
1 parent ac30183 commit 19a18f7
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 43 deletions.
2 changes: 2 additions & 0 deletions doc/doxygen.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ STRIP_FROM_PATH = @PROJECT_SOURCE_DIR@/src/lib
INPUT = @doxy_main_page@ \
@PROJECT_SOURCE_DIR@/src/lib

DISABLE_INDEX = NO
GENERATE_TREEVIEW = YES
EXTRACT_ALL = YES
EXTENSION_MAPPING = cu=c++ \
cuh=c++
Expand Down
72 changes: 32 additions & 40 deletions src/lib/core/DynamicBitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace SLS
{
class Dynamic_Bitset{
private:
std::vector<unsigned char> bits;
std::vector<unsigned char> bits; //!< Bytes used to store bits
protected:
const size_t BITS_PER_BYTE;

Expand All @@ -42,41 +42,35 @@ class Dynamic_Bitset{
* http://stackoverflow.com/questions/47981/how-do-you-set-clear-and-toggle-a-single-bit-in-c-c
*/

/**
* @brief Set bit of a char to 1
/*! Set bit of a char to 1
*
* @param ch Char to operate
* @param pos Position within the char
* \param ch Char to operate
* \param pos Position within the char
*/
void setUChar(unsigned char& ch, const size_t &pos) { ch |= 1<<pos; }
/**
* @brief Set bit of a char to 0
/*! Set bit of a char to 0
*
* @param ch Char to operate
* @param pos Position within the char
* \param ch Char to operate
* \param pos Position within the char
*/
void clearUChar(unsigned char& ch, const size_t &pos) { ch &= ~(1<<pos);}

/**
* @brief Get bit of within a char
/*! Get bit of within a char
*
* @param ch Char to query
* @param pos position of bit in char
* \param ch Char to query
* \param pos position of bit in char
*
* @return Ture if 1; otherwise, 0.
* \return Ture if 1; otherwise, 0.
*/
bool getUChar(const unsigned char& ch, const size_t &pos)const {return (ch>>pos)&1;}
public:

/**
* @brief Init an empty bitset
/*! Init an empty bitset
*/
Dynamic_Bitset(): BITS_PER_BYTE{8}{}

/**
* @brief Init an empty bitset with given length
/*! Init an empty bitset with given length
*
* @param sz number of bits
* \param sz number of bits
*/
explicit Dynamic_Bitset(const size_t &sz):BITS_PER_BYTE{8}{resize(sz);}
Dynamic_Bitset(const size_t &sz, unsigned char* b):BITS_PER_BYTE{8}
Expand All @@ -88,62 +82,56 @@ class Dynamic_Bitset{
memcpy( &bits[0], b, sz);
}

/**
* @brief Get number of bits
/*! Get number of bits
*
* @return number of bits
* \return number of bits
*/
virtual size_t size() const {return bits.size()*BITS_PER_BYTE;}

/**
* @brief Resize bit array length, will set bit array to 0
/*! Resize bit array length, will set bit array to 0
*
* @param sz number of bits
* \param sz number of bits
*/
virtual void resize(const size_t &sz) {
bits.resize((sz+BITS_PER_BYTE-1)/ BITS_PER_BYTE, 0);
memset(&(bits[0]), 0, sizeof(unsigned char)*bits.size());
}

/**
* @brief Set a bit to 1
/*! Set a bit to 1
*
* @param pos 0-based position of bit
* \param pos 0-based position of bit
*/
void setBit(const size_t &pos){ //Set the bit to one
if (pos > size())
throw std::out_of_range("bit access out of range");
setUChar(bits[pos/BITS_PER_BYTE], pos%BITS_PER_BYTE);
}

/**
* @brief Set a bit to 0
/*! Set a bit to 0
*
* @param pos 0-based position of bit
* \param pos 0-based position of bit
*/
void clearBit(const size_t &pos){ //Set the bit to zero
if (pos > size())
throw std::out_of_range("bit access out of range");
clearUChar(bits[pos/BITS_PER_BYTE], pos%BITS_PER_BYTE);
}

/**
* @brief Get the value of bit
/*! Get the value of bit
*
* @param pos 0-based position of bit
* \param pos 0-based position of bit
*
* @return Ture if the bit is 1; otherwise, false.
* \return Ture if the bit is 1; otherwise, false.
*/
bool getBit(const size_t &pos) const {
if (pos > size())
throw std::out_of_range("bit access out of range");
return getUChar(bits[pos/BITS_PER_BYTE], pos%BITS_PER_BYTE);
}

/**
* @brief Convert bit array to unsigned int
/*! Convert bit array to unsigned int
*
* @return representation of bit array in unsigned int
* \return representation of bit array in unsigned int
*/
unsigned int to_uint() const
{
Expand All @@ -154,9 +142,14 @@ class Dynamic_Bitset{
res += ((unsigned int)bits[i])<<(i*BITS_PER_BYTE);
return res;
}

/*! Convert bitarray to gray code
*/
glm::uvec2 to_uint_gray () const
{
unsigned num = to_uint(); //Gray code

//TODO: Hack, fix the constant bit size
//Extract lower 10
unsigned yDec = num & 0x3FFU;
//Extract higher 10
Expand All @@ -180,7 +173,6 @@ class Dynamic_Bitset{

std::ostream& operator<<(std::ostream& os, const Dynamic_Bitset& db)
{
//for (size_t i=db.bits.size()-1; i >=0; i--)
for (std::vector<unsigned char>::const_reverse_iterator rit = db.bits.rbegin();
rit != db.bits.rend(); rit++)
os << (std::bitset<8>)(*rit);
Expand Down
7 changes: 6 additions & 1 deletion src/lib/core/PointCloud.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ void exportPointCloud2PLY(std::string fileName, const std::vector<float> &pointC
/*! A point cloud class
*
* The point cloud are stored in raw buffer to faciliate GPU memory access.
* The class can also export point cloud to different file formats
* ```
* +-----------------+
* |X |Y |Z |R |G |B |
* +-----------------+
* ```
* The class can also export point cloud to different file formats.
*/
class PointCloud
{
Expand Down
12 changes: 10 additions & 2 deletions src/lib/core/ReconstructorCPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ class ReconstructorCPU : public Reconstructor {
//! Find intersection of two projector pixel
/*! Each projector pixel contains multiple camera pixels.
* This function takes two buckets from two cameras. Shoot a ray from each
* pixel to find a pair of rays with minimum distance. The midpoints of the
* closest rays are considered intersection points.
* pixel to find a pair of rays with minimum distance. In this function, the
* position of the pixel is calculated by the average position and color of
* all pairs of rays in a projector pixel.
*
* The retrun value is put in a std::array<glm::vec3, 2>, in which the first
* vec3 is the position and the second is the color
Expand All @@ -52,6 +53,13 @@ class ReconstructorCPU : public Reconstructor {
std::array<glm::vec3, 2> intersectionOfBucket_(size_t firstCameraIdx,
size_t secondCameraIdx,
size_t bucketIdx);

/*! Similar to intersectionOfBucket_(), this function finds pair of rays
* with minimu distance to reconstruct the depth.
*
* This function is not used for now since the average method yield more
* structural result.
*/
std::array<glm::vec3, 2> intersectionOfBucketMinDist_(size_t firstCameraIdx,
size_t secondCameraIdx,
size_t bucketIdx);
Expand Down

0 comments on commit 19a18f7

Please sign in to comment.