[trunk] Fix compilation errors when JPWL and/or MJ2 are build
authorMathieu Malaterre <mathieu.malaterre@gmail.com>
Tue, 11 Mar 2014 09:11:35 +0000 (09:11 +0000)
committerMathieu Malaterre <mathieu.malaterre@gmail.com>
Tue, 11 Mar 2014 09:11:35 +0000 (09:11 +0000)
src/bin/common/color.c
src/bin/mj2/CMakeLists.txt

index 5024ac9e0308d38669f1de02cbbcea9f91cbd453..a9b5e0c76c643d48cc241c12e053ba16253cadbd 100644 (file)
@@ -150,8 +150,13 @@ static void sycc422_to_rgb(opj_image_t *img)
        free(img->comps[1].data); img->comps[1].data = d1;
        free(img->comps[2].data); img->comps[2].data = d2;
 
+#if defined(USE_JPWL) || defined(USE_MJ2)
+       img->comps[1].w = maxw; img->comps[1].h = maxh;
+       img->comps[2].w = maxw; img->comps[2].h = maxh;
+#else
        img->comps[1].w = (OPJ_UINT32)maxw; img->comps[1].h = (OPJ_UINT32)maxh;
        img->comps[2].w = (OPJ_UINT32)maxw; img->comps[2].h = (OPJ_UINT32)maxh;
+#endif
        img->comps[1].dx = img->comps[0].dx;
        img->comps[2].dx = img->comps[0].dx;
        img->comps[1].dy = img->comps[0].dy;
@@ -209,8 +214,13 @@ static void sycc420_to_rgb(opj_image_t *img)
        free(img->comps[1].data); img->comps[1].data = d1;
        free(img->comps[2].data); img->comps[2].data = d2;
 
+#if defined(USE_JPWL) || defined(USE_MJ2)
+       img->comps[1].w = maxw; img->comps[1].h = maxh;
+       img->comps[2].w = maxw; img->comps[2].h = maxh;
+#else
        img->comps[1].w = (OPJ_UINT32)maxw; img->comps[1].h = (OPJ_UINT32)maxh;
        img->comps[2].w = (OPJ_UINT32)maxw; img->comps[2].h = (OPJ_UINT32)maxh;
+#endif
        img->comps[1].dx = img->comps[0].dx;
        img->comps[2].dx = img->comps[0].dx;
        img->comps[1].dy = img->comps[0].dy;
index e6b005b600ea5694ae22c2324e2289eec014fdb2..78ad7543ea74bd337b627c715fe00b5f93c5311a 100644 (file)
@@ -32,6 +32,10 @@ foreach(exe
     ${MJ2_SRCS}
     ${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
     )
+  set_property(
+    TARGET ${exe}
+    APPEND PROPERTY COMPILE_DEFINITIONS USE_MJ2
+  )
   target_link_libraries(${exe} ${LCMS_LIBNAME} openmj2)
   
   if(UNIX)