diff --git a/python/plugins/processing/algs/grass7/description/i.colors.enhance.txt b/python/plugins/processing/algs/grass7/description/i.colors.enhance.txt new file mode 100644 index 00000000000..4a931c6132d --- /dev/null +++ b/python/plugins/processing/algs/grass7/description/i.colors.enhance.txt @@ -0,0 +1,15 @@ +i.colors.enhance +Performs auto-balancing of colors for RGB images. +Imagery (i.*) +ParameterRaster|red|Name of red channel|False +ParameterRaster|green|Name of green channel|False +ParameterRaster|blue|Name of blue channel|False +ParameterNumber|strength|Cropping intensity (upper brightness level)|0|100|98|True +*ParameterBoolean|-f|Extend colors to full range of data on each channel|False +*ParameterBoolean|-p|Preserve relative colors, adjust brightness only|False +*ParameterBoolean|-r|Reset to standard color range|False +*ParameterBoolean|-s|Process bands serially (default: run in parallel)|False +OutputRaster|redoutput|Enhanced Red +OutputRaster|greenoutput|Enhanced Green +OutputRaster|blueoutput|Enhanced Blue + diff --git a/python/plugins/processing/algs/grass7/ext/i_colors_enhance.py b/python/plugins/processing/algs/grass7/ext/i_colors_enhance.py new file mode 100644 index 00000000000..b5f45dbcf51 --- /dev/null +++ b/python/plugins/processing/algs/grass7/ext/i_colors_enhance.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- + +""" +*************************************************************************** + i_colors_enhance.py + ------------------- + Date : March 2016 + Copyright : (C) 2016 by Médéric Ribreux + Email : medspx at medspx dot fr +*************************************************************************** +* * +* 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. * +* * +*************************************************************************** +""" + +__author__ = 'Médéric Ribreux' +__date__ = 'March 2016' +__copyright__ = '(C) 2016, Médéric Ribreux' + +# This will get replaced with a git SHA1 when you do a git archive + +__revision__ = '$Format:%H$' + +from i import exportInputRasters + + +def processCommand(alg): + + # Temporary remove outputs: + outputs = [alg.getOutputFromName('{}output'.format(f)) for f in ['red', 'green', 'blue']] + for out in outputs: + alg.removeOutputFromName(out.name) + + alg.processCommand() + + # Re-add outputs + for output in outputs: + alg.addOutput(output) + + +def processOutputs(alg): + # Input rasters are output rasters + rasterDic = {'red': 'redoutput', 'green': 'greenoutput', 'blue': 'blueoutput'} + exportInputRasters(alg, rasterDic)