comparison src/image.c @ 109857:d7a20b755b64

configure support for MagickExportImagePixels and README
author Joakim <joakim@localhost.localdomain>
date Fri, 14 May 2010 12:07:01 +0200
parents ecac5346ac63
children 68616bb3ae25
comparison
equal deleted inserted replaced
109856:4baaa8ac0f74 109857:d7a20b755b64
7753 Interface :index is same as for GIF. */ 7753 Interface :index is same as for GIF. */
7754 Lisp_Object image; 7754 Lisp_Object image;
7755 long ino; 7755 long ino;
7756 image = image_spec_value (img->spec, QCindex, NULL); 7756 image = image_spec_value (img->spec, QCindex, NULL);
7757 ino = INTEGERP (image) ? XFASTINT (image) : 0; 7757 ino = INTEGERP (image) ? XFASTINT (image) : 0;
7758 7758
7759 /* if (ino >= ) */ 7759
7760 /* { */ 7760
7761 /* image_error ("Invalid image number `%s' in image `%s'", */ 7761 if (ino >= MagickGetNumberImages(image_wand))
7762 /* image, img->spec); */ 7762 {
7763 /* UNGCPRO; */ 7763 image_error ("Invalid image number `%s' in image `%s'",
7764 /* return 0; */ 7764 image, img->spec);
7765 /* } */ 7765 UNGCPRO;
7766 7766 return 0;
7767 }
7768
7769
7770 if (MagickGetNumberImages(image_wand) > 1)
7771 img->data.lisp_val = Fcons (Qcount,
7772 Fcons (make_number (MagickGetNumberImages(image_wand)),
7773 img->data.lisp_val));
7767 if(ino==0) 7774 if(ino==0)
7768 MagickSetFirstIterator(image_wand); 7775 MagickSetFirstIterator(image_wand);
7769 else 7776 else
7770 MagickSetIteratorIndex(image_wand, ino); 7777 MagickSetIteratorIndex(image_wand, ino);
7771 7778
7915 seems about 3 times as fast as pixel pushing(not carefully measured) 7922 seems about 3 times as fast as pixel pushing(not carefully measured)
7916 with color djvu, the bitplanes are mapped to wrong color(seems fixed). 7923 with color djvu, the bitplanes are mapped to wrong color(seems fixed).
7917 7924
7918 */ 7925 */
7919 pixelwidth=CharPixel;/*??? TODO figure out*/ 7926 pixelwidth=CharPixel;/*??? TODO figure out*/
7927 #ifdef HAVE_MAGICKEXPORTIMAGEPIXELS
7920 MagickExportImagePixels(image_wand, 7928 MagickExportImagePixels(image_wand,
7921 0,0, 7929 0,0,
7922 width,height, 7930 width,height,
7923 exportdepth, 7931 exportdepth,
7924 pixelwidth, 7932 pixelwidth,
7925 /*&(img->pixmap));*/ 7933 /*&(img->pixmap));*/
7926 ximg->data); 7934 ximg->data);
7935 #else
7936 image_error("You dont have MagickExportImagePixels, upgrade ImageMagick if you want to try it!",Qnil,Qnil);
7937 #endif
7927 } 7938 }
7928 7939
7929
7930 //TODO figure out imagecount here!
7931 if (MagickGetNumberImages(image_wand) > 1)
7932 img->data.lisp_val = Fcons (Qcount,
7933 Fcons (make_number (MagickGetNumberImages(image_wand)),
7934 img->data.lisp_val));
7935
7936 7940
7937 #ifdef COLOR_TABLE_SUPPORT 7941 #ifdef COLOR_TABLE_SUPPORT
7938 /* Remember colors allocated for this image. */ 7942 /* Remember colors allocated for this image. */
7939 img->colors = colors_in_color_table (&img->ncolors); 7943 img->colors = colors_in_color_table (&img->ncolors);
7940 free_color_table (); 7944 free_color_table ();