[Liblas-commits] laszip: 3 new changesets
liblas-commits at liblas.org
liblas-commits at liblas.org
Fri Dec 17 22:45:16 EST 2010
changeset 473da02e72e3 in /Volumes/Data/www/liblas.org/laszip
details: http://hg.liblas.orglaszip?cmd=changeset;node=473da02e72e3
summary: updated the endian handling and allow seeking
changeset c66256ecc759 in /Volumes/Data/www/liblas.org/laszip
details: http://hg.liblas.orglaszip?cmd=changeset;node=c66256ecc759
summary: updated the endian handling
changeset df98c890f766 in /Volumes/Data/www/liblas.org/laszip
details: http://hg.liblas.orglaszip?cmd=changeset;node=df98c890f766
summary: changed LASitem from struct to class
diffstat:
include/laszip/lasunzipper.hpp | 80 ++++++++--------
include/laszip/laszip.hpp | 112 +++++++++++++++++++++++-
include/laszip/laszipper.hpp | 80 ++++++++--------
src/bytestreamin.hpp | 8 +
src/bytestreamin_file.hpp | 123 +++++++++++++++++++++++++-
src/bytestreamin_istream.hpp | 177 +++++++++++++++++++++++++++-----------
src/bytestreamout.hpp | 14 +++
src/bytestreamout_file.hpp | 114 +++++++++++++++++++++++-
src/bytestreamout_ostream.hpp | 185 ++++++++++++++++++++++++++++++++--------
src/lasreaditemraw.hpp | 26 ++++-
src/lasreadpoint.cpp | 100 ++++++---------------
src/laswriteitemraw.hpp | 26 ++++-
src/laswritepoint.cpp | 41 ++------
src/mydefs.hpp | 2 +-
14 files changed, 778 insertions(+), 310 deletions(-)
diffs (truncated from 1542 to 300 lines):
diff -r 41573d80a706 -r df98c890f766 include/laszip/lasunzipper.hpp
--- a/include/laszip/lasunzipper.hpp Fri Dec 17 07:49:21 2010 -0800
+++ b/include/laszip/lasunzipper.hpp Fri Dec 17 19:44:46 2010 -0800
@@ -1,21 +1,21 @@
-/******************************************************************************
- *
- * Project: integrating laszip into liblas - http://liblas.org -
- * Purpose:
- * Author: Martin Isenburg
- * isenburg at cs.unc.edu
- *
- ******************************************************************************
- * Copyright (c) 2010, Martin Isenburg
- *
- * This is free software; you can redistribute and/or modify it under
- * the terms of the GNU Lesser General Licence as published
- * by the Free Software Foundation.
- *
- * See the COPYING file for more information.
- *
- ****************************************************************************/
-
+/******************************************************************************
+ *
+ * Project: integrating laszip into liblas - http://liblas.org -
+ * Purpose:
+ * Author: Martin Isenburg
+ * isenburg at cs.unc.edu
+ *
+ ******************************************************************************
+ * Copyright (c) 2010, Martin Isenburg
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Licence as published
+ * by the Free Software Foundation.
+ *
+ * See the COPYING file for more information.
+ *
+ ****************************************************************************/
+
/*
===============================================================================
@@ -39,44 +39,44 @@
CHANGE HISTORY:
- 12 December 2010 -- created from LASwriter/LASreader after Howard got pushy (-;
+ 12 December 2010 -- created from LASwriter/LASreader after Howard got pushy (-;
===============================================================================
*/
#ifndef LAS_UNZIPPER_H
#define LAS_UNZIPPER_H
-#include <stdio.h>
+#include <stdio.h>
+
+#include "laszip.hpp"
+
+#ifdef LZ_WIN32_VC6
+#include <fstream.h>
+#else
+#include <istream>
+#include <fstream>
+using namespace std;
+#endif
-#ifdef LZ_WIN32_VC6
- #include <fstream.h>
-#else
- #include <istream>
- #include <fstream>
- using namespace std;
-#endif
-
-#include "laszip.hpp"
-
-class ByteStreamIn;
-class LASreadPoint;
-
+class ByteStreamIn;
+class LASreadPoint;
+
class LASunzipper
{
public:
- bool open(FILE* file, unsigned int num_items, const LASitem* items, unsigned int compression=0);
- bool open(istream* stream, unsigned int num_items, const LASitem* items, unsigned int compression=0);
- bool read(unsigned char** point);
- unsigned int close();
+ bool open(FILE* file, unsigned int num_items, const LASitem* items, unsigned int compression=0);
+ bool open(istream* stream, unsigned int num_items, const LASitem* items, unsigned int compression=0);
+ bool read(unsigned char** point);
+ unsigned int close();
LASunzipper();
~LASunzipper();
-private:
+private:
int count;
- ByteStreamIn* stream;
- LASreadPoint* reader;
+ ByteStreamIn* stream;
+ LASreadPoint* reader;
};
#endif
diff -r 41573d80a706 -r df98c890f766 include/laszip/laszip.hpp
--- a/include/laszip/laszip.hpp Fri Dec 17 07:49:21 2010 -0800
+++ b/include/laszip/laszip.hpp Fri Dec 17 19:44:46 2010 -0800
@@ -47,20 +47,116 @@
#ifndef LASZIP_H
#define LASZIP_H
-#if defined(_MSC_VER) && (_MSC_VER < 1300)
-// VC6 is very special wrt C++ streams
-#define LZ_WIN32_VC6
-#endif
+#if defined(_MSC_VER) && (_MSC_VER < 1300)
+#define LZ_WIN32_VC6
+#endif
#define LASZIP_COMPRESSION_NONE 0
#define LASZIP_COMPRESSION_RANGE 1
#define LASZIP_COMPRESSION_ARITHMETIC 2
-struct LASitem
+class LASitem
{
- enum { BYTE, SHORT, INT, LONG, FLOAT, DOUBLE, POINT10, GPSTIME, RGB } type;
- short size;
- short version;
+public:
+
+ enum { BYTE = 0, SHORT, INT, LONG, FLOAT, DOUBLE, POINT10, GPSTIME, RGB, WAVEPACKET } type;
+ unsigned short size;
+ unsigned short version;
+
+ bool supported_type() const
+ {
+ switch (type)
+ {
+ case POINT10:
+ case GPSTIME:
+ case RGB:
+ case WAVEPACKET:
+ case BYTE:
+ return true;
+ break;
+ }
+ return false;
+ }
+
+ bool supported_size() const
+ {
+ switch (type)
+ {
+ case POINT10:
+ if (size != 20) return false;
+ break;
+ case GPSTIME:
+ if (size != 8) return false;
+ break;
+ case RGB:
+ if (size != 6) return false;
+ break;
+ case WAVEPACKET:
+ if (size != 29) return false;
+ break;
+ case BYTE:
+ if (size < 1) return false;
+ break;
+ default:
+ return false;
+ }
+ return true;
+ }
+
+ bool supported_version() const
+ {
+ switch (type)
+ {
+ case POINT10:
+ if (version > 1) return false;
+ break;
+ case GPSTIME:
+ if (version > 1) return false;
+ break;
+ case RGB:
+ if (version > 1) return false;
+ break;
+ case WAVEPACKET:
+ if (version > 1) return false;
+ break;
+ case BYTE:
+ if (version > 1) return false;
+ break;
+ default:
+ return false;
+ }
+ return true;
+ }
+
+ bool supported() const
+ {
+ switch (type)
+ {
+ case POINT10:
+ if (size != 20) return false;
+ if (version > 1) return false;
+ break;
+ case GPSTIME:
+ if (size != 8) return false;
+ if (version > 1) return false;
+ break;
+ case RGB:
+ if (size != 6) return false;
+ if (version > 1) return false;
+ break;
+ case WAVEPACKET:
+ if (size != 29) return false;
+ if (version > 1) return false;
+ break;
+ case BYTE:
+ if (size < 1) return false;
+ if (version > 1) return false;
+ break;
+ default:
+ return false;
+ }
+ return true;
+ }
};
struct LASchunk
diff -r 41573d80a706 -r df98c890f766 include/laszip/laszipper.hpp
--- a/include/laszip/laszipper.hpp Fri Dec 17 07:49:21 2010 -0800
+++ b/include/laszip/laszipper.hpp Fri Dec 17 19:44:46 2010 -0800
@@ -1,21 +1,21 @@
-/******************************************************************************
- *
- * Project: integrating laszip into liblas - http://liblas.org -
- * Purpose:
- * Author: Martin Isenburg
- * isenburg at cs.unc.edu
- *
- ******************************************************************************
- * Copyright (c) 2010, Martin Isenburg
- *
- * This is free software; you can redistribute and/or modify it under
- * the terms of the GNU Lesser General Licence as published
- * by the Free Software Foundation.
- *
- * See the COPYING file for more information.
- *
- ****************************************************************************/
-
+/******************************************************************************
+ *
+ * Project: integrating laszip into liblas - http://liblas.org -
+ * Purpose:
+ * Author: Martin Isenburg
+ * isenburg at cs.unc.edu
+ *
+ ******************************************************************************
+ * Copyright (c) 2010, Martin Isenburg
+ *
+ * This is free software; you can redistribute and/or modify it under
+ * the terms of the GNU Lesser General Licence as published
+ * by the Free Software Foundation.
+ *
+ * See the COPYING file for more information.
+ *
+ ****************************************************************************/
+
/*
===============================================================================
@@ -39,45 +39,45 @@
CHANGE HISTORY:
- 12 December 2010 -- created from LASwriter/LASreader after Howard got pushy (-;
+ 12 December 2010 -- created from LASwriter/LASreader after Howard got pushy (-;
===============================================================================
*/
#ifndef LAS_ZIPPER_H
#define LAS_ZIPPER_H
-#include <stdio.h>
+#include <stdio.h>
+
+#include "laszip.hpp"
#ifdef LZ_WIN32_VC6
- #include <fstream.h>
More information about the Liblas-commits
mailing list