summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-10-21 17:21:36 +0200
committerGitHub <noreply@github.com>2021-10-21 17:21:36 +0200
commit9f70bf0ad1ba02fa3af87c552647bbc05c94c18e (patch)
tree0fa0b5ec1b13612115b847bdc3d1da4fba40ae67 /src/lib
parent714c63efee203a46fe366d22c0077425052bb62c (diff)
parent0b5d62684fe360e098e3bccaef02ee3e9781cec4 (diff)
Merge pull request #1383 from rouault/deprecate_bpp
API: deprecate 'bpp' member in favor of 'prec'
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/image.c1
-rw-r--r--src/lib/openjp2/j2k.c8
-rw-r--r--src/lib/openjp2/openjpeg.h18
3 files changed, 16 insertions, 11 deletions
diff --git a/src/lib/openjp2/image.c b/src/lib/openjp2/image.c
index fe373905..017201a0 100644
--- a/src/lib/openjp2/image.c
+++ b/src/lib/openjp2/image.c
@@ -66,7 +66,6 @@ opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts,
comp->x0 = cmptparms[compno].x0;
comp->y0 = cmptparms[compno].y0;
comp->prec = cmptparms[compno].prec;
- comp->bpp = cmptparms[compno].bpp;
comp->sgnd = cmptparms[compno].sgnd;
if (comp->h != 0 &&
(OPJ_SIZE_T)comp->w > SIZE_MAX / comp->h / sizeof(OPJ_INT32)) {
diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c
index c45e4dbd..3bfe8020 100644
--- a/src/lib/openjp2/j2k.c
+++ b/src/lib/openjp2/j2k.c
@@ -6975,7 +6975,7 @@ static OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_UINT16 rsiz,
/* Bitdepth */
for (i = 0; i < image->numcomps; i++) {
- if ((image->comps[i].bpp != 12) | (image->comps[i].sgnd)) {
+ if ((image->comps[i].prec != 12) | (image->comps[i].sgnd)) {
char signed_str[] = "signed";
char unsigned_str[] = "unsigned";
char *tmp_str = image->comps[i].sgnd ? signed_str : unsigned_str;
@@ -6984,7 +6984,7 @@ static OPJ_BOOL opj_j2k_is_cinema_compliant(opj_image_t *image, OPJ_UINT16 rsiz,
"Precision of each component shall be 12 bits unsigned"
"-> At least component %d of input image (%d bits, %s) is not compliant\n"
"-> Non-profile-3 codestream will be generated\n",
- i, image->comps[i].bpp, tmp_str);
+ i, image->comps[i].prec, tmp_str);
return OPJ_FALSE;
}
}
@@ -7275,7 +7275,7 @@ static OPJ_BOOL opj_j2k_is_imf_compliant(opj_cparameters_t *parameters,
/* Bitdepth */
for (i = 0; i < image->numcomps; i++) {
- if (!(image->comps[i].bpp >= 8 && image->comps[i].bpp <= 16) ||
+ if (!(image->comps[i].prec >= 8 && image->comps[i].prec <= 16) ||
(image->comps[i].sgnd)) {
char signed_str[] = "signed";
char unsigned_str[] = "unsigned";
@@ -7284,7 +7284,7 @@ static OPJ_BOOL opj_j2k_is_imf_compliant(opj_cparameters_t *parameters,
"IMF profiles require precision of each component to b in [8-16] bits unsigned"
"-> At least component %d of input image (%d bits, %s) is not compliant\n"
"-> Non-IMF codestream will be generated\n",
- i, image->comps[i].bpp, tmp_str);
+ i, image->comps[i].prec, tmp_str);
ret = OPJ_FALSE;
}
}
diff --git a/src/lib/openjp2/openjpeg.h b/src/lib/openjp2/openjpeg.h
index 8829963f..68e4e7e1 100644
--- a/src/lib/openjp2/openjpeg.h
+++ b/src/lib/openjp2/openjpeg.h
@@ -76,6 +76,12 @@ Most compilers implement their own version of this keyword ...
#define OPJ_DEPRECATED(func) func
#endif
+#if defined(__GNUC__) && __GNUC__ >= 6
+#define OPJ_DEPRECATED_STRUCT_MEMBER(memb, msg) __attribute__ ((deprecated(msg))) memb
+#else
+#define OPJ_DEPRECATED_STRUCT_MEMBER(memb, msg) memb
+#endif
+
#if defined(OPJ_STATIC) || !defined(_WIN32)
/* http://gcc.gnu.org/wiki/Visibility */
# if !defined(_WIN32) && __GNUC__ >= 4
@@ -681,10 +687,10 @@ typedef struct opj_image_comp {
OPJ_UINT32 x0;
/** y component offset compared to the whole image */
OPJ_UINT32 y0;
- /** precision */
+ /** precision: number of bits per component per pixel */
OPJ_UINT32 prec;
- /** image depth in bits */
- OPJ_UINT32 bpp;
+ /** obsolete: use prec instead */
+ OPJ_DEPRECATED_STRUCT_MEMBER(OPJ_UINT32 bpp, "Use prec instead");
/** signed (1) / unsigned (0) */
OPJ_UINT32 sgnd;
/** number of decoded resolution */
@@ -738,10 +744,10 @@ typedef struct opj_image_comptparm {
OPJ_UINT32 x0;
/** y component offset compared to the whole image */
OPJ_UINT32 y0;
- /** precision */
+ /** precision: number of bits per component per pixel */
OPJ_UINT32 prec;
- /** image depth in bits */
- OPJ_UINT32 bpp;
+ /** obsolete: use prec instead */
+ OPJ_DEPRECATED_STRUCT_MEMBER(OPJ_UINT32 bpp, "Use prec instead");
/** signed (1) / unsigned (0) */
OPJ_UINT32 sgnd;
} opj_image_cmptparm_t;