From 554f066d0b048d6c86b9cbeec9ebe27ff552a709 Mon Sep 17 00:00:00 2001 From: John Evans Date: Sat, 8 Mar 2014 14:13:36 -0500 Subject: [PATCH] Added alpha member. Updated through r2451. #139 --- docs/source/detailed_installation.rst | 2 +- glymur/lib/openjp2.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/source/detailed_installation.rst b/docs/source/detailed_installation.rst index 5c8d7ad..f18d77e 100644 --- a/docs/source/detailed_installation.rst +++ b/docs/source/detailed_installation.rst @@ -13,7 +13,7 @@ both read and write JPEG 2000 files, but you may wish to install version 2.0 or the 2.0+ version from OpenJPEG's development trunk for better performance. If you do that, you should compile it as a shared library (named *openjp2* instead of *openjpeg*) from the developmental source that you can retrieve -via subversion. As of this time of writing, svn revision r2436 works. +via subversion. As of this time of writing, svn revision r2451 works. You should also download the test data for the purpose of configuring and running OpenJPEG's test suite, check their instructions for all this. You should set the **OPJ_DATA_ROOT** environment variable for the purpose diff --git a/glymur/lib/openjp2.py b/glymur/lib/openjp2.py index f056db0..5430110 100644 --- a/glymur/lib/openjp2.py +++ b/glymur/lib/openjp2.py @@ -35,6 +35,7 @@ CLRSPC_UNSPECIFIED = 0 CLRSPC_SRGB = 1 CLRSPC_GRAY = 2 CLRSPC_YCC = 3 +CLRSPC_EYCC = 4 COLOR_SPACE_TYPE = ctypes.c_int # supported codec @@ -390,7 +391,11 @@ class ImageCompType(ctypes.Structure): ("factor", ctypes.c_uint32), # image component data - ("data", ctypes.POINTER(ctypes.c_int32))] + ("data", ctypes.POINTER(ctypes.c_int32)), + + # alpha channel + # TODO: exclude for 2.0, 1.5 + ("alpha", ctypes.POINTER(ctypes.c_uint16))] class ImageType(ctypes.Structure):