Skip to content
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

Adding raw I/O capabilities for non integral types and signed integers. #1084

Merged
merged 10 commits into from
Dec 24, 2015

Conversation

rolanddenis
Copy link
Member

E.g. works with double or int using exportRaw and importRaw methods.

Note: in the writer, put accept a std::ostream::char_type which is, by default, a char. So, I don't understand why the conversion from an unsigned char don't not lead to a bug ...

@dcoeurjo
Copy link
Member

dcoeurjo commented Dec 7, 2015

Tricky bugfix, thanks.
Could you please add a small unit test (eg to check that no warning are raised on Travis bots when using the class) ?

@rolanddenis
Copy link
Member Author

Done. I have added writer test in the reader test file.

}

/*
TEST_CASE( "Checking writing & reading double in 4D with generic IO", "[reader][writer][4D][raw][double]" )
Copy link
Member

Choose a reason for hiding this comment

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

code cleanup ?

@dcoeurjo
Copy link
Member

thanks for the test. I only have a minor comment

@rolanddenis
Copy link
Member Author

Done ;)

@dcoeurjo
Copy link
Member

Thanks
Oops I forgot something: could you please update the module documentation page ?

@rolanddenis
Copy link
Member Author

Added.

@dcoeurjo
Copy link
Member

In I meant moduleIO.dox page :)

@rolanddenis
Copy link
Member Author

Haa ok. Should I also update GenericReader and GenericWriter to allow I/O on any type ? Currently, only 8bits and 32bits raw file are supported.

@dcoeurjo
Copy link
Member

I don't know for GenericWriter/Reader since the extension is used to switch between formats (with implicit cast if the Image value type is not the same).

@rolanddenis
Copy link
Member Author

It seems that the extension is always "raw" and that the value type if deduced from the Image::Value type. I'll give it a try ;)

@rolanddenis
Copy link
Member Author

Done. I have also fixed some bugs in GenericReader/Writer. By the way, those files are not very understandable and it is not clear whether the same ( file format, value type ) pairs are supported by both classes.

With C++11, it is possible to simplify this by using functor return or parameter type to set the file value type.

@dcoeurjo
Copy link
Member

Thanks a lot.
Merging

dcoeurjo added a commit that referenced this pull request Dec 24, 2015
Adding raw I/O capabilities for non integral types and signed integers.
@dcoeurjo dcoeurjo merged commit a4ef5ce into DGtal-team:master Dec 24, 2015
@rolanddenis rolanddenis deleted the pr_raw branch March 16, 2016 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants