Mac / COCOA : Imbuf
[blender.git] / source / blender / imbuf / intern / readimage.c
index 4104a8db65ce63a53f6b25658edb59817a0eb432..5003127dfb61fa1bd86e8b0774117ac32e97ba8e 100644 (file)
 #include "IMB_hamx.h"
 #include "IMB_jpeg.h"
 #include "IMB_bmp.h"
-#include "IMB_tiff.h"
 #include "IMB_radiance_hdr.h"
 #include "IMB_dpxcineon.h"
 #include "BKE_global.h"
 
+#if defined(__APPLE__) && defined(GHOST_COCOA)
+#include "IMB_cocoa.h"
+#else
+#include "IMB_tiff.h"
+#endif
+
 #ifdef WITH_OPENJPEG
 #include "IMB_jp2.h"
 #endif
@@ -152,11 +157,19 @@ ImBuf *IMB_ibImageFromMemory(int *mem, int size, int flags) {
                ibuf = imb_loadcineon((uchar *)mem, size, flags);
                if (ibuf) return(ibuf);
        
+#if defined(__APPLE__) && defined(GHOST_COCOA)
+               ibuf = imb_cocoaLoadImage((uchar *)mem, size, flags);
+               if(ibuf) {
+                       ibuf->ftype = TIF;
+                       return ibuf;
+               }
+#else
                if (G.have_libtiff) {
                        ibuf = imb_loadtiff((uchar *)mem, size, flags);
                        if (ibuf) return(ibuf);
                }
-
+#endif
+               
                ibuf = imb_loadhdr((uchar*)mem, size, flags);
                if (ibuf) return (ibuf);