Warning, file /education/marble/tools/mapreproject/NearestNeighborInterpolation.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 #include "NearestNeighborInterpolation.h"
0002 
0003 #include "ReadOnlyMapImage.h"
0004 
0005 #include <cmath>
0006 
0007 NearestNeighborInterpolation::NearestNeighborInterpolation( ReadOnlyMapImage * const mapImage )
0008     : InterpolationMethod( mapImage )
0009 {
0010 }
0011 
0012 QRgb NearestNeighborInterpolation::interpolate( double const x, double const y )
0013 {
0014     int const xr = round( x );
0015     int const yr = round( y );
0016     return m_mapImage->pixel( xr, yr );
0017 }