Skip to content

Commit

Permalink
restrict rgb values to range [0-255]
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Jan 20, 2021
1 parent 79402ad commit ac4ad30
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/pointcloud/qgspointcloudrgbrenderer.cpp
Expand Up @@ -153,6 +153,10 @@ void QgsPointCloudRgbRenderer::renderBlock( const QgsPointCloudBlock *block, Qgs
blue = mBlueContrastEnhancement->enhanceContrast( blue );
}

red = std::max( 0, std::min( 255, red ) );
green = std::max( 0, std::min( 255, green ) );
blue = std::max( 0, std::min( 255, blue ) );

drawPoint( x, y, QColor( red, green, blue ), context );
rendered++;
}
Expand Down

0 comments on commit ac4ad30

Please sign in to comment.