[Liblas-commits] hg-main-tree: move filters into a subdir
liblas-commits at liblas.org
liblas-commits at liblas.org
Tue Mar 15 16:30:17 EDT 2011
details: http://hg.libpc.orghg-main-tree/rev/a795fe09bff1
changeset: 247:a795fe09bff1
user: Michael P. Gerlek <mpg at flaxen.com>
date: Tue Mar 15 16:29:46 2011 -0400
description:
move filters into a subdir
diffstat:
apps/pc2pc.cpp | 2 +-
include/libpc/CacheFilter.hpp | 94 ---------------
include/libpc/ColorFilter.hpp | 66 -----------
include/libpc/CropFilter.hpp | 65 ----------
include/libpc/DecimationFilter.hpp | 64 ----------
include/libpc/MosaicFilter.hpp | 66 -----------
include/libpc/filters/CacheFilter.hpp | 94 +++++++++++++++
include/libpc/filters/ColorFilter.hpp | 66 +++++++++++
include/libpc/filters/CropFilter.hpp | 65 ++++++++++
include/libpc/filters/DecimationFilter.hpp | 64 ++++++++++
include/libpc/filters/MosaicFilter.hpp | 66 +++++++++++
src/CMakeLists.txt | 39 +++---
src/CacheFilter.cpp | 172 -----------------------------
src/ColorFilter.cpp | 114 -------------------
src/CropFilter.cpp | 98 ----------------
src/DecimationFilter.cpp | 79 -------------
src/MosaicFilter.cpp | 149 -------------------------
src/filters/CMakeLists.txt | 23 +++
src/filters/CacheFilter.cpp | 172 +++++++++++++++++++++++++++++
src/filters/ColorFilter.cpp | 114 +++++++++++++++++++
src/filters/CropFilter.cpp | 98 ++++++++++++++++
src/filters/DecimationFilter.cpp | 79 +++++++++++++
src/filters/MosaicFilter.cpp | 149 +++++++++++++++++++++++++
test/unit/CacheFilterTest.cpp | 2 +-
test/unit/CropFilterTest.cpp | 2 +-
test/unit/DecimationFilterTest.cpp | 2 +-
test/unit/MosaicFilterTest.cpp | 2 +-
27 files changed, 1015 insertions(+), 991 deletions(-)
diffs (truncated from 2199 to 300 lines):
diff -r e7436b47c718 -r a795fe09bff1 apps/pc2pc.cpp
--- a/apps/pc2pc.cpp Tue Mar 15 16:13:45 2011 -0400
+++ b/apps/pc2pc.cpp Tue Mar 15 16:29:46 2011 -0400
@@ -26,7 +26,7 @@
#include <libpc/drivers/las/Reader.hpp>
//#include <libpc/LasHeader.hpp>
#include <libpc/drivers/las/Writer.hpp>
-#include <libpc/CacheFilter.hpp>
+#include <libpc/filters/CacheFilter.hpp>
#include <libpc/drivers/liblas/writer.hpp>
#include <libpc/drivers/liblas/reader.hpp>
diff -r e7436b47c718 -r a795fe09bff1 include/libpc/CacheFilter.hpp
--- a/include/libpc/CacheFilter.hpp Tue Mar 15 16:13:45 2011 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,94 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
-*
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following
-* conditions are met:
-*
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in
-* the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
-* names of its contributors may be used to endorse or promote
-* products derived from this software without specific prior
-* written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-* OF SUCH DAMAGE.
-****************************************************************************/
-
-#ifndef INCLUDED_CACHEFILTER_HPP
-#define INCLUDED_CACHEFILTER_HPP
-
-#include <libpc/Filter.hpp>
-
-namespace libpc
-{
-
-class PointDataCache;
-
-// This is just a very simple MRU filter -- future versions will be smarter.
-// This cache has the following constraints:
-// - only one block is cached
-// - read chunk sizes are assumed to be just 1 point
-// If more than one point is read, the cache is skipped.
-class LIBPC_DLL CacheFilter : public Filter
-{
-public:
- CacheFilter(Stage& prevStage, boost::uint32_t numBlocks, boost::uint32_t blockSize);
- ~CacheFilter();
-
- const std::string& getName() const;
-
- // override
- void seekToPoint(boost::uint64_t index);
-
- // clear cache (but leave cache params unchanged)
- void resetCache();
-
- // clear cache, and change cache params too
- void resetCache(boost::uint32_t numBlocks, boost::uint32_t blockSize);
-
- // number of points requested from this filter via read()
- boost::uint64_t getNumPointsRequested() const;
-
- // num points this filter read from the previous stage
- boost::uint64_t getNumPointsRead() const;
-
- void getCacheStats(boost::uint64_t& numCacheLookupMisses,
- boost::uint64_t& numCacheLookupHits,
- boost::uint64_t& numCacheInsertMisses,
- boost::uint64_t& numCacheInsertHits) const;
-
-private:
- boost::uint32_t readBuffer(PointData&);
-
- boost::uint64_t m_numPointsRequested;
- boost::uint64_t m_numPointsRead;
-
- PointDataCache* m_cache;
- boost::uint32_t m_maxCacheBlocks;
- boost::uint32_t m_cacheBlockSize;
-
- CacheFilter& operator=(const CacheFilter&); // not implemented
- CacheFilter(const CacheFilter&); // not implemented
-};
-
-} // namespace libpc
-
-#endif
diff -r e7436b47c718 -r a795fe09bff1 include/libpc/ColorFilter.hpp
--- a/include/libpc/ColorFilter.hpp Tue Mar 15 16:13:45 2011 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
-*
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following
-* conditions are met:
-*
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in
-* the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
-* names of its contributors may be used to endorse or promote
-* products derived from this software without specific prior
-* written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-* OF SUCH DAMAGE.
-****************************************************************************/
-
-#ifndef INCLUDED_COLORFILTER_HPP
-#define INCLUDED_COLORFILTER_HPP
-
-#include <boost/cstdint.hpp>
-
-#include <libpc/export.hpp>
-#include <libpc/Filter.hpp>
-
-namespace libpc
-{
-
-// adds three new u8 fields (R,G,B) for the colourization of the Z axis
-// the color is done as a ramp from the declared Z min/max values in the header
-class LIBPC_DLL ColorFilter : public Filter
-{
-public:
- ColorFilter(Stage& prevStage);
-
- const std::string& getName() const;
-
-private:
- boost::uint32_t readBuffer(PointData&);
-
- void getColor(float value, boost::uint8_t& red, boost::uint8_t& green, boost::uint8_t& blue);
-
- ColorFilter& operator=(const ColorFilter&); // not implemented
- ColorFilter(const ColorFilter&); // not implemented
-};
-
-} // namespace libpc
-
-#endif
diff -r e7436b47c718 -r a795fe09bff1 include/libpc/CropFilter.hpp
--- a/include/libpc/CropFilter.hpp Tue Mar 15 16:13:45 2011 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
-*
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following
-* conditions are met:
-*
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in
-* the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
-* names of its contributors may be used to endorse or promote
-* products derived from this software without specific prior
-* written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-* OF SUCH DAMAGE.
-****************************************************************************/
-
-#ifndef INCLUDED_CROPFILTER_HPP
-#define INCLUDED_CROPFILTER_HPP
-
-#include <libpc/export.hpp>
-#include <libpc/Filter.hpp>
-#include <libpc/Bounds.hpp>
-
-namespace libpc
-{
-
-// removes any points outside of the given range
-// updates the header accordingly
-class LIBPC_DLL CropFilter : public Filter
-{
-public:
- CropFilter(Stage& prevStage, Bounds<double> const& bounds);
-
- const std::string& getName() const;
-
-private:
- boost::uint32_t readBuffer(PointData&);
-
- Bounds<double> m_bounds;
-
- CropFilter& operator=(const CropFilter&); // not implemented
- CropFilter(const CropFilter&); // not implemented
-};
-
-} // namespace libpc
-
-#endif
diff -r e7436b47c718 -r a795fe09bff1 include/libpc/DecimationFilter.hpp
--- a/include/libpc/DecimationFilter.hpp Tue Mar 15 16:13:45 2011 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/******************************************************************************
-* Copyright (c) 2011, Michael P. Gerlek (mpg at flaxen.com)
-*
-* All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without
-* modification, are permitted provided that the following
-* conditions are met:
-*
-* * Redistributions of source code must retain the above copyright
-* notice, this list of conditions and the following disclaimer.
-* * Redistributions in binary form must reproduce the above copyright
-* notice, this list of conditions and the following disclaimer in
-* the documentation and/or other materials provided
-* with the distribution.
-* * Neither the name of Hobu, Inc. or Flaxen Geo Consulting nor the
-* names of its contributors may be used to endorse or promote
-* products derived from this software without specific prior
-* written permission.
-*
-* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
-* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
-* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
-* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
-* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
-* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
-* OF SUCH DAMAGE.
-****************************************************************************/
-
-#ifndef INCLUDED_DECIMATIONFILTER_HPP
-#define INCLUDED_DECIMATIONFILTER_HPP
-
-#include <libpc/export.hpp>
-#include <libpc/Filter.hpp>
-#include <libpc/Bounds.hpp>
-
-namespace libpc
-{
-
-// we keep only 1 out of every step points; if step=100, we get 1% of the file
-class LIBPC_DLL DecimationFilter : public Filter
-{
More information about the Liblas-commits
mailing list