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

Gain file loading and saving using consistent with vendor header format #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

kgofron
Copy link

@kgofron kgofron commented May 31, 2019

No description provided.

Copy link
Member

@MarkRivers MarkRivers left a comment

Choose a reason for hiding this comment

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

What are you not writing and reading the fileHeader_ structure in a single fwrite() or fread() as is done when reading the bad pixel file?

Why are the fileHeader_ and imageHeader_ structure now member variables, rather than automatic variables?

@brunoseivam
Copy link
Member

Also, if the structure was declared as packed, you could probably do:

fwrite((void *) &fileHeader_, sizeof(fileHeader), 1, pOutputFile);

@jwlodek
Copy link
Member

jwlodek commented Jun 3, 2019

We were trying to make the read and write calls be more human readable, which is why we chose to split them into individual reads and writes rather than just writing a number of bytes. I think Bruno's suggestion would actually make the most sense, given that the structure is packed as of some of the recent commits.

As for the member variables, we chose to change that because when writing a gain file the file header remains the same for the same camera, so it was simpler to save the header on load into a member variable, and then just write the same header to the top of the new gain file.

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.

4 participants