Skip to content

Commit

Permalink
move decodeDepth to header
Browse files Browse the repository at this point in the history
  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Jan 26, 2022
1 parent ca39281 commit 9c01fdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 0 additions & 5 deletions src/3d/qgs3dutils.cpp
Expand Up @@ -674,8 +674,3 @@ QVector2D Qgs3DUtils::textureToScreenCoordinates( QVector2D textureXY, QSize win
{
return QVector2D( textureXY.x() * winSize.width(), ( 1 - textureXY.y() ) * winSize.height() );
}

double Qgs3DUtils::decodeDepth( const QRgb &pixel )
{
return ( ( qRed( pixel ) / 255.0 + qGreen( pixel ) ) / 255.0 + qBlue( pixel ) ) / 255.0;
}
5 changes: 4 additions & 1 deletion src/3d/qgs3dutils.h
Expand Up @@ -225,7 +225,10 @@ class _3D_EXPORT Qgs3DUtils
*
* \since QGIS 3.24
*/
static inline double decodeDepth( const QRgb &pixel );
static double decodeDepth( const QRgb &pixel )
{
return ( ( qRed( pixel ) / 255.0 + qGreen( pixel ) ) / 255.0 + qBlue( pixel ) ) / 255.0;
}
};

#endif // QGS3DUTILS_H

0 comments on commit 9c01fdf

Please sign in to comment.