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

Separate CLI from library #7

Open
tansy opened this issue Nov 18, 2022 · 1 comment
Open

Separate CLI from library #7

tansy opened this issue Nov 18, 2022 · 1 comment

Comments

@tansy
Copy link
Contributor

tansy commented Nov 18, 2022

I want to suggets some changes in this program.
It shouldd work as a client to the "server", a library, which provides routines to en/decode image/s.
Main CLI (Command Line Interface) would be a simple program that would only deal with reading/writing files and processing arguments and processing images would be done by library, (more or less as it is in nhw-encoder) preferably in memory, and cli-client would only call necessary routines.
Check BALZ source and crush, and libcrush to see what I mean.

First - command line interface: use input and output instaead of automatic naming.

$ nhw-dec <file.nhw> <file.bmp>

You don't know what user wants and don't want to be smarter than them. They know what they do.

decode_image() and parse_file to use string instead od argv**.

decode_image(): instead of decode_image(image_buffer *im,decode_state *os,char *file_name) it should rather go like this: decode_image(decode_state *os, image_buffer *im) and there would be write_image(decode_state *os, image_buffer *im, char* file_name)

Process image in memory, and share state/context structure beteen functions. Have designated functions to read/write from file to/from memory rather than doing hundreds of disk reads/writes (with fread/fwrite). For reference check crush and libcrush linked above.

@tansy
Copy link
Contributor Author

tansy commented Nov 19, 2022

It would be better if all quality options were unified (proposed in #9) and all these parameters wvlt_thrxX put in the table and filled accordingly to the quality parameter.

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

No branches or pull requests

1 participant