Update of /cvsroot/pure-data/externals/pidip/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22882
Modified Files: pdp_capture.c Log Message: adapted to newer Image Magick
Index: pdp_capture.c =================================================================== RCS file: /cvsroot/pure-data/externals/pidip/modules/pdp_capture.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pdp_capture.c 9 Jul 2005 19:35:40 -0000 1.3 --- pdp_capture.c 27 Oct 2005 13:20:43 -0000 1.4 *************** *** 201,209 **** if (window_info == (WindowInfo *) NULL) { ! window_info=(WindowInfo *) AcquireMemory(max_windows*sizeof(WindowInfo)); } else { ! ReacquireMemory((void **) &window_info,max_windows*sizeof(WindowInfo)); } } --- 201,209 ---- if (window_info == (WindowInfo *) NULL) { ! window_info=(WindowInfo *) AcquireMemory(max_windows*sizeof(*window_info)); } else { ! window_info=(WindowInfo *) ResizeMagickMemory(window_info,max_windows*sizeof(*window_info)); } } *************** *** 336,341 **** --- 336,346 ---- return((Image *) NULL); } + #if MagickLibVersion >= 0x608 + if ((window_info[id].visual->klass != DirectColor) && + (window_info[id].visual->klass != TrueColor)) + #else if ((window_info[id].visual->storage_class != DirectColor) && (window_info[id].visual->storage_class != TrueColor)) + #endif { for (i=0; i < (int) number_colors; i++) *************** *** 390,395 **** return((Image *) NULL); } ! if ((window_info[id].visual->storage_class != TrueColor) && ! (window_info[id].visual->storage_class != DirectColor)) { composite_image->storage_class=PseudoClass; --- 395,405 ---- return((Image *) NULL); } ! #if MagickLibVersion >= 0x608 ! if ((window_info[id].visual->klass != DirectColor) && ! (window_info[id].visual->klass != TrueColor)) ! #else ! if ((window_info[id].visual->storage_class != DirectColor) && ! (window_info[id].visual->storage_class != TrueColor)) ! #endif { composite_image->storage_class=PseudoClass; *************** *** 427,431 **** --- 437,445 ---- } if ((number_colors != 0) && + #if MagickLibVersion >= 0x608 + (window_info[id].visual->klass == DirectColor)) + #else (window_info[id].visual->storage_class == DirectColor)) + #endif { for (y=0; y < (long) composite_image->rows; y++) *************** *** 536,541 **** --- 550,560 ---- { next=colormap_info->next; + #if MagickLibVersion >= 0x608 + colormap_info->colors=(XColor *) RelinquishMagickMemory(colormap_info->colors); + colormap_info=(ColormapInfo *) RelinquishMagickMemory(colormap_info); + #else LiberateMemory((void **) &colormap_info->colors); LiberateMemory((void **) &colormap_info); + #endif colormap_info=next; } *************** *** 543,547 **** --- 562,570 ---- Free resources and restore initial state. */ + #if MagickLibVersion >= 0x608 + window_info=(WindowInfo *) RelinquishMagickMemory(window_info); + #else LiberateMemory((void **) &window_info); + #endif window_info=(WindowInfo *) NULL; max_windows=0;