qgsrastershaderfunction.cpp

来自「一个非常好的GIS开源新版本」· C++ 代码 · 共 100 行

CPP
100
字号
/* **************************************************************************                qgsrastershaderfunction.cpp -  description                       -------------------begin                : Fri Dec 28 2007copyright            : (C) 2007 by Peter J. Erstsemail                : ersts@amnh.org****************************************************************************//* ************************************************************************** *                                                                         * *   This program is free software; you can redistribute it and/or modify  * *   it under the terms of the GNU General Public License as published by  * *   the Free Software Foundation; either version 2 of the License, or     * *   (at your option) any later version.                                   * *                                                                         * ***************************************************************************/#include "qgslogger.h"#include "qgsrastershaderfunction.h"QgsRasterShaderFunction::QgsRasterShaderFunction(double theMinimumValue, double theMaximumValue){#ifdef QGISDEBUG      QgsDebugMsg("QgsRasterShaderFunction::QgsRasterShaderFunction called");#endif  mMinimumValue = theMinimumValue;  mMaximumValue = theMaximumValue;  mMinimumMaximumRange = mMaximumValue - mMinimumValue;}/**   Generates and new RGB value based on one input value    @param theValue The original value to base a new RGB value on  @param theReturnRedValue  The red component of the new RGB value  @param theReturnGreenValue  The green component of the new RGB value  @param theReturnBlueValue  The blue component of the new RGB value  @return True if the return values are valid otherwise false*/bool QgsRasterShaderFunction::generateShadedValue(double theValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue){  *theReturnRedValue = 0;  *theReturnGreenValue = 0;  *theReturnBlueValue = 0;    return false;}/**   Generates and new RGB value based on an original RGB value        @param theRedValue The red component of the original value to base a new RGB value on  @param theGreenValue The green component of the original value to base a new RGB value on  @param theBlueValue The blue component of the original value to base a new RGB value on  @param theReturnRedValue  The red component of the new RGB value  @param theReturnGreenValue  The green component of the new RGB value  @param theReturnBlueValue  The blue component of the new RGB value  @return True if the return values are valid otherwise false*/bool QgsRasterShaderFunction::generateShadedValue(double theRedValue, double theGreenValue, double theBlueValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue){  *theReturnRedValue = 0;  *theReturnGreenValue = 0;  *theReturnBlueValue = 0;    return false;}/**    Set the maximum value for the raster shader.         @param theValue The new maximum value*/void QgsRasterShaderFunction::setMaximumValue(double theValue){#ifdef QGISDEBUG      QgsDebugMsg("QgsRasterShaderFunction::setMaximumValue called - Value = " + QString::number(theValue));#endif  mMaximumValue = theValue;  mMinimumMaximumRange = mMaximumValue - mMinimumValue;}/**    Set the maximum value for the raster shader        @param theValue The new minimum value*/void QgsRasterShaderFunction::setMinimumValue(double theValue){#ifdef QGISDEBUG      QgsDebugMsg("QgsRasterShaderFunction::setMinimumValue called - Value = " + QString::number(theValue));#endif  mMinimumValue = theValue;  mMinimumMaximumRange = mMaximumValue - mMinimumValue;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?