summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-12-04 11:20:04 +0000
committerCarl Hetherington <cth@carlh.net>2015-12-04 21:12:46 +0000
commitd526a5fb537af1c9bcac2d00df6797d004fd919b (patch)
treee81870076f55df045e9ae58831a8d43cc3e4342a /src
parentd4a2e054dee6ee80b578500e47f4eaf84731f140 (diff)
Add a couple of accessors for OpenJPEGImage.
Diffstat (limited to 'src')
-rw-r--r--src/openjpeg_image.cc12
-rw-r--r--src/openjpeg_image.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/openjpeg_image.cc b/src/openjpeg_image.cc
index 88e896e6..047e74dc 100644
--- a/src/openjpeg_image.cc
+++ b/src/openjpeg_image.cc
@@ -89,3 +89,15 @@ OpenJPEGImage::size () const
/* XXX: this may not be right; x0 and y0 can presumably be non-zero */
return dcp::Size (_opj_image->x1, _opj_image->y1);
}
+
+int
+OpenJPEGImage::precision (int component) const
+{
+ return _opj_image->comps[component].prec;
+}
+
+bool
+OpenJPEGImage::srgb () const
+{
+ return _opj_image->color_space == OPJ_CLRSPC_SRGB;
+}
diff --git a/src/openjpeg_image.h b/src/openjpeg_image.h
index 42cdb065..9687c887 100644
--- a/src/openjpeg_image.h
+++ b/src/openjpeg_image.h
@@ -40,6 +40,8 @@ public:
int* data (int) const;
dcp::Size size () const;
+ int precision (int component) const;
+ bool srgb () const;
/** @return Pointer to opj_image_t struct. The caller
* must not delete this.