-
-
Notifications
You must be signed in to change notification settings - Fork 713
Let IOComponent::CHAR represents signed char
#5450
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
Let IOComponent::CHAR represents signed char
#5450
Conversation
The signedness of the C++ type `char` depends on platform and compilation, so it is preferable to use `signed char` for signed numeric pixel values.
IOComponent::CHAR represents signed charIOComponent::CHAR represents signed char
Let ImageFileReader, MeshFileReader, and VideoFileReader interpret `IOComponentEnum::CHAR` as `signed char`, instead of `char`. This ensures that 8-bits signed data files are properly interpreted.
Let both HashTestImage (itkTestDriverInclude) and itkTIFFImageIOCompressionTest interpret `IOComponent::CHAR` as `signed char`
Let `ImageIOBase::ReadBufferAsASCII` interpret `IOComponentEnum::CHAR` as `signed char`
3159a22 to
d26cce4
Compare
blowekamp
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this change. This change now matches how I have seen this enum type used for ImageIO. Getting this cleanup up and documented is a good step forward.
|
For the record,
This logic was syntactically restyled (but not altered, sematically) into
|
|
As far as I can see, On the other hand, |
|
I just saw that GCC has the |
@blowekamp The test failures of my experiment show that ITK currently does not work with
The failures can typically be fixed by explicitly using |
IOComponent::CHARrepresentingsigned charCHARenum assigned char(instead of just plainchar)Triggered by a discussion with Bradley (@blowekamp) at https://discourse.itk.org/t/long-double-support-for-imageio-meshio-pixels/7570/11 and his comment at #5449 (comment)