Skip to content

GTiff: support creating Float16, and read it as Float16 (instead of Float32 with NBITS=16) #12135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 14, 2025

Conversation

rouault
Copy link
Member

@rouault rouault commented Apr 13, 2025

No description provided.

@rouault rouault added enhancement funded through GSP Work funded through the GDAL Sponsorship Program labels Apr 13, 2025
@rouault rouault added this to the 3.11.0 milestone Apr 13, 2025
@coveralls
Copy link
Collaborator

coveralls commented Apr 13, 2025

Coverage Status

coverage: 70.585% (-0.006%) from 70.591%
when pulling 8f8e27f on rouault:gtiff_float16
into 29aee5d on OSGeo:master.

@@ -1895,6 +1909,13 @@ static void DiscardLsb(GByte *pabyBuffer, GPtrDiff_t nBytes, int iBand,
nPlanarConfig, panMaskOffsetLsb,
bHasNoData, nNoDataValue);
}
else if (nBitsPerSample == 16 && nSampleFormat == SAMPLEFORMAT_IEEEFP)
{
GFloat16 fNoDataValue = static_cast<GFloat16>(dfNoDataValue);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GFloat16 fNoDataValue = static_cast<GFloat16>(dfNoDataValue);
const GFloat16 fNoDataValue = static_cast<GFloat16>(dfNoDataValue);

@rouault rouault merged commit f16911b into OSGeo:master Apr 14, 2025
34 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement funded through GSP Work funded through the GDAL Sponsorship Program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants