Addes libopenjpeg (jpeg2000) support to the Makefiles
[blender.git] / source / blender / imbuf / intern / readimage.c
index 566df53a25e6033ca261bc1a9bfdc7ed25206e0a..6df92f69fffee8e0947b33ab456b8ef8bc6ea450 100644 (file)
  * $Id$
  */
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <io.h>
 #include <stddef.h>
 #include <sys/types.h>
 #include "mmap_win.h"
+#define open _open
+#define read _read
+#define close _close
 #endif
 
 #include "BLI_blenlib.h"
 #include "IMB_dpxcineon.h"
 #include "BKE_global.h"
 
+#ifdef WITH_OPENJPEG
+#include "IMB_jp2.h"
+#endif
+
 #ifdef WITH_OPENEXR
 #include "openexr/openexr_api.h"
 #endif
@@ -158,11 +165,16 @@ ImBuf *IMB_ibImageFromMemory(int *mem, int size, int flags) {
                if (ibuf) return (ibuf);
 #endif
 
+#ifdef WITH_OPENJPEG
+               ibuf = imb_jp2_decode((uchar *)mem, size, flags);
+               if (ibuf) return (ibuf);
+#endif
+
 #ifdef WITH_DDS
                ibuf = imb_load_dds((uchar *)mem, size, flags);
                if (ibuf) return (ibuf);
 #endif
-               
+       
 #ifdef WITH_QUICKTIME
 #if defined(_WIN32) || defined (__APPLE__)
                if(G.have_quicktime) {