| 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/TePDIInterpolator.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 TEPDIINTERPOLATOR_HPP
    00026   #define TEPDIINTERPOLATOR_HPP
    00027
    00028   #include "TePDIDefines.hpp"
    00029   #include "../kernel/TeSharedPtr.h"
    00030   #include "../kernel/TeRaster.h"
    00031
    00038   class PDI_DLL TePDIInterpolator {
    00039     public :
    00042       typedef TeSharedPtr< TePDIInterpolator > pointer;
    00045       typedef const TeSharedPtr< TePDIInterpolator > const_pointer;
    00046
    00050       enum InterpMethod {
    00052         NNMethod = 1,
    00054         BilinearMethod = 2,
    00056         BicubicMethod = 3
    00057       };
    00058
    00063       TePDIInterpolator();
    00064
    00068       ~TePDIInterpolator();
    00069
    00081       bool reset( const TeSharedPtr< TeRaster >& input_raster,
    00082         InterpMethod method, double dummy_value );
    00083
    00096       inline void interpolate( const double& line, const double& col,
    00097         const unsigned int& band, double& value )
    00098       {
    00099         TEAGN_DEBUG_CONDITION( interp_funct_ptr_,
    00100           "Invalid interpolation function pointer" );
    00101
    00102         ( this->*( interp_funct_ptr_ ) )( line, col, band, value );
    00103       };
    00104
    00105     protected :
    00106
    00115       typedef void (TePDIInterpolator::*InterpFunctPtr)( const double& line,
    00116         const double& col, const unsigned int& band, double& value );
    00117
    00121       TeRasterParams* input_raster_params_nptr_;
    00122
    00126       InterpFunctPtr interp_funct_ptr_;
    00127
    00132       double bicubic_lines_bound_;
    00133
    00138       double bicubic_columns_bound_;
    00139
    00143       double bicubic_kernel_parameter_;
    00144
    00148       double last_valid_line_;
    00149
    00153       double last_valid_col_;
    00154
    00158       bool raster_uses_dummy_;
    00159
    00163       unsigned int nbands_;
    00164
    00168       double dummy_value_;
    00169
    00173       TeSharedPtr< TeRaster > input_raster_ptr_;
    00174
    00178       TeRaster* input_raster_nptr_;
    00179
    00184       double* input_raster_max_chan_val_vec_;
    00185
    00190       double* input_raster_min_chan_val_vec_;
    00191
    00193       double bilinear_line_min_;
    00195       double bilinear_line_max_;
    00197       double bilinear_col_min_;
    00199       double bilinear_col_max_;
    00201       double bilinear_diff_line_min_;
    00203       double bilinear_diff_line_max_;
    00205       double bilinear_diff_col_min_;
    00207       double bilinear_diff_col_max_;
    00209       double bilinear_dist1_;
    00211       double bilinear_dist2_;
    00213       double bilinear_dist3_;
    00215       double bilinear_dist4_;
    00217       double bilinear_weigh1_;
    00219       double bilinear_weigh2_;
    00221       double bilinear_weigh3_;
    00223       double bilinear_weigh4_;
    00225       double bilinear_elem1_;
    00227       double bilinear_elem2_;
    00229       double bilinear_elem3_;
    00231       double bilinear_elem4_;
    00232
    00234       unsigned int bicubic_grid_raster_line_;
    00236       unsigned int bicubic_grid_raster_col_;
    00238       unsigned int bicubic_buffer_line_;
    00240       unsigned int bicubic_buffer_col_;
    00242       double bicubic_buffer_[4][4];
    00244       double bicubic_offset_x_;
    00246       double bicubic_offset_y_;
    00248       double bicubic_h_weights_[4];
    00250       double bicubic_v_weights_[4];
    00252       double bicubic_h_weights_sum_;
    00254       double bicubic_v_weights_sum_;
    00256       double bicubic_int_line_accum_;
    00258       double bicubic_int_lines_values_[4];
    00259
    00263       void init();
    00264
    00269       void clear();
    00270
    00271       // just like the method interpolate above
    00272       void nNInterpolation( const double& line, const double& col,
    00273         const unsigned int& band, double& value );
    00274
    00275       // just like the method interpolate above
    00276       void bilinearInterpolation( const double& line, const double& col,
    00277         const unsigned int& band, double& value );
    00278
    00279       // just like the method interpolate above
    00280       void bicubicInterpolation( const double& line, const double& col,
    00281         const unsigned int& band, double& value );
    00282
    00283   };
    00284
    00289 #endif //TEPDIFILTERMASK_HPP

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines