00001 /*************************************************************************** 00002 filter.cpp - description 00003 ------------------- 00004 begin : july 2nd, 2006 00005 copyright : (C) 2006 by Frédéric RODRIGO 00006 email : f.rodrigo free.fr 00007 00008 $Id: filter.cpp 83 2006-11-05 20:46:42Z neoneurone $ 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * any later version. * 00017 * * 00018 ***************************************************************************/ 00019 00020 #include "filter.h" 00021 00022 namespace MapGen 00023 { 00024 00025 /*=====================================================================*/ 00026 Filter::Filter() 00027 { 00028 MAP_DEBUG( "ctor" ); 00029 } 00030 00031 00032 /*=====================================================================*/ 00033 Filter::~Filter() 00034 { 00035 MAP_DEBUG( "dtor" ); 00036 } 00037 00038 00039 /*=====================================================================*/ 00040 void Filter::apply( Map* map ) 00041 { 00042 } 00043 00044 00045 /*=====================================================================*/ 00046 void Filter::_getMinMax( 00047 const Map* map, 00048 float* min, 00049 float* max ) 00050 { 00051 *min = *max = map->getAt( 0, 0 ); 00052 00053 for( uint x=0 ; x<map->getW() ; ++x ) 00054 for( uint y=0 ; y<map->getH() ; ++y ) 00055 { 00056 float val = map->getAt( x, y ); 00057 if( val < *min ) 00058 *min = val; 00059 if( val > *max ) 00060 *max = val; 00061 } 00062 } 00063 00064 }
1.4.2