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

add 32 export in raw #876

Merged
merged 12 commits into from
Jul 20, 2014
Merged

add 32 export in raw #876

merged 12 commits into from
Jul 20, 2014

Conversation

kerautret
Copy link
Member

just to export 32 bits images

* GenericWriter
* Template partial specialisation for volume images of dimension 3 and unsigned int value type (which allows to export raw file format).
**/
template <typename TContainer, typename TFunctor>
Copy link
Member

Choose a reason for hiding this comment

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

So you can consider DGtal::uint32_t as specialization type instead if unsigned int

Copy link
Member Author

Choose a reason for hiding this comment

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

yes ok

@dcoeurjo
Copy link
Member

dcoeurjo commented Jul 8, 2014

Without the raw32 reader, it's a bit hard to check possible issues with the endianess.

@dcoeurjo
Copy link
Member

any update ?

@kerautret
Copy link
Member Author

I look it

@kerautret
Copy link
Member Author

I am working on Raw32 integration in generic reader not yet finished

@kerautret
Copy link
Member Author

@dcoeurjo should be good now : we have both reader and writer 32 bits for raw ;à

template <typename TContainer, typename TFunctor>
struct GenericWriter<TContainer, 2, DGtal::uint32_t, TFunctor>
{
BOOST_CONCEPT_ASSERT(( CConstImage<TContainer> )) ;
Copy link
Member

Choose a reason for hiding this comment

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

maybe it's dangerous here... We using genericwriter on value type T, the behavior would be:

  • export as raw8 with cast function from T -> char
  • except if T==uint32_t which would be exported as raw32

This is maybe a bit complex/strange for the user... I would say: in the generic wirter/reader, we only consider raw8 export. If the user wants raw32, he/she has to explicitly use the Raw32 method of the raw writer.. what do you think ?

@kerautret
Copy link
Member Author

I am not sure that complex for user:

  • If the user has uint32 image, by default the generic writer will write it with 32 bits support.
  • But if strangely enough, the user prefers to export in raw8 he can specifically call the raw8 of the RawWriter
  • if the user has a 8 bits image, the raw8 will be called an no pb.

But perhaps you are right just if a user use a 32 bits image and just want export it in pgm it will compile but wll finished with an error message in the execution. Perhaps we can just indicate to the user to change the image mode to export in pgm ?

@dcoeurjo
Copy link
Member

okay but what is the behavior for 'unsigned int' ? raw32 or raw8 ?
I don't know if the compiler is such that unsigned int == uint32_t

But that's weird case I admit..

Have you make it clear in the doc ?

@kerautret
Copy link
Member Author

perhaps it is dependent of the system, for me unsigned int = uint32 but since it only specialized with uint32 it should be fine.
I add some details in the doc

@kerautret
Copy link
Member Author

@dcoeurjo done

@dcoeurjo
Copy link
Member

ok merging

dcoeurjo added a commit that referenced this pull request Jul 20, 2014
@dcoeurjo dcoeurjo merged commit af5b964 into DGtal-team:master Jul 20, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants