[Liblas-commits] hg: revert to always using uint16_t for the byte size of point f...

liblas-commits at liblas.org liblas-commits at liblas.org
Wed Mar 17 21:18:44 EDT 2010


changeset f787b5fa07f7 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=f787b5fa07f7
summary: revert to always using uint16_t for the byte size of point formats because that's ultimately what the spec allows.  Any trimming is on the user, not us

diffstat:

 include/liblas/lasformat.hpp |  14 +++++++-------
 src/las_c_api.cpp            |   6 +++---
 src/lasformat.cpp            |   4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diffs (97 lines):

diff -r a7e50a69311b -r f787b5fa07f7 include/liblas/lasformat.hpp
--- a/include/liblas/lasformat.hpp	Wed Mar 17 15:42:56 2010 -0500
+++ b/include/liblas/lasformat.hpp	Wed Mar 17 20:13:00 2010 -0500
@@ -58,11 +58,11 @@
 
     PointFormat( liblas::uint8_t major, 
                     liblas::uint8_t minor, 
-                    liblas::uint32_t size);
+                    liblas::uint16_t size);
 
     PointFormat( liblas::uint8_t major, 
                     liblas::uint8_t minor, 
-                    liblas::uint32_t size,
+                    liblas::uint16_t size,
                     bool bColor,
                     bool bTime);
     PointFormat& operator=(PointFormat const& rhs);
@@ -71,10 +71,10 @@
     ~PointFormat() {};
 
     /// Fetch byte size
-    uint32_t GetByteSize() const;
+    uint16_t GetByteSize() const;
 
     /// Set value of the red image channel 
-    void SetByteSize(uint32_t const& value);
+    void SetByteSize(uint16_t const& value);
 
     
     uint8_t GetVersionMajor() const; 
@@ -90,7 +90,7 @@
   
 protected:
     
-    liblas::uint32_t m_size;
+    liblas::uint16_t m_size;
     liblas::uint8_t m_versionminor;
     liblas::uint8_t m_versionmajor;
 
@@ -101,12 +101,12 @@
     void updatesize();
 };
 
-inline uint32_t PointFormat::GetByteSize() const
+inline uint16_t PointFormat::GetByteSize() const
 {
     return m_size;
 }
 
-inline void PointFormat::SetByteSize(uint32_t const& value)
+inline void PointFormat::SetByteSize(uint16_t const& value)
 {
     m_size = value;
 }
diff -r a7e50a69311b -r f787b5fa07f7 src/las_c_api.cpp
--- a/src/las_c_api.cpp	Wed Mar 17 15:42:56 2010 -0500
+++ b/src/las_c_api.cpp	Wed Mar 17 20:13:00 2010 -0500
@@ -2176,15 +2176,15 @@
 
 }
 
-LAS_DLL liblas::uint32_t LASPointFormat_GetByteSize( LASPointFormatH hFormat)
+LAS_DLL liblas::uint16_t LASPointFormat_GetByteSize( LASPointFormatH hFormat)
 {
     VALIDATE_LAS_POINTER1(hFormat, "LASPointFormat_GetByteSize", 0);
     
     liblas::PointFormat* format = ((liblas::PointFormat*) hFormat);
-    return static_cast<liblas::uint32_t>(format->GetByteSize());    
+    return format->GetByteSize();    
 }
 
-LAS_DLL LASErrorEnum LASPointFormat_SetByteSize( LASPointFormatH hFormat, liblas::uint32_t size)
+LAS_DLL LASErrorEnum LASPointFormat_SetByteSize( LASPointFormatH hFormat, liblas::uint16_t size)
 {
     VALIDATE_LAS_POINTER1(hFormat, "LASPointFormat_SetByteSize", LE_Failure);
 
diff -r a7e50a69311b -r f787b5fa07f7 src/lasformat.cpp
--- a/src/lasformat.cpp	Wed Mar 17 15:42:56 2010 -0500
+++ b/src/lasformat.cpp	Wed Mar 17 20:13:00 2010 -0500
@@ -59,7 +59,7 @@
 
 PointFormat::PointFormat( liblas::uint8_t major, 
                 liblas::uint8_t minor, 
-                liblas::uint32_t size) :
+                liblas::uint16_t size) :
     m_size(size),
     m_versionminor(minor), 
     m_versionmajor(major),
@@ -72,7 +72,7 @@
 
 PointFormat::PointFormat( liblas::uint8_t major, 
                 liblas::uint8_t minor, 
-                liblas::uint32_t size,
+                liblas::uint16_t size,
                 bool bColor,
                 bool bTime) :
     m_size(size),


More information about the Liblas-commits mailing list