NCEPLIBS-g2c
NCEPLIBS-g2c copied to clipboard
Should png, jpeg and aec pack/unpack functions be public?
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.