
Public Member Functions | |
| walz () | |
| Ctor. | |
| walz (int const &log2Chunks, double const &truncateThreshold, int const &overviewFactor) | |
| Constructor. | |
| virtual | ~walz () |
| Dtor. | |
| bool | InitRead (std::string const &filename, ParametersWalz ¶m) |
| Initialize reading points from file. | |
| virtual bool | Read (bool &bEOF) |
| Read points from file. | |
| virtual bool | ReadHeader (bool &bEOF) |
| virtual bool | ReadLevel (int &level, bool bEOF, bool bSkip) |
| bool | Compress () |
| Compress. | |
| bool | Uncompress () |
| Uncompress. | |
| bool | InitWrite (std::string const &filename, ParametersWalz ¶m) |
| Write to file. | |
| virtual bool | Write () |
| Write a chunk of data to file. | |
| virtual bool | GetPoints (BoundingBox const &bb, Container &aContainer) |
| Get the points that fall inside a rectangle. | |
| virtual bool | GetOverview (int const &level, Container &aContainer) |
| Get a lower resolution overview. | |
Private Member Functions | |
| int | _GetIndex (double value, int interval) |
| Get index to Huffman histogram. | |
| bool | _AnalyzeHistogram (Vec_ULNG &hX, std::list< int > &breakPointList) |
| void | haar (Vec_IO_DP &a, const int n, const int isign) |
| Haar transform. | |
| void | wtInt (Vec_IO_INT &a, const int n, const int isign) |
| Integer "fake" wavelet (for thematic data). | |
| bool | _DoHuffman () |
| Huffman encode. | |
| bool | _CompressHuffman () |
| Encode one level with Huffman. | |
| bool | _CompressPackBits () |
| Donīt do wavelets, just compress the coordinates by packing the bits. | |
| bool | _CompressPackBitsNoWavelet () |
| Called from walz::_CompressPackBits iff wavelet type is laserlib::EWT_NONE. | |
| bool | _CompressPackBitsWavelet () |
| Called from walz::_CompressPackBits iff wavelet type differs from laserlib::EWT_NONE. | |
| bool | _CompressPackBits (int nStart, int nEnd, BoundingBox &bb, Point3D &Center, unsigned int &DLX, unsigned int &DLY, unsigned int &DLZ, double &stddev, unsigned char *pBuffer) |
| Pack bits within an interval. | |
| bool | _UncompressPackBits () |
| Donīt do wavelets, just uncompress the coordinates by unpacking the bits. | |
| bool | _UncompressPackBitsWavelet () |
| Uncompress a PackBit level with wavelets. | |
| bool | _UncompressPackBitsNoWavelet () |
| Uncompress a PackBit level without wavelets. | |
| bool | _UncompressHuffman () |
| Uncompress a Huffman level. | |
| bool | _PackBitsEncode (unsigned long const &iVal, unsigned char *pBuf, unsigned long &nb, int const &DL) |
| A helper to pack integer bits to a buffer. | |
| bool | _PackBitsDecode (unsigned long &iVal, unsigned char *pBuf, unsigned long &nb, int const &DL) |
| A helper to unpack integer bits from a buffer. | |
| bool | _WriteXYZ () |
| Write in ASCII XYZ format. | |
| bool | _GetBoundingBox (BoundingBox &bb, int const &nStart, int const &nEnd) |
| Get bounding box of coordinates within interval. | |
| bool | _GetDescriptionLength (BoundingBox const &bb, double &stddev, Point3D &DL, unsigned int *iDL) |
| Get bit length for each coordinate. | |
Private Attributes | |
| std::vector< Level > | cvLevel |
| Level * | cpCurrentLevel |
| bool | cbWriteXYZ |
| See _WriteXYZ(). | |
Classes | |
| struct | HuffmanData |
| Data to (re)store huffman coded data. More... | |
| struct | Level |
| Compressed, wavelet transformed level. More... | |
A wavelet based compression format. Uses Numerical Recipes. Associated with the EFileType::EFT_WALZ type.
| walz::walz | ( | ) |
Ctor.
Defaults chunksize to 2**16
| walz::walz | ( | int const & | log2Chunks, | |
| double const & | truncateThreshold, | |||
| int const & | overviewFactor | |||
| ) |
Constructor.
| log2Chunks | log2(N) where N is the number of desired point to be kept as one unit | |
| truncateThreshold | Wavelet coefficients below this value will be truncated when compressing. Already a vlue of 0.3 seems to compress a lot. | |
| overviewFactor | Only N/overviewFactor points will be saved when compressing, using the top levels of the wavelet vectors. Must be multiple of 2. |
| walz::~walz | ( | ) | [virtual] |
Dtor.
| bool walz::InitRead | ( | std::string const & | filename, | |
| ParametersWalz & | param | |||
| ) | [virtual] |
Initialize reading points from file.
Implements laserlib::io.
| bool walz::Read | ( | bool & | bEOF | ) | [virtual] |
Read points from file.
Reads a block of points from file. Note that the entire file is not read at once. Must be called after walz::InitRead. Reads:
| bEOF | True if end-of-file was reached |
Implements laserlib::io.
| bool walz::ReadHeader | ( | bool & | bEOF | ) | [virtual] |
| bool walz::ReadLevel | ( | int & | level, | |
| bool | bEOF, | |||
| bool | bSkip | |||
| ) | [virtual] |
| bool walz::Compress | ( | ) | [virtual] |
Compress.
Calls walz::_CompressPackBits and returns if EWaveletType is EWT_PACKBITS. Otherwise:
Implements laserlib::io.
| bool walz::Uncompress | ( | ) | [virtual] |
Uncompress.
Performs inverse wavelet transform on the possibly compressed coordiante vectors.
Implements laserlib::io.
| bool walz::InitWrite | ( | std::string const & | filename, | |
| ParametersWalz & | param | |||
| ) | [virtual] |
Write to file.
| filename | Output file name | |
| param | File save options |
Implements laserlib::io.
| bool walz::Write | ( | ) | [virtual] |
| bool walz::GetPoints | ( | BoundingBox const & | bb, | |
| Container & | aContainer | |||
| ) | [virtual] |
Get the points that fall inside a rectangle.
| bb | Bounding box of area to get all points in | |
| aContainer | Container to fill with the points |
Reimplemented from laserlib::io.
| bool walz::GetOverview | ( | int const & | level, | |
| Container & | aContainer | |||
| ) | [virtual] |
Get a lower resolution overview.
| level | Overview level | |
| aContainer | Container to fill with the points |
Reimplemented from laserlib::io.
| int walz::_GetIndex | ( | double | value, | |
| int | interval | |||
| ) | [private] |
Get index to Huffman histogram.
| bool walz::_AnalyzeHistogram | ( | Vec_ULNG & | hX, | |
| std::list< int > & | breakPointList | |||
| ) | [private] |
| void walz::haar | ( | Vec_IO_DP & | a, | |
| const int | n, | |||
| const int | isign | |||
| ) | [private] |
Haar transform.
Actually unsymmetric Haar: Forward: s0 = 0.5*(v0+v1); d0 = 0.5*(v1-v0); Backward: v0 = s0-d0; v1=s0+d0;
| void walz::wtInt | ( | Vec_IO_INT & | a, | |
| const int | n, | |||
| const int | isign | |||
| ) | [private] |
Integer "fake" wavelet (for thematic data).
Can be used on thematic data? Works like nearest neighbor. Forward s0 = v0; d0 = v1-v0; Backward: v0 = s0; v1 = s0+d0;
| bool walz::_DoHuffman | ( | ) | [private] |
Huffman encode.
For each level 1-4:
| bool walz::_CompressHuffman | ( | ) | [private] |
Encode one level with Huffman.
| bool walz::_CompressPackBits | ( | ) | [private] |
Donīt do wavelets, just compress the coordinates by packing the bits.
Relates to the EWT_PACKBITS wavelet type.
| bool walz::_CompressPackBitsNoWavelet | ( | ) | [private] |
Called from walz::_CompressPackBits iff wavelet type is laserlib::EWT_NONE.
| bool walz::_CompressPackBitsWavelet | ( | ) | [private] |
Called from walz::_CompressPackBits iff wavelet type differs from laserlib::EWT_NONE.
| bool walz::_CompressPackBits | ( | int | nStart, | |
| int | nEnd, | |||
| BoundingBox & | bb, | |||
| Point3D & | Center, | |||
| unsigned int & | DLX, | |||
| unsigned int & | DLY, | |||
| unsigned int & | DLZ, | |||
| double & | stddev, | |||
| unsigned char * | pBuffer | |||
| ) | [private] |
Pack bits within an interval.
| nStart | Start index to pack bits from | |
| nEnd | EEnd index to stop pack bits at | |
| bb | Bounding box inside the given interval | |
| Center | Center point of this interval | |
| DLX | Bit lengths for x inside the given interval | |
| DLY | Bit lengths for y inside the given interval | |
| DLZ | Bit lengths for z inside the given interval | |
| stddev | Accuracy of points within given interval | |
| pBuffer | Buffer to add compressed pack bits to |
| bool walz::_UncompressPackBits | ( | ) | [private] |
Donīt do wavelets, just uncompress the coordinates by unpacking the bits.
Relates to the EWT_PACKBITS wavelet type.
| bool walz::_UncompressPackBitsWavelet | ( | ) | [private] |
Uncompress a PackBit level with wavelets.
The cpCurrentLevel is uncompressed
| bool walz::_UncompressPackBitsNoWavelet | ( | ) | [private] |
Uncompress a PackBit level without wavelets.
The cpCurrentLevel is uncompressed
| bool walz::_UncompressHuffman | ( | ) | [private] |
Uncompress a Huffman level.
The cpCurrentLevel is uncompressed
| bool walz::_PackBitsEncode | ( | unsigned long const & | iVal, | |
| unsigned char * | pBuf, | |||
| unsigned long & | nb, | |||
| int const & | DL | |||
| ) | [private] |
A helper to pack integer bits to a buffer.
| bool walz::_PackBitsDecode | ( | unsigned long & | iVal, | |
| unsigned char * | pBuf, | |||
| unsigned long & | nb, | |||
| int const & | DL | |||
| ) | [private] |
A helper to unpack integer bits from a buffer.
| bool walz::_WriteXYZ | ( | ) | [private] |
| bool walz::_GetBoundingBox | ( | BoundingBox & | bb, | |
| int const & | nStart, | |||
| int const & | nEnd | |||
| ) | [private] |
Get bounding box of coordinates within interval.
| bb | Bounding box within interval (output) | |
| nStart | Start of interval | |
| nEnd | End of interval, non-inclusive |
| bool walz::_GetDescriptionLength | ( | BoundingBox const & | bb, | |
| double & | stddev, | |||
| Point3D & | DL, | |||
| unsigned int * | iDL | |||
| ) | [private] |
Get bit length for each coordinate.
Takes width, height, dZ and precision into account and assumes rectangular distribution.
| bb | Bounding box | |
| stddev | Precision of data | |
| DL | Description lengths | |
| iDL | Closest larger integer, vector of [3] elements |
std::vector< Level > laserlib::walz::cvLevel [private] |
Level* laserlib::walz::cpCurrentLevel [private] |
bool laserlib::walz::cbWriteXYZ [private] |
See _WriteXYZ().
1.5.6