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

Should png, jpeg and aec pack/unpack functions be public? #514

Closed
DusanJovic-NOAA opened this issue Sep 20, 2024 · 2 comments · Fixed by #532
Closed

Should png, jpeg and aec pack/unpack functions be public? #514

DusanJovic-NOAA opened this issue Sep 20, 2024 · 2 comments · Fixed by #532
Assignees
Labels
enhancement New feature or request

Comments

@DusanJovic-NOAA
Copy link
Contributor

Currently, theses 6 functions are public (declared in grib2.h):


/* Compression. */
void pngpack(float *fld, g2int width, g2int height, g2int *idrstmpl,
             unsigned char *cpack, g2int *lcpack);
g2int pngunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
                float *fld);
void jpcpack(float *fld, g2int width, g2int height, g2int *idrstmpl,
             unsigned char *cpack, g2int *lcpack);
g2int jpcunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
                float *fld);
void aecpack(float *fld, g2int width, g2int height, g2int *idrstmpl,
             unsigned char *cpack, g2int *lcpack);
g2int aecunpack(unsigned char *cpack, g2int len, g2int *idrstmpl, g2int ndpts,
                float *fld);

Why are they public? How are users supposed to use them? And why would they need to use them?

I think these should be made private. They are internal implementation, and we should be allowed to change the signature without breaking the user's code. If they are public, we are basically promising to never change them, for whatever reason.

@DusanJovic-NOAA
Copy link
Contributor Author

Other pack/unpack functions, like simpack/simunpack, specpack/specunpack etc, are private.

@edwardhartnett
Copy link
Contributor

Agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants