summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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.