1# distutils: language=c++
2from libcpp.vector cimport vector
3from libc.stdint cimport uint8_t, uint64_t
4
5cdef extern from "PyLazperfTypes.hpp" namespace "pylazperf":
6    enum LazPerfType "pylazperf::Type":
7        Double
8        Float
9        Signed8
10        Signed16
11        Signed32
12        Signed64
13        Unsigned8
14        Unsigned16
15        Unsigned32
16        Unsigned64
17
18
19
20cdef extern from "PyLazperf.hpp" namespace "pylazperf":
21    cdef cppclass Decompressor:
22        Decompressor(const uint8_t *data, size_t dataLen) except +
23        size_t decompress(char* buffer, size_t length)  except +
24        size_t getPointSize()
25        void add_dimension(LazPerfType t)
26
27
28
29cdef extern from "PyLazperf.hpp" namespace "pylazperf":
30    cdef cppclass Compressor:
31        Compressor(vector[uint8_t]& arr) except +
32        size_t compress(const char* buffer, size_t length)  except +
33        size_t getPointSize()
34        void add_dimension(LazPerfType t)
35        void done()
36        const vector[uint8_t]* data()
37        void copy_data_to(uint8_t *dest) const
38
39
40
41cdef extern from "laz-perf/factory.hpp" namespace "laszip::factory":
42    cdef cppclass record_item:
43        @staticmethod
44        const record_item& point();
45        @staticmethod
46        const record_item& gpstime();
47        @staticmethod
48        const record_item& rgb();
49        @staticmethod
50        const record_item& eb(size_t count);
51
52cdef extern from "laz-perf/factory.hpp" namespace "laszip::factory":
53    cdef cppclass record_schema:
54        record_schema()
55        void push(const record_item&)
56
57
58cdef extern from 'laz-perf/io.hpp' namespace "laszip::io":
59    cdef cppclass laz_vlr:
60        laz_vlr()
61        void extract(char *data)
62        size_t size() const
63        @staticmethod
64        laz_vlr from_schema(const record_schema)
65
66cdef extern from "PyLazperf.hpp" namespace "pylazperf":
67    cdef cppclass VlrDecompressor:
68        VlrDecompressor(const unsigned char* compressed_data, size_t dataLength, size_t pointSize, const char *vlr) except +
69        size_t decompress(char* buffer)  except +
70        size_t getPointSize()
71
72
73cdef extern from "PyLazperf.hpp" namespace "pylazperf":
74    cdef cppclass VlrCompressor:
75        VlrCompressor(record_schema, uint64_t offset) except +
76        size_t compress(const char *inbuf) except +
77        void done()
78        const vector[uint8_t]* data()
79        size_t getPointSize()
80        size_t vlrDataSize() const
81        void extractVlrData(char* out)
82        void copy_data_to(uint8_t *dst) const