Skip to content

Commit

Permalink
fix formula in brightnesscontrast filter for rasters with opacity (fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy authored and nyalldawson committed Jul 10, 2020
1 parent 4713c7a commit 81518f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/raster/qgsbrightnesscontrastfilter.cpp
Expand Up @@ -183,7 +183,7 @@ int QgsBrightnessContrastFilter::adjustColorComponent( int colorComponent, int a
double adjustedColor = colorComponent / alphaFactor;

// Make sure to return a premultiplied color
return alphaFactor * qBound( 0., std::pow( ( ( ( ( ( ( adjustedColor / 255.0 ) - 0.5 ) * contrastFactor ) + 0.5 ) * 255 ) + brightness ) / 255, gammaCorrection ), 255. );
return alphaFactor * qBound( 0., 255 * std::pow( ( ( ( ( ( ( adjustedColor / 255.0 ) - 0.5 ) * contrastFactor ) + 0.5 ) * 255 ) + brightness ) / 255, gammaCorrection ), 255. );
}
}

Expand Down

0 comments on commit 81518f9

Please sign in to comment.