1
/******************************************************************************
4
* Project: libLAS - http://liblas.org - A BSD library for LAS format data.
5
* Purpose: laszip helper functions for C++ libLAS
6
* Author: Michael P. Gerlek (mpg@flaxen.com)
8
******************************************************************************
9
* Copyright (c) 2010, Michael P. Gerlek
11
* All rights reserved.
13
* Redistribution and use in source and binary forms, with or without
14
* modification, are permitted provided that the following
17
* * Redistributions of source code must retain the above copyright
18
* notice, this list of conditions and the following disclaimer.
19
* * Redistributions in binary form must reproduce the above copyright
20
* notice, this list of conditions and the following disclaimer in
21
* the documentation and/or other materials provided
22
* with the distribution.
23
* * Neither the name of the Martin Isenburg or Iowa Department
24
* of Natural Resources nor the names of its contributors may be
25
* used to endorse or promote products derived from this software
26
* without specific prior written permission.
28
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
31
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
32
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
33
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
34
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
35
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
36
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
37
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
38
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
40
****************************************************************************/
42
#ifndef LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED
43
#define LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED
46
#include <liblas/detail/fwd.hpp>
47
#include <liblas/liblas.hpp>
50
#include <boost/cstdint.hpp>
51
#include <boost/shared_ptr.hpp>
52
#include <boost/scoped_ptr.hpp>
53
#include <boost/scoped_array.hpp>
59
namespace liblas { namespace detail {
64
ZipPoint(PointFormatName, const std::vector<VariableRecord>& vlrs);
67
void ConstructVLR(VariableRecord&) const;
69
// these will return false iff we find a laszip VLR and it doesn't match
70
// the point format this object wasd constructed with
71
bool ValidateVLR(std::vector<VariableRecord> const& vlrs) const;
72
bool ValidateVLR(const VariableRecord& vlr) const;
74
bool IsZipVLR(const VariableRecord& vlr) const;
76
LASzip* GetZipper() const { return m_zip.get(); }
79
void ConstructItems();
82
// LASzip::pack() allocates/sets vlr_data and vlr_num for us, and deletes it for us ["his"]
83
// LASzip::unpack() just reads from the vlr_data we give it (we allocate and delete) ["our"]
85
unsigned char* his_vlr_data;
87
boost::scoped_ptr<LASzip> m_zip;
89
unsigned char** m_lz_point;
90
boost::scoped_array<boost::uint8_t> m_lz_point_data;
91
unsigned int m_lz_point_size;
94
}} // namespace liblas::detail
97
#endif // LIBLAS_DETAIL_ZIPPOINT_HPP_INCLUDED