| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/image_processing/TePDIBlender.hpp
Go to the documentation of this file.

    00001 /*
    00002 TerraLib - a library for developing GIS applications.
    00003 Copyright  2001, 2002, 2003 INPE and Tecgraf/PUC-Rio.
    00004
    00005 This code is part of the TerraLib library.
    00006 This library is free software; you can redistribute it and/or
    00007 modify it under the terms of the GNU Lesser General Public
    00008 License as published by the Free Software Foundation; either
    00009 version 2.1 of the License, or (at your option) any later version.
    00010
    00011 You should have received a copy of the GNU Lesser General Public
    00012 License along with this library.
    00013
    00014 The authors reassure the license terms regarding the warranties.
    00015 They specifically disclaim any warranties, including, but not limited to,
    00016 the implied warranties of merchantability and fitness for a particular
    00017 purpose. The library provided hereunder is on an "as is" basis, and the
    00018 authors have no obligation to provide maintenance, support, updates,
    00019 enhancements, or modifications.
    00020 In no event shall INPE be held liable to any party
    00021 for direct, indirect, special, incidental, or consequential damages arising
    00022 out of the use of this library and its documentation.
    00023 */
    00024
    00025 #ifndef TEPDIBLENDER_HPP
    00026   #define TEPDIBLENDER_HPP
    00027
    00028   #include "TePDIInterpolator.hpp"
    00029   #include "TePDIDefines.hpp"
    00030   #include "TePDITypes.hpp"
    00031
    00032   #include "../kernel/TeGeometry.h"
    00033   #include "../kernel/TeRaster.h"
    00034   #include "../kernel/TeGeometricTransformation.h"
    00035
    00036   #include <vector>
    00037
    00049   class PDI_DLL TePDIBlender
    00050   {
    00051     public :
    00054       typedef TeSharedPtr< TePDIBlender > pointer;
    00055
    00059       enum BlendMethod {
    00061         NoBlendMethod = 1,
    00063         MeanBlendMethod = 2,
    00065         EuclideanBlendMethod = 3
    00066       };
    00067
    00068       TePDIBlender();
    00069
    00070       ~TePDIBlender();
    00071
    00111       bool init( const TePDITypes::TePDIRasterPtrType& raster1Ptr,
    00112         const std::vector< unsigned int > raster1ChannelsVec,
    00113         const TePDITypes::TePDIRasterPtrType& raster2Ptr,
    00114         const std::vector< unsigned int > raster2ChannelsVec,
    00115         BlendMethod blendMethod,
    00116         TePDIInterpolator::InterpMethod interpMethod,
    00117         const TeGTParams& transParams,
    00118         const double& dummyValue,
    00119         const std::vector< double >& pixelOffsets1,
    00120         const std::vector< double >& pixelScales1,
    00121         const std::vector< double >& pixelOffsets2,
    00122         const std::vector< double >& pixelScales2,
    00123         const TePolygon& raster1Pol = TePolygon(),
    00124         const TePolygon& raster2Pol = TePolygon() );
    00125
    00140       inline void blend( const double& line, const double& col,
    00141         const unsigned int& rasterChannelsVecsIdx , double& value )
    00142       {
    00143         return (this->*blendFunctPtr_)( line, col, rasterChannelsVecsIdx,
    00144           value );
    00145       };
    00146
    00147     protected :
    00148
    00157       typedef void (TePDIBlender::*BlendFunctPtr)( const double& line,
    00158         const double& col, const unsigned int& band, double& value );
    00159
    00161       double dummyValue_;
    00162
    00166       BlendFunctPtr blendFunctPtr_;
    00167
    00169       BlendMethod blendMethod_;
    00170
    00173       short relation_;
    00174
    00176       TeGeometricTransformation::pointer transPrt_;
    00177
    00179       TePDITypes::TePDIRasterPtrType raster1Ptr_;
    00180
    00182       std::vector< unsigned int > raster1ChannelsVec_;
    00183
    00185       TePDITypes::TePDIRasterPtrType raster2Ptr_;
    00186
    00188       std::vector< unsigned int > raster2ChannelsVec_;
    00189
    00191       TePDIInterpolator interp1Instance_;
    00192
    00194       TePDIInterpolator interp2Instance_;
    00195
    00196       // noBlendMethodImp temporary used variables
    00197       TeCoord2D noBlendMethodImp_coord1_;
    00198       TeCoord2D noBlendMethodImp_coord2_;
    00199
    00200       // eucBlendMethodImp temporary used variables
    00201       TeCoord2D eucBlendMethodImp_coord1_;
    00202       TeCoord2D eucBlendMethodImp_coord2_;
    00203       double eucBlendMethodImp_value1_;
    00204       double eucBlendMethodImp_value2_;
    00205       double eucBlendMethodImp_weight1_;
    00206       double eucBlendMethodImp_weight2_;
    00207       double eucBlendMethodImp_minDistToR1_;
    00208       double eucBlendMethodImp_minDistToR2_;
    00209       TeCoord2D eucBlendMethodImp_curCoord_;
    00210       TeCoord2D eucBlendMethodImp_dummyCoord_;
    00211       double eucBlendMethodImp_currDist_;
    00212       unsigned int eucBlendMethodImp_iLSIdx_;
    00213
    00214       // meanBlendMethodImp temporary used variables
    00215       TeCoord2D meanBlendMethodImp_coord1_;
    00216       TeCoord2D meanBlendMethodImp_coord2_;
    00217       double meanBlendMethodImp_value1_;
    00218       double meanBlendMethodImp_value2_;
    00219
    00222       TePolygon interPolR1IdxRef_;
    00223
    00226       TeLineSet interLineSetInR1_;
    00227
    00230       TeLineSet interLineSetInR2_;
    00231
    00236       std::vector< double > pixelOffsets1_;
    00237
    00242       std::vector< double > pixelScales1_;
    00243
    00248       std::vector< double > pixelOffsets2_;
    00249
    00254       std::vector< double > pixelScales2_;
    00255
    00259       void reset();
    00260
    00261       // just like the method blend above
    00262       void noBlendMethodImp( const double& line, const double& col,
    00263         const unsigned int& rasterChannelsVecsIdx, double& value );
    00264
    00265       // just like the method blend above
    00266       void eucBlendMethodImp( const double& line, const double& col,
    00267         const unsigned int& rasterChannelsVecsIdx, double& value );
    00268
    00269       // just like the method blend above
    00270       void meanBlendMethodImp( const double& line, const double& col,
    00271         const unsigned int& rasterChannelsVecsIdx, double& value );
    00272   };
    00273
    00274 #endif

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines