From f34a145c545cb86152ad42a787f6d5fffea6b77c Mon Sep 17 00:00:00 2001 From: cristy Date: Sat, 24 Oct 2009 22:29:27 +0000 Subject: [PATCH] --- Makefile.in | 345 +++--- coders/Make.com | 3 +- coders/Makefile.am | 8 - coders/avi.c | 2231 -------------------------------------- coders/mpeg.c | 7 + magick/cache.c | 106 +- magick/cache.h | 4 +- magick/coder.c | 60 +- magick/coder.h | 4 +- magick/color.c | 244 ++--- magick/color.h | 4 +- magick/configure.c | 60 +- magick/configure.h | 4 +- magick/constitute.c | 98 +- magick/constitute.h | 4 +- magick/delegate.c | 60 +- magick/delegate.h | 4 +- magick/deprecate.c | 2 +- magick/locale.c | 106 +- magick/locale_.h | 6 +- magick/log.c | 160 +-- magick/log.h | 4 +- magick/magic.c | 150 +-- magick/magic.h | 6 +- magick/magick.c | 190 ++-- magick/magick.h | 4 +- magick/methods.h | 36 +- magick/mime.c | 148 +-- magick/mime.h | 6 +- magick/module.c | 106 +- magick/module.h | 4 +- magick/nt-base.c | 2 +- magick/policy.c | 150 +-- magick/policy.h | 6 +- magick/random.c | 60 +- magick/random_.h | 4 +- magick/registry.c | 70 +- magick/registry.h | 4 +- magick/resource.c | 382 +++---- magick/resource_.h | 8 +- magick/semaphore.c | 104 +- magick/semaphore.h | 6 +- magick/type.c | 106 +- magick/type.h | 6 +- magick/xwindow-private.h | 4 +- magick/xwindow.c | 92 +- 46 files changed, 1447 insertions(+), 3731 deletions(-) delete mode 100644 coders/avi.c diff --git a/Makefile.in b/Makefile.in index 59d6192bd..56745ab2d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -384,15 +384,6 @@ coders_art_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(coders_art_la_LDFLAGS) $(LDFLAGS) -o $@ @WITH_MODULES_TRUE@am_coders_art_la_rpath = -rpath $(codersdir) -am__DEPENDENCIES_1 = -coders_avi_la_DEPENDENCIES = $(MAGICKCORE_LIBS) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) -am_coders_avi_la_OBJECTS = coders/coders_avi_la-avi.lo -coders_avi_la_OBJECTS = $(am_coders_avi_la_OBJECTS) -coders_avi_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(coders_avi_la_LDFLAGS) $(LDFLAGS) -o $@ -@WITH_MODULES_TRUE@am_coders_avi_la_rpath = -rpath $(codersdir) coders_avs_la_DEPENDENCIES = $(MAGICKCORE_LIBS) am_coders_avs_la_OBJECTS = coders/coders_avs_la-avs.lo coders_avs_la_OBJECTS = $(am_coders_avs_la_OBJECTS) @@ -453,6 +444,7 @@ coders_clip_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_CFLAGS) $(CFLAGS) $(coders_clip_la_LDFLAGS) $(LDFLAGS) -o \ $@ @WITH_MODULES_TRUE@am_coders_clip_la_rpath = -rpath $(codersdir) +am__DEPENDENCIES_1 = coders_clipboard_la_DEPENDENCIES = $(MAGICKCORE_LIBS) \ $(am__DEPENDENCIES_1) am_coders_clipboard_la_OBJECTS = \ @@ -1380,35 +1372,34 @@ am__magick_libMagickCore_la_SOURCES_DIST = magick/ImageMagick.h \ magick/version.c magick/version.h magick/vms.h magick/widget.c \ magick/widget.h magick/xml-tree.c magick/xml-tree.h \ magick/xwindow.c magick/xwindow.h magick/nt-feature.c \ - magick/nt-base.c coders/art.c coders/avi.c coders/avs.c \ - coders/bmp.c coders/braille.c coders/cals.c coders/caption.c \ - coders/cin.c coders/cip.c coders/clip.c coders/cmyk.c \ - coders/cut.c coders/dcm.c coders/dds.c coders/dib.c \ - coders/dng.c coders/dot.c coders/dpx.c coders/fax.c \ - coders/fits.c coders/gif.c coders/gradient.c coders/gray.c \ - coders/hald.c coders/histogram.c coders/hrz.c coders/html.c \ - coders/icon.c coders/info.c coders/inline.c coders/ipl.c \ - coders/label.c coders/magick.c coders/map.c coders/mat.c \ - coders/matte.c coders/meta.c coders/miff.c coders/mono.c \ - coders/mpc.c coders/mpeg.c coders/mpr.c coders/msl.c \ - coders/mtv.c coders/mvg.c coders/null.c coders/otb.c \ - coders/palm.c coders/pattern.c coders/pcd.c coders/pcl.c \ - coders/pcx.c coders/pdb.c coders/pdf.c coders/pict.c \ - coders/pix.c coders/plasma.c coders/pnm.c coders/preview.c \ - coders/ps.c coders/ps2.c coders/ps3.c coders/psd.c \ - coders/pwp.c coders/raw.c coders/rgb.c coders/rla.c \ - coders/rle.c coders/scr.c coders/sct.c coders/sfw.c \ - coders/sgi.c coders/stegano.c coders/sun.c coders/svg.c \ - coders/tga.c coders/thumbnail.c coders/tile.c coders/tim.c \ - coders/ttf.c coders/txt.c coders/uil.c coders/url.c \ - coders/uyvy.c coders/vicar.c coders/vid.c coders/viff.c \ - coders/wbmp.c coders/wpg.c coders/xbm.c coders/xc.c \ - coders/xcf.c coders/xpm.c coders/xps.c coders/ycbcr.c \ - coders/yuv.c coders/dps.c coders/djvu.c coders/exr.c \ - coders/fpx.c coders/clipboard.c coders/emf.c coders/jbig.c \ - coders/jpeg.c coders/jp2.c coders/png.c coders/ept.c \ - coders/tiff.c coders/wmf.c coders/x.c coders/xwd.c \ - filters/analyze.c + magick/nt-base.c coders/art.c coders/avs.c coders/bmp.c \ + coders/braille.c coders/cals.c coders/caption.c coders/cin.c \ + coders/cip.c coders/clip.c coders/cmyk.c coders/cut.c \ + coders/dcm.c coders/dds.c coders/dib.c coders/dng.c \ + coders/dot.c coders/dpx.c coders/fax.c coders/fits.c \ + coders/gif.c coders/gradient.c coders/gray.c coders/hald.c \ + coders/histogram.c coders/hrz.c coders/html.c coders/icon.c \ + coders/info.c coders/inline.c coders/ipl.c coders/label.c \ + coders/magick.c coders/map.c coders/mat.c coders/matte.c \ + coders/meta.c coders/miff.c coders/mono.c coders/mpc.c \ + coders/mpeg.c coders/mpr.c coders/msl.c coders/mtv.c \ + coders/mvg.c coders/null.c coders/otb.c coders/palm.c \ + coders/pattern.c coders/pcd.c coders/pcl.c coders/pcx.c \ + coders/pdb.c coders/pdf.c coders/pict.c coders/pix.c \ + coders/plasma.c coders/pnm.c coders/preview.c coders/ps.c \ + coders/ps2.c coders/ps3.c coders/psd.c coders/pwp.c \ + coders/raw.c coders/rgb.c coders/rla.c coders/rle.c \ + coders/scr.c coders/sct.c coders/sfw.c coders/sgi.c \ + coders/stegano.c coders/sun.c coders/svg.c coders/tga.c \ + coders/thumbnail.c coders/tile.c coders/tim.c coders/ttf.c \ + coders/txt.c coders/uil.c coders/url.c coders/uyvy.c \ + coders/vicar.c coders/vid.c coders/viff.c coders/wbmp.c \ + coders/wpg.c coders/xbm.c coders/xc.c coders/xcf.c \ + coders/xpm.c coders/xps.c coders/ycbcr.c coders/yuv.c \ + coders/dps.c coders/djvu.c coders/exr.c coders/fpx.c \ + coders/clipboard.c coders/emf.c coders/jbig.c coders/jpeg.c \ + coders/jp2.c coders/png.c coders/ept.c coders/tiff.c \ + coders/wmf.c coders/x.c coders/xwd.c filters/analyze.c am__objects_2 = magick/magick_libMagickCore_la-animate.lo \ magick/magick_libMagickCore_la-annotate.lo \ magick/magick_libMagickCore_la-artifact.lo \ @@ -1523,7 +1514,6 @@ am__objects_2 = magick/magick_libMagickCore_la-animate.lo \ @X11_DELEGATE_TRUE@ coders/magick_libMagickCore_la-x.lo \ @X11_DELEGATE_TRUE@ coders/magick_libMagickCore_la-xwd.lo am__objects_16 = coders/magick_libMagickCore_la-art.lo \ - coders/magick_libMagickCore_la-avi.lo \ coders/magick_libMagickCore_la-avs.lo \ coders/magick_libMagickCore_la-bmp.lo \ coders/magick_libMagickCore_la-braille.lo \ @@ -1915,67 +1905,66 @@ AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(Magick___lib_libMagick___la_SOURCES) \ - $(coders_art_la_SOURCES) $(coders_avi_la_SOURCES) \ - $(coders_avs_la_SOURCES) $(coders_bmp_la_SOURCES) \ - $(coders_braille_la_SOURCES) $(coders_cals_la_SOURCES) \ - $(coders_caption_la_SOURCES) $(coders_cin_la_SOURCES) \ - $(coders_cip_la_SOURCES) $(coders_clip_la_SOURCES) \ - $(coders_clipboard_la_SOURCES) $(coders_cmyk_la_SOURCES) \ - $(coders_cut_la_SOURCES) $(coders_dcm_la_SOURCES) \ - $(coders_dds_la_SOURCES) $(coders_dib_la_SOURCES) \ - $(coders_djvu_la_SOURCES) $(coders_dng_la_SOURCES) \ - $(coders_dot_la_SOURCES) $(coders_dps_la_SOURCES) \ - $(coders_dpx_la_SOURCES) $(coders_emf_la_SOURCES) \ - $(coders_ept_la_SOURCES) $(coders_exr_la_SOURCES) \ - $(coders_fax_la_SOURCES) $(coders_fits_la_SOURCES) \ - $(coders_fpx_la_SOURCES) $(coders_gif_la_SOURCES) \ - $(coders_gradient_la_SOURCES) $(coders_gray_la_SOURCES) \ - $(coders_hald_la_SOURCES) $(coders_histogram_la_SOURCES) \ - $(coders_hrz_la_SOURCES) $(coders_html_la_SOURCES) \ - $(coders_icon_la_SOURCES) $(coders_info_la_SOURCES) \ - $(coders_inline_la_SOURCES) $(coders_ipl_la_SOURCES) \ - $(coders_jbig_la_SOURCES) $(coders_jp2_la_SOURCES) \ - $(coders_jpeg_la_SOURCES) $(coders_label_la_SOURCES) \ - $(coders_magick_la_SOURCES) $(coders_map_la_SOURCES) \ - $(coders_mat_la_SOURCES) $(coders_matte_la_SOURCES) \ - $(coders_meta_la_SOURCES) $(coders_miff_la_SOURCES) \ - $(coders_mono_la_SOURCES) $(coders_mpc_la_SOURCES) \ - $(coders_mpeg_la_SOURCES) $(coders_mpr_la_SOURCES) \ - $(coders_msl_la_SOURCES) $(coders_mtv_la_SOURCES) \ - $(coders_mvg_la_SOURCES) $(coders_null_la_SOURCES) \ - $(coders_otb_la_SOURCES) $(coders_palm_la_SOURCES) \ - $(coders_pattern_la_SOURCES) $(coders_pcd_la_SOURCES) \ - $(coders_pcl_la_SOURCES) $(coders_pcx_la_SOURCES) \ - $(coders_pdb_la_SOURCES) $(coders_pdf_la_SOURCES) \ - $(coders_pict_la_SOURCES) $(coders_pix_la_SOURCES) \ - $(coders_plasma_la_SOURCES) $(coders_png_la_SOURCES) \ - $(coders_pnm_la_SOURCES) $(coders_preview_la_SOURCES) \ - $(coders_ps_la_SOURCES) $(coders_ps2_la_SOURCES) \ - $(coders_ps3_la_SOURCES) $(coders_psd_la_SOURCES) \ - $(coders_pwp_la_SOURCES) $(coders_raw_la_SOURCES) \ - $(coders_rgb_la_SOURCES) $(coders_rla_la_SOURCES) \ - $(coders_rle_la_SOURCES) $(coders_scr_la_SOURCES) \ - $(coders_sct_la_SOURCES) $(coders_sfw_la_SOURCES) \ - $(coders_sgi_la_SOURCES) $(coders_stegano_la_SOURCES) \ - $(coders_sun_la_SOURCES) $(coders_svg_la_SOURCES) \ - $(coders_tga_la_SOURCES) $(coders_thumbnail_la_SOURCES) \ - $(coders_tiff_la_SOURCES) $(coders_tile_la_SOURCES) \ - $(coders_tim_la_SOURCES) $(coders_ttf_la_SOURCES) \ - $(coders_txt_la_SOURCES) $(coders_uil_la_SOURCES) \ - $(coders_url_la_SOURCES) $(coders_uyvy_la_SOURCES) \ - $(coders_vicar_la_SOURCES) $(coders_vid_la_SOURCES) \ - $(coders_viff_la_SOURCES) $(coders_wbmp_la_SOURCES) \ - $(coders_wmf_la_SOURCES) $(coders_wpg_la_SOURCES) \ - $(coders_x_la_SOURCES) $(coders_xbm_la_SOURCES) \ - $(coders_xc_la_SOURCES) $(coders_xcf_la_SOURCES) \ - $(coders_xpm_la_SOURCES) $(coders_xps_la_SOURCES) \ - $(coders_xwd_la_SOURCES) $(coders_ycbcr_la_SOURCES) \ - $(coders_yuv_la_SOURCES) $(filters_analyze_la_SOURCES) \ - $(ltdl_dld_link_la_SOURCES) $(ltdl_dlopen_la_SOURCES) \ - $(ltdl_dyld_la_SOURCES) $(ltdl_libltdl_la_SOURCES) \ - $(ltdl_libltdlc_la_SOURCES) $(ltdl_load_add_on_la_SOURCES) \ - $(ltdl_loadlibrary_la_SOURCES) $(ltdl_shl_load_la_SOURCES) \ - $(magick_libMagickCore_la_SOURCES) \ + $(coders_art_la_SOURCES) $(coders_avs_la_SOURCES) \ + $(coders_bmp_la_SOURCES) $(coders_braille_la_SOURCES) \ + $(coders_cals_la_SOURCES) $(coders_caption_la_SOURCES) \ + $(coders_cin_la_SOURCES) $(coders_cip_la_SOURCES) \ + $(coders_clip_la_SOURCES) $(coders_clipboard_la_SOURCES) \ + $(coders_cmyk_la_SOURCES) $(coders_cut_la_SOURCES) \ + $(coders_dcm_la_SOURCES) $(coders_dds_la_SOURCES) \ + $(coders_dib_la_SOURCES) $(coders_djvu_la_SOURCES) \ + $(coders_dng_la_SOURCES) $(coders_dot_la_SOURCES) \ + $(coders_dps_la_SOURCES) $(coders_dpx_la_SOURCES) \ + $(coders_emf_la_SOURCES) $(coders_ept_la_SOURCES) \ + $(coders_exr_la_SOURCES) $(coders_fax_la_SOURCES) \ + $(coders_fits_la_SOURCES) $(coders_fpx_la_SOURCES) \ + $(coders_gif_la_SOURCES) $(coders_gradient_la_SOURCES) \ + $(coders_gray_la_SOURCES) $(coders_hald_la_SOURCES) \ + $(coders_histogram_la_SOURCES) $(coders_hrz_la_SOURCES) \ + $(coders_html_la_SOURCES) $(coders_icon_la_SOURCES) \ + $(coders_info_la_SOURCES) $(coders_inline_la_SOURCES) \ + $(coders_ipl_la_SOURCES) $(coders_jbig_la_SOURCES) \ + $(coders_jp2_la_SOURCES) $(coders_jpeg_la_SOURCES) \ + $(coders_label_la_SOURCES) $(coders_magick_la_SOURCES) \ + $(coders_map_la_SOURCES) $(coders_mat_la_SOURCES) \ + $(coders_matte_la_SOURCES) $(coders_meta_la_SOURCES) \ + $(coders_miff_la_SOURCES) $(coders_mono_la_SOURCES) \ + $(coders_mpc_la_SOURCES) $(coders_mpeg_la_SOURCES) \ + $(coders_mpr_la_SOURCES) $(coders_msl_la_SOURCES) \ + $(coders_mtv_la_SOURCES) $(coders_mvg_la_SOURCES) \ + $(coders_null_la_SOURCES) $(coders_otb_la_SOURCES) \ + $(coders_palm_la_SOURCES) $(coders_pattern_la_SOURCES) \ + $(coders_pcd_la_SOURCES) $(coders_pcl_la_SOURCES) \ + $(coders_pcx_la_SOURCES) $(coders_pdb_la_SOURCES) \ + $(coders_pdf_la_SOURCES) $(coders_pict_la_SOURCES) \ + $(coders_pix_la_SOURCES) $(coders_plasma_la_SOURCES) \ + $(coders_png_la_SOURCES) $(coders_pnm_la_SOURCES) \ + $(coders_preview_la_SOURCES) $(coders_ps_la_SOURCES) \ + $(coders_ps2_la_SOURCES) $(coders_ps3_la_SOURCES) \ + $(coders_psd_la_SOURCES) $(coders_pwp_la_SOURCES) \ + $(coders_raw_la_SOURCES) $(coders_rgb_la_SOURCES) \ + $(coders_rla_la_SOURCES) $(coders_rle_la_SOURCES) \ + $(coders_scr_la_SOURCES) $(coders_sct_la_SOURCES) \ + $(coders_sfw_la_SOURCES) $(coders_sgi_la_SOURCES) \ + $(coders_stegano_la_SOURCES) $(coders_sun_la_SOURCES) \ + $(coders_svg_la_SOURCES) $(coders_tga_la_SOURCES) \ + $(coders_thumbnail_la_SOURCES) $(coders_tiff_la_SOURCES) \ + $(coders_tile_la_SOURCES) $(coders_tim_la_SOURCES) \ + $(coders_ttf_la_SOURCES) $(coders_txt_la_SOURCES) \ + $(coders_uil_la_SOURCES) $(coders_url_la_SOURCES) \ + $(coders_uyvy_la_SOURCES) $(coders_vicar_la_SOURCES) \ + $(coders_vid_la_SOURCES) $(coders_viff_la_SOURCES) \ + $(coders_wbmp_la_SOURCES) $(coders_wmf_la_SOURCES) \ + $(coders_wpg_la_SOURCES) $(coders_x_la_SOURCES) \ + $(coders_xbm_la_SOURCES) $(coders_xc_la_SOURCES) \ + $(coders_xcf_la_SOURCES) $(coders_xpm_la_SOURCES) \ + $(coders_xps_la_SOURCES) $(coders_xwd_la_SOURCES) \ + $(coders_ycbcr_la_SOURCES) $(coders_yuv_la_SOURCES) \ + $(filters_analyze_la_SOURCES) $(ltdl_dld_link_la_SOURCES) \ + $(ltdl_dlopen_la_SOURCES) $(ltdl_dyld_la_SOURCES) \ + $(ltdl_libltdl_la_SOURCES) $(ltdl_libltdlc_la_SOURCES) \ + $(ltdl_load_add_on_la_SOURCES) $(ltdl_loadlibrary_la_SOURCES) \ + $(ltdl_shl_load_la_SOURCES) $(magick_libMagickCore_la_SOURCES) \ $(wand_libMagickWand_la_SOURCES) \ $(Magick___demo_analyze_SOURCES) \ $(Magick___demo_button_SOURCES) $(Magick___demo_demo_SOURCES) \ @@ -2003,66 +1992,66 @@ SOURCES = $(Magick___lib_libMagick___la_SOURCES) \ $(utilities_montage_SOURCES) $(utilities_stream_SOURCES) \ $(wand_drawtest_SOURCES) $(wand_wandtest_SOURCES) DIST_SOURCES = $(Magick___lib_libMagick___la_SOURCES) \ - $(coders_art_la_SOURCES) $(coders_avi_la_SOURCES) \ - $(coders_avs_la_SOURCES) $(coders_bmp_la_SOURCES) \ - $(coders_braille_la_SOURCES) $(coders_cals_la_SOURCES) \ - $(coders_caption_la_SOURCES) $(coders_cin_la_SOURCES) \ - $(coders_cip_la_SOURCES) $(coders_clip_la_SOURCES) \ - $(coders_clipboard_la_SOURCES) $(coders_cmyk_la_SOURCES) \ - $(coders_cut_la_SOURCES) $(coders_dcm_la_SOURCES) \ - $(coders_dds_la_SOURCES) $(coders_dib_la_SOURCES) \ - $(coders_djvu_la_SOURCES) $(coders_dng_la_SOURCES) \ - $(coders_dot_la_SOURCES) $(coders_dps_la_SOURCES) \ - $(coders_dpx_la_SOURCES) $(coders_emf_la_SOURCES) \ - $(coders_ept_la_SOURCES) $(coders_exr_la_SOURCES) \ - $(coders_fax_la_SOURCES) $(coders_fits_la_SOURCES) \ - $(coders_fpx_la_SOURCES) $(coders_gif_la_SOURCES) \ - $(coders_gradient_la_SOURCES) $(coders_gray_la_SOURCES) \ - $(coders_hald_la_SOURCES) $(coders_histogram_la_SOURCES) \ - $(coders_hrz_la_SOURCES) $(coders_html_la_SOURCES) \ - $(coders_icon_la_SOURCES) $(coders_info_la_SOURCES) \ - $(coders_inline_la_SOURCES) $(coders_ipl_la_SOURCES) \ - $(coders_jbig_la_SOURCES) $(coders_jp2_la_SOURCES) \ - $(coders_jpeg_la_SOURCES) $(coders_label_la_SOURCES) \ - $(coders_magick_la_SOURCES) $(coders_map_la_SOURCES) \ - $(coders_mat_la_SOURCES) $(coders_matte_la_SOURCES) \ - $(coders_meta_la_SOURCES) $(coders_miff_la_SOURCES) \ - $(coders_mono_la_SOURCES) $(coders_mpc_la_SOURCES) \ - $(coders_mpeg_la_SOURCES) $(coders_mpr_la_SOURCES) \ - $(coders_msl_la_SOURCES) $(coders_mtv_la_SOURCES) \ - $(coders_mvg_la_SOURCES) $(coders_null_la_SOURCES) \ - $(coders_otb_la_SOURCES) $(coders_palm_la_SOURCES) \ - $(coders_pattern_la_SOURCES) $(coders_pcd_la_SOURCES) \ - $(coders_pcl_la_SOURCES) $(coders_pcx_la_SOURCES) \ - $(coders_pdb_la_SOURCES) $(coders_pdf_la_SOURCES) \ - $(coders_pict_la_SOURCES) $(coders_pix_la_SOURCES) \ - $(coders_plasma_la_SOURCES) $(coders_png_la_SOURCES) \ - $(coders_pnm_la_SOURCES) $(coders_preview_la_SOURCES) \ - $(coders_ps_la_SOURCES) $(coders_ps2_la_SOURCES) \ - $(coders_ps3_la_SOURCES) $(coders_psd_la_SOURCES) \ - $(coders_pwp_la_SOURCES) $(coders_raw_la_SOURCES) \ - $(coders_rgb_la_SOURCES) $(coders_rla_la_SOURCES) \ - $(coders_rle_la_SOURCES) $(coders_scr_la_SOURCES) \ - $(coders_sct_la_SOURCES) $(coders_sfw_la_SOURCES) \ - $(coders_sgi_la_SOURCES) $(coders_stegano_la_SOURCES) \ - $(coders_sun_la_SOURCES) $(coders_svg_la_SOURCES) \ - $(coders_tga_la_SOURCES) $(coders_thumbnail_la_SOURCES) \ - $(coders_tiff_la_SOURCES) $(coders_tile_la_SOURCES) \ - $(coders_tim_la_SOURCES) $(coders_ttf_la_SOURCES) \ - $(coders_txt_la_SOURCES) $(coders_uil_la_SOURCES) \ - $(coders_url_la_SOURCES) $(coders_uyvy_la_SOURCES) \ - $(coders_vicar_la_SOURCES) $(coders_vid_la_SOURCES) \ - $(coders_viff_la_SOURCES) $(coders_wbmp_la_SOURCES) \ - $(coders_wmf_la_SOURCES) $(coders_wpg_la_SOURCES) \ - $(coders_x_la_SOURCES) $(coders_xbm_la_SOURCES) \ - $(coders_xc_la_SOURCES) $(coders_xcf_la_SOURCES) \ - $(coders_xpm_la_SOURCES) $(coders_xps_la_SOURCES) \ - $(coders_xwd_la_SOURCES) $(coders_ycbcr_la_SOURCES) \ - $(coders_yuv_la_SOURCES) $(filters_analyze_la_SOURCES) \ - $(ltdl_dld_link_la_SOURCES) $(ltdl_dlopen_la_SOURCES) \ - $(ltdl_dyld_la_SOURCES) $(ltdl_libltdl_la_SOURCES) \ - $(ltdl_libltdlc_la_SOURCES) $(ltdl_load_add_on_la_SOURCES) \ - $(ltdl_loadlibrary_la_SOURCES) $(ltdl_shl_load_la_SOURCES) \ + $(coders_art_la_SOURCES) $(coders_avs_la_SOURCES) \ + $(coders_bmp_la_SOURCES) $(coders_braille_la_SOURCES) \ + $(coders_cals_la_SOURCES) $(coders_caption_la_SOURCES) \ + $(coders_cin_la_SOURCES) $(coders_cip_la_SOURCES) \ + $(coders_clip_la_SOURCES) $(coders_clipboard_la_SOURCES) \ + $(coders_cmyk_la_SOURCES) $(coders_cut_la_SOURCES) \ + $(coders_dcm_la_SOURCES) $(coders_dds_la_SOURCES) \ + $(coders_dib_la_SOURCES) $(coders_djvu_la_SOURCES) \ + $(coders_dng_la_SOURCES) $(coders_dot_la_SOURCES) \ + $(coders_dps_la_SOURCES) $(coders_dpx_la_SOURCES) \ + $(coders_emf_la_SOURCES) $(coders_ept_la_SOURCES) \ + $(coders_exr_la_SOURCES) $(coders_fax_la_SOURCES) \ + $(coders_fits_la_SOURCES) $(coders_fpx_la_SOURCES) \ + $(coders_gif_la_SOURCES) $(coders_gradient_la_SOURCES) \ + $(coders_gray_la_SOURCES) $(coders_hald_la_SOURCES) \ + $(coders_histogram_la_SOURCES) $(coders_hrz_la_SOURCES) \ + $(coders_html_la_SOURCES) $(coders_icon_la_SOURCES) \ + $(coders_info_la_SOURCES) $(coders_inline_la_SOURCES) \ + $(coders_ipl_la_SOURCES) $(coders_jbig_la_SOURCES) \ + $(coders_jp2_la_SOURCES) $(coders_jpeg_la_SOURCES) \ + $(coders_label_la_SOURCES) $(coders_magick_la_SOURCES) \ + $(coders_map_la_SOURCES) $(coders_mat_la_SOURCES) \ + $(coders_matte_la_SOURCES) $(coders_meta_la_SOURCES) \ + $(coders_miff_la_SOURCES) $(coders_mono_la_SOURCES) \ + $(coders_mpc_la_SOURCES) $(coders_mpeg_la_SOURCES) \ + $(coders_mpr_la_SOURCES) $(coders_msl_la_SOURCES) \ + $(coders_mtv_la_SOURCES) $(coders_mvg_la_SOURCES) \ + $(coders_null_la_SOURCES) $(coders_otb_la_SOURCES) \ + $(coders_palm_la_SOURCES) $(coders_pattern_la_SOURCES) \ + $(coders_pcd_la_SOURCES) $(coders_pcl_la_SOURCES) \ + $(coders_pcx_la_SOURCES) $(coders_pdb_la_SOURCES) \ + $(coders_pdf_la_SOURCES) $(coders_pict_la_SOURCES) \ + $(coders_pix_la_SOURCES) $(coders_plasma_la_SOURCES) \ + $(coders_png_la_SOURCES) $(coders_pnm_la_SOURCES) \ + $(coders_preview_la_SOURCES) $(coders_ps_la_SOURCES) \ + $(coders_ps2_la_SOURCES) $(coders_ps3_la_SOURCES) \ + $(coders_psd_la_SOURCES) $(coders_pwp_la_SOURCES) \ + $(coders_raw_la_SOURCES) $(coders_rgb_la_SOURCES) \ + $(coders_rla_la_SOURCES) $(coders_rle_la_SOURCES) \ + $(coders_scr_la_SOURCES) $(coders_sct_la_SOURCES) \ + $(coders_sfw_la_SOURCES) $(coders_sgi_la_SOURCES) \ + $(coders_stegano_la_SOURCES) $(coders_sun_la_SOURCES) \ + $(coders_svg_la_SOURCES) $(coders_tga_la_SOURCES) \ + $(coders_thumbnail_la_SOURCES) $(coders_tiff_la_SOURCES) \ + $(coders_tile_la_SOURCES) $(coders_tim_la_SOURCES) \ + $(coders_ttf_la_SOURCES) $(coders_txt_la_SOURCES) \ + $(coders_uil_la_SOURCES) $(coders_url_la_SOURCES) \ + $(coders_uyvy_la_SOURCES) $(coders_vicar_la_SOURCES) \ + $(coders_vid_la_SOURCES) $(coders_viff_la_SOURCES) \ + $(coders_wbmp_la_SOURCES) $(coders_wmf_la_SOURCES) \ + $(coders_wpg_la_SOURCES) $(coders_x_la_SOURCES) \ + $(coders_xbm_la_SOURCES) $(coders_xc_la_SOURCES) \ + $(coders_xcf_la_SOURCES) $(coders_xpm_la_SOURCES) \ + $(coders_xps_la_SOURCES) $(coders_xwd_la_SOURCES) \ + $(coders_ycbcr_la_SOURCES) $(coders_yuv_la_SOURCES) \ + $(filters_analyze_la_SOURCES) $(ltdl_dld_link_la_SOURCES) \ + $(ltdl_dlopen_la_SOURCES) $(ltdl_dyld_la_SOURCES) \ + $(ltdl_libltdl_la_SOURCES) $(ltdl_libltdlc_la_SOURCES) \ + $(ltdl_load_add_on_la_SOURCES) $(ltdl_loadlibrary_la_SOURCES) \ + $(ltdl_shl_load_la_SOURCES) \ $(am__magick_libMagickCore_la_SOURCES_DIST) \ $(wand_libMagickWand_la_SOURCES) \ $(Magick___demo_analyze_SOURCES) \ @@ -2778,7 +2767,6 @@ codersdir = $(CODER_PATH) @X11_DELEGATE_TRUE@MAGICK_X11_SRCS = coders/x.c coders/xwd.c MAGICK_CODER_SRCS = \ coders/art.c \ - coders/avi.c \ coders/avs.c \ coders/bmp.c \ coders/braille.c \ @@ -2889,7 +2877,6 @@ MAGICK_CODER_SRCS = \ @WITH_MODULES_FALSE@coders_LTLIBRARIES = @WITH_MODULES_TRUE@coders_LTLIBRARIES = \ @WITH_MODULES_TRUE@ coders/art.la \ -@WITH_MODULES_TRUE@ coders/avi.la \ @WITH_MODULES_TRUE@ coders/avs.la \ @WITH_MODULES_TRUE@ coders/bmp.la \ @WITH_MODULES_TRUE@ coders/braille.la \ @@ -3004,12 +2991,6 @@ coders_art_la_CPPFLAGS = $(MODULE_EXTRA_CPPFLAGS) coders_art_la_LDFLAGS = $(MODULECOMMONFLAGS) coders_art_la_LIBADD = $(MAGICKCORE_LIBS) -# AVI coder module -coders_avi_la_SOURCES = coders/avi.c -coders_avi_la_CPPFLAGS = $(MODULE_EXTRA_CPPFLAGS) -coders_avi_la_LDFLAGS = $(MODULECOMMONFLAGS) -coders_avi_la_LIBADD = $(MAGICKCORE_LIBS) $(JPEG_LIBS) $(MATH_LIBS) - # AVS coder module coders_avs_la_SOURCES = coders/avs.c coders_avs_la_CPPFLAGS = $(MODULE_EXTRA_CPPFLAGS) @@ -4879,10 +4860,6 @@ coders/coders_art_la-art.lo: coders/$(am__dirstamp) \ coders/$(DEPDIR)/$(am__dirstamp) coders/art.la: $(coders_art_la_OBJECTS) $(coders_art_la_DEPENDENCIES) coders/$(am__dirstamp) $(AM_V_CCLD)$(coders_art_la_LINK) $(am_coders_art_la_rpath) $(coders_art_la_OBJECTS) $(coders_art_la_LIBADD) $(LIBS) -coders/coders_avi_la-avi.lo: coders/$(am__dirstamp) \ - coders/$(DEPDIR)/$(am__dirstamp) -coders/avi.la: $(coders_avi_la_OBJECTS) $(coders_avi_la_DEPENDENCIES) coders/$(am__dirstamp) - $(AM_V_CCLD)$(coders_avi_la_LINK) $(am_coders_avi_la_rpath) $(coders_avi_la_OBJECTS) $(coders_avi_la_LIBADD) $(LIBS) coders/coders_avs_la-avs.lo: coders/$(am__dirstamp) \ coders/$(DEPDIR)/$(am__dirstamp) coders/avs.la: $(coders_avs_la_OBJECTS) $(coders_avs_la_DEPENDENCIES) coders/$(am__dirstamp) @@ -5574,8 +5551,6 @@ magick/magick_libMagickCore_la-nt-base.lo: magick/$(am__dirstamp) \ magick/$(DEPDIR)/$(am__dirstamp) coders/magick_libMagickCore_la-art.lo: coders/$(am__dirstamp) \ coders/$(DEPDIR)/$(am__dirstamp) -coders/magick_libMagickCore_la-avi.lo: coders/$(am__dirstamp) \ - coders/$(DEPDIR)/$(am__dirstamp) coders/magick_libMagickCore_la-avs.lo: coders/$(am__dirstamp) \ coders/$(DEPDIR)/$(am__dirstamp) coders/magick_libMagickCore_la-bmp.lo: coders/$(am__dirstamp) \ @@ -6195,8 +6170,6 @@ mostlyclean-compile: -rm -f Magick++/tests/readWriteImages.$(OBJEXT) -rm -f coders/coders_art_la-art.$(OBJEXT) -rm -f coders/coders_art_la-art.lo - -rm -f coders/coders_avi_la-avi.$(OBJEXT) - -rm -f coders/coders_avi_la-avi.lo -rm -f coders/coders_avs_la-avs.$(OBJEXT) -rm -f coders/coders_avs_la-avs.lo -rm -f coders/coders_bmp_la-bmp.$(OBJEXT) @@ -6417,8 +6390,6 @@ mostlyclean-compile: -rm -f coders/coders_yuv_la-yuv.lo -rm -f coders/magick_libMagickCore_la-art.$(OBJEXT) -rm -f coders/magick_libMagickCore_la-art.lo - -rm -f coders/magick_libMagickCore_la-avi.$(OBJEXT) - -rm -f coders/magick_libMagickCore_la-avi.lo -rm -f coders/magick_libMagickCore_la-avs.$(OBJEXT) -rm -f coders/magick_libMagickCore_la-avs.lo -rm -f coders/magick_libMagickCore_la-bmp.$(OBJEXT) @@ -6945,7 +6916,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@Magick++/tests/$(DEPDIR)/readWriteBlob.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@Magick++/tests/$(DEPDIR)/readWriteImages.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/coders_art_la-art.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/coders_avi_la-avi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/coders_avs_la-avs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/coders_bmp_la-bmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/coders_braille_la-braille.Plo@am__quote@ @@ -7056,7 +7026,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/coders_ycbcr_la-ycbcr.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/coders_yuv_la-yuv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libMagickCore_la-art.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libMagickCore_la-avi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libMagickCore_la-avs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libMagickCore_la-bmp.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@coders/$(DEPDIR)/magick_libMagickCore_la-braille.Plo@am__quote@ @@ -7342,14 +7311,6 @@ coders/coders_art_la-art.lo: coders/art.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_art_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/coders_art_la-art.lo `test -f 'coders/art.c' || echo '$(srcdir)/'`coders/art.c -coders/coders_avi_la-avi.lo: coders/avi.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_avi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT coders/coders_avi_la-avi.lo -MD -MP -MF coders/$(DEPDIR)/coders_avi_la-avi.Tpo -c -o coders/coders_avi_la-avi.lo `test -f 'coders/avi.c' || echo '$(srcdir)/'`coders/avi.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/coders_avi_la-avi.Tpo coders/$(DEPDIR)/coders_avi_la-avi.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coders/avi.c' object='coders/coders_avi_la-avi.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_avi_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/coders_avi_la-avi.lo `test -f 'coders/avi.c' || echo '$(srcdir)/'`coders/avi.c - coders/coders_avs_la-avs.lo: coders/avs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(coders_avs_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT coders/coders_avs_la-avs.lo -MD -MP -MF coders/$(DEPDIR)/coders_avs_la-avs.Tpo -c -o coders/coders_avs_la-avs.lo `test -f 'coders/avs.c' || echo '$(srcdir)/'`coders/avs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/coders_avs_la-avs.Tpo coders/$(DEPDIR)/coders_avs_la-avs.Plo @@ -9022,14 +8983,6 @@ coders/magick_libMagickCore_la-art.lo: coders/art.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(magick_libMagickCore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/magick_libMagickCore_la-art.lo `test -f 'coders/art.c' || echo '$(srcdir)/'`coders/art.c -coders/magick_libMagickCore_la-avi.lo: coders/avi.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(magick_libMagickCore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT coders/magick_libMagickCore_la-avi.lo -MD -MP -MF coders/$(DEPDIR)/magick_libMagickCore_la-avi.Tpo -c -o coders/magick_libMagickCore_la-avi.lo `test -f 'coders/avi.c' || echo '$(srcdir)/'`coders/avi.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/magick_libMagickCore_la-avi.Tpo coders/$(DEPDIR)/magick_libMagickCore_la-avi.Plo -@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='coders/avi.c' object='coders/magick_libMagickCore_la-avi.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(magick_libMagickCore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o coders/magick_libMagickCore_la-avi.lo `test -f 'coders/avi.c' || echo '$(srcdir)/'`coders/avi.c - coders/magick_libMagickCore_la-avs.lo: coders/avs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(magick_libMagickCore_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT coders/magick_libMagickCore_la-avs.lo -MD -MP -MF coders/$(DEPDIR)/magick_libMagickCore_la-avs.Tpo -c -o coders/magick_libMagickCore_la-avs.lo `test -f 'coders/avs.c' || echo '$(srcdir)/'`coders/avs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) coders/$(DEPDIR)/magick_libMagickCore_la-avs.Tpo coders/$(DEPDIR)/magick_libMagickCore_la-avs.Plo diff --git a/coders/Make.com b/coders/Make.com index 2d8964710..cc47c24fd 100644 --- a/coders/Make.com +++ b/coders/Make.com @@ -22,7 +22,6 @@ $ $ $write sys$output "Making Coders..." $call Make art.c -$call Make avi.c $call Make avs.c $call Make bmp.c $call Make braille.c @@ -132,7 +131,7 @@ $call Make magick.c $call Make scr.c $deass magick $deass wand -$library/create libCoders.olb art,avi,avs,bmp,braille,clip,clipboard,cip,cmyk, - +$library/create libCoders.olb art,avs,bmp,braille,clip,clipboard,cip,cmyk, - cut,dcm,dds,dib,dng,dps,dpx,emf,ept,exr,fax,fits,fpx,gif,gradient,gray, - hald,histogram,hrz,html,icon,info,inline,ipl,jbig,jpeg,jp2,label,cals, - caption,palm,map,mat,matte, - diff --git a/coders/Makefile.am b/coders/Makefile.am index 9dbbb81d1..d7e81ac9a 100644 --- a/coders/Makefile.am +++ b/coders/Makefile.am @@ -79,7 +79,6 @@ endif MAGICK_CODER_SRCS = \ coders/art.c \ - coders/avi.c \ coders/avs.c \ coders/bmp.c \ coders/braille.c \ @@ -190,7 +189,6 @@ MAGICK_CODER_SRCS = \ if WITH_MODULES coders_LTLIBRARIES = \ coders/art.la \ - coders/avi.la \ coders/avs.la \ coders/bmp.la \ coders/braille.la \ @@ -307,12 +305,6 @@ coders_art_la_CPPFLAGS = $(MODULE_EXTRA_CPPFLAGS) coders_art_la_LDFLAGS = $(MODULECOMMONFLAGS) coders_art_la_LIBADD = $(MAGICKCORE_LIBS) -# AVI coder module -coders_avi_la_SOURCES = coders/avi.c -coders_avi_la_CPPFLAGS = $(MODULE_EXTRA_CPPFLAGS) -coders_avi_la_LDFLAGS = $(MODULECOMMONFLAGS) -coders_avi_la_LIBADD = $(MAGICKCORE_LIBS) $(JPEG_LIBS) $(MATH_LIBS) - # AVS coder module coders_avs_la_SOURCES = coders/avs.c coders_avs_la_CPPFLAGS = $(MODULE_EXTRA_CPPFLAGS) diff --git a/coders/avi.c b/coders/avi.c deleted file mode 100644 index d913be696..000000000 --- a/coders/avi.c +++ /dev/null @@ -1,2231 +0,0 @@ -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% AAA V V IIIII % -% A A V V I % -% AAAAA V V I % -% A A V V I % -% A A V IIIII % -% % -% % -% Read Microsoft Audio/Visual Interleaved Image Format % -% % -% Software Design % -% John Cristy % -% Nathan Brown % -% March 2004 % -% % -% % -% Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization % -% dedicated to making software imaging solutions freely available. % -% % -% You may not use this file except in compliance with the License. You may % -% obtain a copy of the License at % -% % -% http://www.imagemagick.org/script/license.php % -% % -% Unless required by applicable law or agreed to in writing, software % -% distributed under the License is distributed on an "AS IS" BASIS, % -% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. % -% See the License for the specific language governing permissions and % -% limitations under the License. % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% -*/ - -/* - Include declarations. -*/ -#include -#include "magick/studio.h" -#include "magick/blob.h" -#include "magick/blob-private.h" -#include "magick/cache.h" -#include "magick/color-private.h" -#include "magick/colormap-private.h" -#include "magick/colorspace.h" -#include "magick/constitute.h" -#include "magick/delegate.h" -#include "magick/exception.h" -#include "magick/exception-private.h" -#include "magick/geometry.h" -#include "magick/image.h" -#include "magick/image-private.h" -#include "magick/list.h" -#include "magick/log.h" -#include "magick/magick.h" -#include "magick/memory_.h" -#include "magick/monitor.h" -#include "magick/monitor-private.h" -#include "magick/profile.h" -#include "magick/property.h" -#include "magick/quantum-private.h" -#include "magick/resource_.h" -#include "magick/static.h" -#include "magick/string_.h" -#include "magick/module.h" -#include "magick/utility.h" - -#if defined(MAGICKCORE_JPEG_DELEGATE) -#define JPEG_INTERNAL_OPTIONS -#if defined(__MINGW32__) -# define XMD_H 1 /* Avoid conflicting typedef for INT32 */ -#endif -#undef HAVE_STDLIB_H -#include "jpeglib.h" -#include "jerror.h" -#endif - -/* - Define declarations. -*/ -#define ICC_MARKER (JPEG_APP0+2) -#define ICC_PROFILE "ICC_PROFILE" -#define IPTC_MARKER (JPEG_APP0+13) -#define XML_MARKER (JPEG_APP0+1) -#define MaxBufferExtent 8192 - -/* - Typedef declarations. -*/ -#if defined(MAGICKCORE_JPEG_DELEGATE) - -typedef struct _ErrorManager -{ - Image - *image; - - jmp_buf - error_recovery; - - boolean - verbose; -} ErrorManager; - -typedef struct _SourceManager -{ - struct jpeg_source_mgr - manager; - - Image - *image; - - unsigned char - *source_data; - - size_t - source_length; - - JOCTET - *buffer; - - boolean - start_of_blob; -} SourceManager; -#endif - - -/* - Typedef declaractions. -*/ -typedef struct _AVIInfo -{ - unsigned long - delay, - max_data_rate, - pad_granularity, - flags, - total_frames, - initial_frames, - number_streams, - buffer_size, - width, - height, - time_scale, - data_rate, - start_time, - data_length; -} AVIInfo; - -typedef struct _BMPInfo -{ - unsigned long - size, - width, - height, - planes, - bits_per_pixel; - - char - compression[5]; - - unsigned long - image_size, - x_pixels, - y_pixels, - number_colors, - important_colors; -} BMPInfo; - -typedef struct _AVIStreamInfo -{ - char - data_type[5], - data_handler[5]; - - unsigned long - flags, - priority, - initial_frames, - time_scale, - data_rate, - start_time, - data_length, - buffer_size, - quality, - sample_size; -} AVIStreamInfo; - -/* - MJPEG Information from Microsoft SDK -*/ -#if defined(MAGICKCORE_JPEG_DELEGATE) -#ifndef NOJPEGDIB - -/* New DIB Compression Defines */ -#define JPEG_DIB mmioFOURCC('J','P','E','G') /* Still image JPEG DIB biCompression */ -#define MJPG_DIB mmioFOURCC('M','J','P','G') /* Motion JPEG DIB biCompression */ - -/* JPEGColorSpaceID Definitions */ -#define JPEG_Y 1 /* Y only component of YCbCr */ -#define JPEG_YCbCr 2 /* YCbCr as define by CCIR 601 */ -#define JPEG_RGB 3 /* 3 component RGB */ - -/* Structure definitions */ - -#if defined(MAGICK_FUTURE) -typedef struct tagJPEGINFOHEADER { - /* compression-specific fields */ - /* these fields are defined for 'JPEG' and 'MJPG' */ - DWORD JPEGSize; - DWORD JPEGProcess; - - /* Process specific fields */ - DWORD JPEGColorSpaceID; - DWORD JPEGBitsPerSample; - DWORD JPEGHSubSampling; - DWORD JPEGVSubSampling; -} JPEGINFOHEADER; -#endif - -/* Default DHT Segment */ - -static const unsigned char MJPGDHTSeg[0x1A8] = { - /* JPEG DHT Segment for YCrCb omitted from MJPG data */ -0xFF,0xD8,0xFF,0xC4,0x01,0xA2, -0x00,0x00,0x01,0x05,0x01,0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x01,0x00,0x03,0x01,0x01,0x01,0x01, -0x01,0x01,0x01,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07, -0x08,0x09,0x0A,0x0B,0x10,0x00,0x02,0x01,0x03,0x03,0x02,0x04,0x03,0x05,0x05,0x04,0x04,0x00, -0x00,0x01,0x7D,0x01,0x02,0x03,0x00,0x04,0x11,0x05,0x12,0x21,0x31,0x41,0x06,0x13,0x51,0x61, -0x07,0x22,0x71,0x14,0x32,0x81,0x91,0xA1,0x08,0x23,0x42,0xB1,0xC1,0x15,0x52,0xD1,0xF0,0x24, -0x33,0x62,0x72,0x82,0x09,0x0A,0x16,0x17,0x18,0x19,0x1A,0x25,0x26,0x27,0x28,0x29,0x2A,0x34, -0x35,0x36,0x37,0x38,0x39,0x3A,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x53,0x54,0x55,0x56, -0x57,0x58,0x59,0x5A,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x73,0x74,0x75,0x76,0x77,0x78, -0x79,0x7A,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x92,0x93,0x94,0x95,0x96,0x97,0x98,0x99, -0x9A,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8,0xB9, -0xBA,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8,0xD9, -0xDA,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7, -0xF8,0xF9,0xFA,0x11,0x00,0x02,0x01,0x02,0x04,0x04,0x03,0x04,0x07,0x05,0x04,0x04,0x00,0x01, -0x02,0x77,0x00,0x01,0x02,0x03,0x11,0x04,0x05,0x21,0x31,0x06,0x12,0x41,0x51,0x07,0x61,0x71, -0x13,0x22,0x32,0x81,0x08,0x14,0x42,0x91,0xA1,0xB1,0xC1,0x09,0x23,0x33,0x52,0xF0,0x15,0x62, -0x72,0xD1,0x0A,0x16,0x24,0x34,0xE1,0x25,0xF1,0x17,0x18,0x19,0x1A,0x26,0x27,0x28,0x29,0x2A, -0x35,0x36,0x37,0x38,0x39,0x3A,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x53,0x54,0x55,0x56, -0x57,0x58,0x59,0x5A,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6A,0x73,0x74,0x75,0x76,0x77,0x78, -0x79,0x7A,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8A,0x92,0x93,0x94,0x95,0x96,0x97,0x98, -0x99,0x9A,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,0xA8,0xA9,0xAA,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,0xB8, -0xB9,0xBA,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,0xC8,0xC9,0xCA,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,0xD8, -0xD9,0xDA,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,0xE8,0xE9,0xEA,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,0xF8, -0xF9,0xFA,0xFF,0xD9 -}; - -/* End DHT default */ - -/* End JPEG */ -#endif -#endif - -static inline size_t MagickMax(const size_t x,const size_t y) -{ - if (x > y) - return(x); - return(y); -} - -static inline size_t MagickMin(const size_t x,const size_t y) -{ - if (x < y) - return(x); - return(y); -} - -#if defined(MAGICKCORE_JPEG_DELEGATE) -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% R e a d J P E G I m a g e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% ReadJPEGImage() reads a JPEG image file and returns it. It allocates -% the memory necessary for the new Image structure and returns a pointer to -% the new image. -% -% The format of the ReadJPEGImage method is: -% -% Image *ReadJPEGImage(const ImageInfo *image_info, -% ExceptionInfo *exception) -% -% A description of each parameter follows: -% -% o image_info: the image info. -% -% o exception: return any errors or warnings in this structure. -% -*/ - -static MagickBooleanType EmitMessage(j_common_ptr jpeg_info,int level) -{ - char - message[JMSG_LENGTH_MAX]; - - ErrorManager - *error_manager; - - Image - *image; - - (jpeg_info->err->format_message)(jpeg_info,message); - error_manager=(ErrorManager *) jpeg_info->client_data; - image=error_manager->image; - if (error_manager->verbose != MagickFalse) - (void) fprintf(stdout,"%s\n",message); - if (level < 0) - { - if ((jpeg_info->err->num_warnings == 0) || - (jpeg_info->err->trace_level >= 3)) - ThrowBinaryException(CorruptImageError,(char *) message, - image->filename); - jpeg_info->err->num_warnings++; - } - else - if (jpeg_info->err->trace_level >= level) - ThrowBinaryException(CoderError,(char *) message,image->filename); - return(MagickTrue); -} - -static boolean FillInputBuffer(j_decompress_ptr cinfo) -{ - SourceManager - *source; - - source=(SourceManager *) cinfo->src; - if (source->image) - source->manager.bytes_in_buffer=(size_t) ReadBlob(source->image, - MagickMin(source->source_length,MaxBufferExtent),source->buffer); - else - { - source->manager.bytes_in_buffer=(size_t) MagickMin(source->source_length, - MaxBufferExtent); - (void) CopyMagickMemory(source->buffer,source->source_data, - source->manager.bytes_in_buffer); - source->source_data+=source->manager.bytes_in_buffer; - } - source->source_length-=source->manager.bytes_in_buffer; - if (source->manager.bytes_in_buffer == 0) - { - if (source->start_of_blob != 0) - ERREXIT(cinfo,JERR_INPUT_EMPTY); - WARNMS(cinfo,JWRN_JPEG_EOF); - source->buffer[0]=(JOCTET) 0xff; - source->buffer[1]=(JOCTET) JPEG_EOI; - source->manager.bytes_in_buffer=2; - } - source->manager.next_input_byte=source->buffer; - source->start_of_blob=FALSE; - return(TRUE); -} - -static int GetCharacter(j_decompress_ptr jpeg_info) -{ - if (jpeg_info->src->bytes_in_buffer == 0) - (void) (*jpeg_info->src->fill_input_buffer)(jpeg_info); - jpeg_info->src->bytes_in_buffer--; - return((int) GETJOCTET(*jpeg_info->src->next_input_byte++)); -} - -static void InitializeSource(j_decompress_ptr cinfo) -{ - SourceManager - *source; - - source=(SourceManager *) cinfo->src; - source->start_of_blob=TRUE; -} - -static void JPEGErrorHandler(j_common_ptr jpeg_info) -{ - ErrorManager - *error_manager; - - (void) EmitMessage(jpeg_info,0); - error_manager=(ErrorManager *) jpeg_info->client_data; - longjmp(error_manager->error_recovery,1); -} - -static boolean ReadComment(j_decompress_ptr jpeg_info) -{ - char - *comment; - - ErrorManager - *error_manager; - - Image - *image; - - register char - *p; - - register long - i; - - size_t - length; - - /* - Determine length of comment. - */ - error_manager=(ErrorManager *) jpeg_info->client_data; - image=error_manager->image; - length=(size_t) ((unsigned long) GetCharacter(jpeg_info) << 8); - length+=GetCharacter(jpeg_info); - length-=2; - if (length <= 0) - return(MagickTrue); - comment=(char *) NULL; - if (~length >= MaxTextExtent) - comment=(char *) AcquireQuantumMemory(length+MaxTextExtent, - sizeof(*comment)); - if (comment == (char *) NULL) - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); - /* - Read comment. - */ - i=(long) length-1; - for (p=comment; i-- >= 0; p++) - *p=(char) GetCharacter(jpeg_info); - *p='\0'; - (void) SetImageProperty(image,"comment",comment); - comment=DestroyString(comment); - return(MagickTrue); -} - -static boolean ReadICCProfile(j_decompress_ptr jpeg_info) -{ - char - magick[12]; - - ErrorManager - *error_manager; - - Image - *image; - - MagickBooleanType - status; - - register long - i; - - register unsigned char - *p; - - size_t - length; - - StringInfo - *icc_profile, - *profile; - - /* - Read color profile. - */ - length=(size_t) ((unsigned long) GetCharacter(jpeg_info) << 8); - length+=(size_t) GetCharacter(jpeg_info); - if (length < 2) - return(MagickFalse); - length-=2; - if (length <= 14) - { - while (length-- != 0) - (void) GetCharacter(jpeg_info); - return(MagickTrue); - } - for (i=0; i < 12; i++) - magick[i]=(char) GetCharacter(jpeg_info); - if (LocaleCompare(magick,ICC_PROFILE) != 0) - { - /* - Not a ICC profile, return. - */ - for (i=0; i < (long) (length-12); i++) - (void) GetCharacter(jpeg_info); - return(MagickTrue); - } - (void) GetCharacter(jpeg_info); /* id */ - (void) GetCharacter(jpeg_info); /* markers */ - if (length < 14) - return(MagickFalse); - length-=14; - error_manager=(ErrorManager *) jpeg_info->client_data; - image=error_manager->image; - profile=AcquireStringInfo(length); - if (profile == (StringInfo *) NULL) - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); - p=GetStringInfoDatum(profile); - for (i=(long) GetStringInfoLength(profile)-1; i >= 0; i--) - *p++=(unsigned char) GetCharacter(jpeg_info); - icc_profile=(StringInfo *) GetImageProfile(image,"icc"); - if (icc_profile != (StringInfo *) NULL) - ConcatenateStringInfo(icc_profile,profile); - else - { - status=SetImageProfile(image,"icc",profile); - if (status == MagickFalse) - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); - } - if (image->debug != MagickFalse) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Profile: ICC, %lu bytes",(unsigned long) length); - return(MagickTrue); -} - -static boolean ReadIPTCProfile(j_decompress_ptr jpeg_info) -{ - char - magick[MaxTextExtent]; - - ErrorManager - *error_manager; - - Image - *image; - - MagickBooleanType - status; - - register long - i; - - register unsigned char - *p; - - size_t - length, - tag_length; - - StringInfo - *iptc_profile, - *profile; - -#if defined(GET_ONLY_IPTC_DATA) - unsigned char - tag[MaxTextExtent]; -#endif - - /* - Determine length of binary data stored here. - */ - length=(size_t) ((unsigned long) GetCharacter(jpeg_info) << 8); - length+=(size_t) GetCharacter(jpeg_info); - if (length <= 2) - return(MagickTrue); - length-=2; - tag_length=0; -#if defined(GET_ONLY_IPTC_DATA) - *tag='\0'; -#endif - error_manager=(ErrorManager *) jpeg_info->client_data; - image=error_manager->image; - iptc_profile=(StringInfo *) GetImageProfile(image,"iptc"); - if (iptc_profile == (StringInfo *) NULL) - { -#if defined(GET_ONLY_IPTC_DATA) - /* - Find the beginning of the iptc portion of the binary data. - */ - for (*tag='\0'; length > 0; ) - { - *tag=GetCharacter(jpeg_info); - *(tag+1)=GetCharacter(jpeg_info); - if (length < 2) - return(MagickFalse); - length-=2; - if ((*tag == 0x1c) && (*(tag+1) == 0x02)) - break; - } - tag_length=2; -#else - /* - Validate that this was written as a Photoshop resource format slug. - */ - for (i=0; i < 10; i++) - magick[i]=(char) GetCharacter(jpeg_info); - magick[10]='\0'; - if (length <= 10) - return(MagickTrue); - length-=10; - if (LocaleCompare(magick,"Photoshop ") != 0) - { - /* - Not a ICC profile, return. - */ - for (i=0; i < (long) length; i++) - (void) GetCharacter(jpeg_info); - return(MagickTrue); - } - /* - Remove the version number. - */ - for (i=0; i < 4; i++) - (void) GetCharacter(jpeg_info); - if (length <= 4) - return(MagickTrue); - length-=4; - tag_length=0; -#endif - } - if (length == 0) - return(MagickTrue); - profile=AcquireStringInfo(length); - if (profile == (StringInfo *) NULL) - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); - p=GetStringInfoDatum(profile); - for (i=(long) GetStringInfoLength(profile)-1; i >= 0; i--) - *p++=(unsigned char) GetCharacter(jpeg_info); - iptc_profile=(StringInfo *) GetImageProfile(image,"iptc"); - if (iptc_profile != (StringInfo *) NULL) - ConcatenateStringInfo(iptc_profile,profile); - else - { - status=SetImageProfile(image,"iptc",profile); - if (status == MagickFalse) - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); - } - if (image->debug != MagickFalse) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Profile: iptc, %lu bytes",(unsigned long) length); - return(MagickTrue); -} - -static boolean ReadProfile(j_decompress_ptr jpeg_info) -{ - char - name[MaxTextExtent]; - - ErrorManager - *error_manager; - - Image - *image; - - int - marker; - - MagickBooleanType - status; - - register long - i; - - register unsigned char - *p; - - size_t - length; - - StringInfo - *profile; - - /* - Read generic profile. - */ - length=(size_t) ((unsigned long) GetCharacter(jpeg_info) << 8); - length+=(size_t) GetCharacter(jpeg_info); - if (length <= 2) - return(MagickTrue); - length-=2; - marker=jpeg_info->unread_marker-JPEG_APP0; - error_manager=(ErrorManager *) jpeg_info->client_data; - image=error_manager->image; - (void) FormatMagickString(name,MaxTextExtent,"APP%d",marker); - profile=AcquireStringInfo(length); - if (profile == (StringInfo *) NULL) - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); - p=GetStringInfoDatum(profile); - for (i=(long) GetStringInfoLength(profile)-1; i >= 0; i--) - *p++=(unsigned char) GetCharacter(jpeg_info); - if (marker == 1) - { - p=GetStringInfoDatum(profile); - if ((length > 4) && (LocaleNCompare((char *) p,"exif",4) == 0)) - (void) CopyMagickString(name,"iptc",MaxTextExtent); - if ((length > 5) && (LocaleNCompare((char *) p,"http:",5) == 0)) - (void) CopyMagickString(name,"xmp",MaxTextExtent); - } - status=SetImageProfile(image,name,profile); - if (status == MagickFalse) - ThrowBinaryException(ResourceLimitError,"MemoryAllocationFailed", - image->filename); - if (image->debug != MagickFalse) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Profile: %s, %lu bytes",name,(unsigned long) length); - return(MagickTrue); -} - -static void SkipInputData(j_decompress_ptr cinfo,long number_bytes) -{ - SourceManager - *source; - - if (number_bytes <= 0) - return; - source=(SourceManager *) cinfo->src; - while (number_bytes > (long) source->manager.bytes_in_buffer) - { - number_bytes-=(long) source->manager.bytes_in_buffer; - (void) FillInputBuffer(cinfo); - } - source->manager.next_input_byte+=(size_t) number_bytes; - source->manager.bytes_in_buffer-=(size_t) number_bytes; -} - -static void TerminateSource(j_decompress_ptr cinfo) -{ - cinfo=cinfo; -} - -static void JPEGSourceManagerMemory(j_decompress_ptr cinfo,unsigned char *source_data, unsigned long source_length) -{ - SourceManager - *source; - - cinfo->src=(struct jpeg_source_mgr *) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo,JPOOL_IMAGE,sizeof(SourceManager)); - source=(SourceManager *) cinfo->src; - source->buffer=(JOCTET *) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo,JPOOL_IMAGE,MaxBufferExtent*sizeof(JOCTET)); - source=(SourceManager *) cinfo->src; - source->manager.init_source=InitializeSource; - source->manager.fill_input_buffer=FillInputBuffer; - source->manager.skip_input_data=SkipInputData; - source->manager.resync_to_restart=jpeg_resync_to_restart; - source->manager.term_source=TerminateSource; - source->manager.bytes_in_buffer=0; - source->manager.next_input_byte=NULL; - source->image=0; - source->source_data=source_data; - source->source_length=source_length; -} - -static void JPEGSourceManagerBLOB(j_decompress_ptr cinfo,Image *image, unsigned long source_length) -{ - SourceManager - *source; - - cinfo->src=(struct jpeg_source_mgr *) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo,JPOOL_IMAGE,sizeof(SourceManager)); - source=(SourceManager *) cinfo->src; - source->buffer=(JOCTET *) (*cinfo->mem->alloc_small) - ((j_common_ptr) cinfo,JPOOL_IMAGE,MaxBufferExtent*sizeof(JOCTET)); - source=(SourceManager *) cinfo->src; - source->manager.init_source=InitializeSource; - source->manager.fill_input_buffer=FillInputBuffer; - source->manager.skip_input_data=SkipInputData; - source->manager.resync_to_restart=jpeg_resync_to_restart; - source->manager.term_source=TerminateSource; - source->manager.bytes_in_buffer=0; - source->manager.next_input_byte=NULL; - source->image=image; - source->source_data=0; - source->source_length=source_length; -} -#endif - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% D e c o d e I m a g e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DecodeImage unpacks the packed image pixels into runlength-encoded -% pixel packets. -% -% The format of the DecodeImage method is: -% -% MagickBooleanType DecodeImage(Image *image, -% const MagickBooleanType compression,unsigned char *pixels) -% -% A description of each parameter follows: -% -% o image: the address of a structure of type Image. -% -% o compression: A value of 1 means the compressed pixels are runlength -% encoded for a 256-color bitmap. A value of 2 means a 16-color bitmap. -% -% o pixels: The address of a byte (8 bits) array of pixel data created by -% the decoding process. -% -*/ -static MagickBooleanType DecodeImage(Image *image, - const MagickBooleanType compression,unsigned char *pixels) -{ -#if !defined(__WINDOWS__) || defined(__MINGW32__) -#define BI_RLE8 1 -#endif - - long - y; - - register long - i, - x; - - register unsigned char - *p, - *q; - - ssize_t - count; - - unsigned char - byte; - - assert(image != (Image *) NULL); - assert(image->signature == MagickSignature); - if (image->debug != MagickFalse) - (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); - assert(pixels != (unsigned char *) NULL); - (void) ResetMagickMemory(pixels,0,(size_t) image->columns*image->rows* - sizeof(*pixels)); - byte=0; - x=0; - p=pixels; - q=pixels+(size_t) image->columns*image->rows; - for (y=0; y < (long) image->rows; ) - { - if ((p < pixels) || (p >= q)) - break; - count=(ssize_t) ReadBlobByte(image); - if ((int) count == EOF) - break; - if (count != 0) - { - count=(ssize_t) MagickMin((size_t) count,(size_t) (q-p)); - /* - Encoded mode. - */ - byte=(unsigned char) ReadBlobByte(image); - if (compression == BI_RLE8) - { - for (i=0; i < (long) count; i++) - *p++=(unsigned char) byte; - } - else - { - for (i=0; i < (long) count; i++) - *p++=(unsigned char) - ((i & 0x01) != 0 ? (byte & 0x0f) : ((byte >> 4) & 0x0f)); - } - x+=count; - } - else - { - /* - Escape mode. - */ - count=(ssize_t) ReadBlobByte(image); - if (count == 0x01) - return(MagickTrue); - switch (count) - { - case 0x00: - { - /* - End of line. - */ - x=0; - y++; - p=pixels+y*image->columns; - break; - } - case 0x02: - { - /* - Delta mode. - */ - x+=ReadBlobByte(image); - y+=ReadBlobByte(image); - p=pixels+y*image->columns+x; - break; - } - default: - { - /* - Absolute mode. - */ - count=(ssize_t) MagickMin((size_t) count,(size_t) (q-p)); - if (compression == BI_RLE8) - for (i=0; i < (long) count; i++) - *p++=(unsigned char) ReadBlobByte(image); - else - for (i=0; i < (long) count; i++) - { - if ((i & 0x01) == 0) - byte=(unsigned char) ReadBlobByte(image); - *p++=(unsigned char) - ((i & 0x01) != 0 ? (byte & 0x0f) : ((byte >> 4) & 0x0f)); - } - x+=count; - /* - Read pad byte. - */ - if (compression == BI_RLE8) - { - if ((count & 0x01) != 0) - if (ReadBlobByte(image) == EOF) - ThrowBinaryException(CorruptImageError, - "UnexpectedEndOfFile",image->filename); - } - else - if (((count & 0x03) == 1) || ((count & 0x03) == 2)) - if (ReadBlobByte(image) == EOF) - ThrowBinaryException(CorruptImageError, - "UnexpectedEndOfFile",image->filename); - break; - } - } - } - if (SetImageProgress(image,LoadImageTag,y,image->rows) == MagickFalse) - break; - } - if (ReadBlobByte(image) == EOF) - ThrowBinaryException(CorruptImageError,"UnexpectedEndOfFile", - image->filename); - if (ReadBlobByte(image) == EOF) - ThrowBinaryException(CorruptImageError,"UnexpectedEndOfFile", - image->filename); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% I s A V I % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% IsAVI() returns MagickTrue if the image format type, identified by the -% magick string, is Audio/Video Interleaved file format. -% -% The format of the IsAVI method is: -% -% unsigned long IsAVI(const unsigned char *magick,const size_t length) -% -% A description of each parameter follows: -% -% o magick: compare image format pattern against these bytes. -% -% o length: Specifies the length of the magick string. -% -*/ -static MagickBooleanType IsAVI(const unsigned char *magick,const size_t length) -{ - if (length < 4) - return(MagickFalse); - if (memcmp(magick,"RIFF",4) == 0) - return(MagickTrue); - return(MagickFalse); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% R e a d A V I I m a g e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% ReadAVIImage() reads an Audio Video Interleave image file and returns -% it. It allocates the memory necessary for the new Image structure and -% returns a pointer to the new image. -% -% The format of the ReadAVIImage method is: -% -% Image *ReadAVIImage(const ImageInfo *image_info,ExceptionInfo *exception) -% -% A description of each parameter follows: -% -% o image: Method ReadAVIImage returns a pointer to the image after -% reading. A null image is returned if there is a memory shortage or if -% the image cannot be read. -% -% o image_info: the image info. -% -% o exception: return any errors or warnings in this structure. -% -*/ - -static Image *DecodeAVIImage(const ImageInfo *image_info, - ExceptionInfo *exception) -{ - Image - *image, - *images; - - ImageInfo - *read_info; - - MagickBooleanType - status; - - register long - i; - - /* - Open image file. - */ - assert(image_info != (const ImageInfo *) NULL); - assert(image_info->signature == MagickSignature); - if (image_info->debug != MagickFalse) - (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", - image_info->filename); - assert(exception != (ExceptionInfo *) NULL); - assert(exception->signature == MagickSignature); - image=AcquireImage(image_info); - status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); - if (status == MagickFalse) - { - image=DestroyImageList(image); - return((Image *) NULL); - } - (void) CloseBlob(image); - (void) DestroyImageList(image); - /* - Convert AVI to PPM with delegate. - */ - image=AcquireImage(image_info); - read_info=CloneImageInfo(image_info); - (void) InvokeDelegate(read_info,image,"avi:decode",(char *) NULL,exception); - image=DestroyImage(image); - /* - Read PNG files. - */ - images=NewImageList(); - for (i=1; ; i++) - { - (void) FormatMagickString(read_info->filename,MaxTextExtent,"%08ld.png",i); - if (IsPathAccessible(read_info->filename) == MagickFalse) - break; - image=ReadImage(read_info,exception); - if (image == (Image *) NULL) - break; - (void) CopyMagickString(image->magick,image_info->magick,MaxTextExtent); - image->scene=(unsigned long) i; - AppendImageToList(&images,image); - if (read_info->number_scenes != 0) - if (i >= (long) (read_info->scene+read_info->number_scenes-1)) - break; - } - /* - Relinquish resources. - */ - for (i=1; ; i++) - { - (void) FormatMagickString(read_info->filename,MaxTextExtent,"%08ld.png",i); - if (IsPathAccessible(read_info->filename) == MagickFalse) - break; - (void) RelinquishUniqueFileResource(read_info->filename); - } - read_info=DestroyImageInfo(read_info); - return(images); -} - -static Image *ReadAVIImage(const ImageInfo *image_info,ExceptionInfo *exception) -{ - AVIInfo - avi_info; - - AVIStreamInfo - stream_info; - - BMPInfo - bmp_info; - - char - id[MaxTextExtent]; - - Image - *image; - - IndexPacket - index; - - long - y; - - MagickBooleanType - riff_chunk, - status; - - MagickOffsetType - offset; - - PixelPacket - *colormap; - - register IndexPacket - *indexes; - - register long - x; - - register PixelPacket - *q; - - register long - i; - - register unsigned char - *p; - - ssize_t - count; - - unsigned char - *pixels; - - unsigned long - bit, - bytes_per_line, - chunk_size, - number_colors; - -#if defined(MAGICKCORE_JPEG_DELEGATE) - const char - *value; - - ErrorManager - error_manager; - - GeometryInfo - geometry_info; - - JSAMPLE - *jpeg_pixels; - - JSAMPROW - scanline[1]; - - struct jpeg_decompress_struct - jpeg_info; - - struct jpeg_error_mgr - jpeg_error; - - unsigned long - number_pixels, - units; -#endif - - /* - Open image file. - */ - assert(image_info != (const ImageInfo *) NULL); - assert(image_info->signature == MagickSignature); - if (image_info->debug != MagickFalse) - (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s", - image_info->filename); - assert(exception != (ExceptionInfo *) NULL); - assert(exception->signature == MagickSignature); - image=AcquireImage(image_info); - status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception); - if (status == MagickFalse) - { - image=DestroyImageList(image); - return((Image *) NULL); - } - (void) ResetMagickMemory(&avi_info,0,sizeof(AVIInfo)); - (void) ResetMagickMemory(&bmp_info,0,sizeof(BMPInfo)); - colormap=(PixelPacket *) NULL; - number_colors=0; - -#if defined(MAGICKCORE_JPEG_DELEGATE) - /* - Initialize JPEG image structure. - */ - jpeg_info.err=jpeg_std_error(&jpeg_error); - jpeg_info.err->emit_message=(void (*)(j_common_ptr,int)) EmitMessage; - jpeg_info.err->error_exit=(void (*)(j_common_ptr)) JPEGErrorHandler; - jpeg_pixels=(JSAMPLE *) NULL; - error_manager.image=image; - error_manager.verbose=(int) image_info->verbose; - if (setjmp(error_manager.error_recovery) != 0) - { - if (jpeg_pixels != (JSAMPLE *) NULL) - jpeg_pixels=(unsigned char *) RelinquishMagickMemory(jpeg_pixels); - jpeg_destroy_decompress(&jpeg_info); - InheritException(exception,&image->exception); - number_pixels=image->columns*image->rows; - if (number_pixels != 0) - return(GetFirstImageInList(image)); - image=DestroyImage(image); - return((Image *) NULL); - } - jpeg_info.client_data=(void *) &error_manager; - jpeg_create_decompress(&jpeg_info); - JPEGSourceManagerMemory(&jpeg_info, (unsigned char *) &MJPGDHTSeg, 0x1A8); - jpeg_read_header(&jpeg_info, FALSE); -#endif - for (riff_chunk=MagickTrue; ; riff_chunk=MagickFalse) - { - count=ReadBlob(image,4,(unsigned char *) id); - if (count != 4) - break; - id[4]='\0'; - if ((riff_chunk == MagickTrue) && (memcmp(id,"RIFF",4) != 0)) - ThrowReaderException(CorruptImageError,"ImproperImageHeader"); - chunk_size=ReadBlobLSBLong(image); - if (EOFBlob(image) != MagickFalse) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - if (chunk_size == 0) - break; - if ((chunk_size & 0x01) != 0) - chunk_size++; - if ((GetBlobSize(image) != 0) && - ((MagickSizeType) chunk_size > GetBlobSize(image))) - ThrowReaderException(CorruptImageError,"NotEnoughPixelData"); - if (image_info->verbose != MagickFalse) - { - (void) fprintf(stdout,"AVI cid %s\n",id); - (void) fprintf(stdout," chunk size %lu\n",chunk_size); - } - if ((LocaleCompare(id,"00db") == 0) || (LocaleCompare(id,"00dc") == 0)) - { - - /* - Read JPG compressed image, uses only YCbCr color space encoding - and does not include the JPEG Huffman table, as it is pre-defined. - */ - if (LocaleCompare(bmp_info.compression,"MJPG") == 0) - { -#if defined(MAGICKCORE_JPEG_DELEGATE) - JPEGSourceManagerBLOB(&jpeg_info,image,chunk_size); - jpeg_set_marker_processor(&jpeg_info,JPEG_COM,ReadComment); - jpeg_set_marker_processor(&jpeg_info,ICC_MARKER,ReadICCProfile); - jpeg_set_marker_processor(&jpeg_info,IPTC_MARKER,ReadIPTCProfile); - for (i=1; i < 16; i++) - if ((i != 2) && (i != 13) && (i != 14)) - jpeg_set_marker_processor(&jpeg_info,(int) i+JPEG_APP0,ReadProfile); - i=jpeg_read_header(&jpeg_info,MagickTrue); - /* - Set image resolution. - */ - units=0; - if ((jpeg_info.saw_JFIF_marker != 0) && (jpeg_info.X_density != 1) && - (jpeg_info.Y_density != 1)) - { - image->x_resolution=(double) jpeg_info.X_density; - image->y_resolution=(double) jpeg_info.Y_density; - units=(unsigned long) jpeg_info.density_unit; - } - value=GetImageProperty(image,"exif:XResolution"); - if (value != (char *) NULL) - { - (void) ParseGeometry(value,&geometry_info); - if (geometry_info.sigma != 0) - image->x_resolution=geometry_info.rho/geometry_info.sigma; - (void) SetImageProperty(image,"exif:XResolution",(char *) NULL); - } - value=GetImageProperty(image,"exif:YResolution"); - if (value != (char *) NULL) - { - (void) ParseGeometry(value,&geometry_info); - if (geometry_info.sigma != 0) - image->y_resolution=geometry_info.rho/geometry_info.sigma; - (void) SetImageProperty(image,"exif:YResolution",(char *) NULL); - } - if (units == 1) - image->units=PixelsPerInchResolution; - if (units == 2) - image->units=PixelsPerCentimeterResolution; - number_pixels=image->columns*image->rows; - if (number_pixels != 0) - { - double - scale_factor; - - /* - Let the JPEG library subsample for us. - */ - jpeg_calc_output_dimensions(&jpeg_info); - image->magick_columns=jpeg_info.output_width; - image->magick_rows=jpeg_info.output_height; - scale_factor=(double) jpeg_info.output_width/image->columns; - if (scale_factor > ((double) jpeg_info.output_height/image->rows)) - scale_factor=(double) jpeg_info.output_height/image->rows; - jpeg_info.scale_denom=(unsigned int) scale_factor; - jpeg_calc_output_dimensions(&jpeg_info); - if (image->debug != MagickFalse) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Scale factor: %ld",(long) scale_factor); - } -#if (JPEG_LIB_VERSION >= 61) && defined(D_PROGRESSIVE_SUPPORTED) -#ifdef D_LOSSLESS_SUPPORTED - image->interlace=jpeg_info.process == JPROC_PROGRESSIVE ? - PlaneInterlace : NoInterlace; - image->compression=jpeg_info.process == JPROC_LOSSLESS ? - LosslessJPEGCompression : JPEGCompression; - if (jpeg_info.data_precision > 8) - (void) ThrowMagickException(exception,GetMagickModule(), - OptionWarning, - "12-bit JPEG not supported. Reducing pixel data to 8 bits", - "`%s'",image->filename); -#else - image->interlace=jpeg_info.progressive_mode != 0 ? PlaneInterlace : - NoInterlace; - image->compression=JPEGCompression; -#endif -#else - image->compression=JPEGCompression; - image->interlace=PlaneInterlace; -#endif - if ((image_info->colors != 0) && (image_info->colors <= 256)) - { - /* - Let the JPEG library quantize for us. - */ - jpeg_info.quantize_colors=MagickTrue; - jpeg_info.desired_number_of_colors=(int) image_info->colors; - if (AcquireImageColormap(image,image_info->colors) == MagickFalse) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - } - (void) jpeg_start_decompress(&jpeg_info); - image->columns=jpeg_info.output_width; - image->rows=jpeg_info.output_height; - image->depth=(unsigned long) jpeg_info.data_precision; - if (jpeg_info.out_color_space == JCS_CMYK) - image->colorspace=CMYKColorspace; - if ((jpeg_info.output_components == 1) && - (jpeg_info.quantize_colors == MagickFalse)) - { - if (AcquireImageColormap(image,1UL << image->depth) == MagickFalse) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - } - if (image->debug != MagickFalse) - { - if (image->interlace == PlaneInterlace) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Interlace: progressive"); - else - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Interlace: nonprogressive"); - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Data precision: %d",(int) jpeg_info.data_precision); - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Geometry: %dx%d",(int) jpeg_info.output_width,(int) - jpeg_info.output_height); -#ifdef D_LOSSLESS_SUPPORTED - if (image->compression==LosslessJPEGCompression) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Quality: 100 (lossless)"); - else -#endif - { - long - hashval, - sum; - - /* - Log the JPEG quality that was used for compression. - */ - sum=0; - for (i=0; i < NUM_QUANT_TBLS; i++) - { - int - j; - - if (jpeg_info.quant_tbl_ptrs[i] != NULL) - for (j=0; j < DCTSIZE2; j++) - { - UINT16 - *c; - - c=jpeg_info.quant_tbl_ptrs[i]->quantval; - sum+=c[j]; - } - } - if ((jpeg_info.quant_tbl_ptrs[0] != NULL) && - (jpeg_info.quant_tbl_ptrs[1] != NULL)) - { - int - hash[]= - { - 1020, 1015, 932, 848, 780, 735, 702, 679, 660, 645, - 632, 623, 613, 607, 600, 594, 589, 585, 581, 571, - 555, 542, 529, 514, 494, 474, 457, 439, 424, 410, - 397, 386, 373, 364, 351, 341, 334, 324, 317, 309, - 299, 294, 287, 279, 274, 267, 262, 257, 251, 247, - 243, 237, 232, 227, 222, 217, 213, 207, 202, 198, - 192, 188, 183, 177, 173, 168, 163, 157, 153, 148, - 143, 139, 132, 128, 125, 119, 115, 108, 104, 99, - 94, 90, 84, 79, 74, 70, 64, 59, 55, 49, - 45, 40, 34, 30, 25, 20, 15, 11, 6, 4, - 0 - }, - sums[]= - { - 32640,32635,32266,31495,30665,29804,29146,28599,28104,27670, - 27225,26725,26210,25716,25240,24789,24373,23946,23572,22846, - 21801,20842,19949,19121,18386,17651,16998,16349,15800,15247, - 14783,14321,13859,13535,13081,12702,12423,12056,11779,11513, - 11135,10955,10676,10392,10208, 9928, 9747, 9564, 9369, 9193, - 9017, 8822, 8639, 8458, 8270, 8084, 7896, 7710, 7527, 7347, - 7156, 6977, 6788, 6607, 6422, 6236, 6054, 5867, 5684, 5495, - 5305, 5128, 4945, 4751, 4638, 4442, 4248, 4065, 3888, 3698, - 3509, 3326, 3139, 2957, 2775, 2586, 2405, 2216, 2037, 1846, - 1666, 1483, 1297, 1109, 927, 735, 554, 375, 201, 128, - 0 - }; - - hashval=(long) ((jpeg_info.quant_tbl_ptrs[0]->quantval[2]+ - jpeg_info.quant_tbl_ptrs[0]->quantval[53]+ - jpeg_info.quant_tbl_ptrs[1]->quantval[0]+ - jpeg_info.quant_tbl_ptrs[1]->quantval[DCTSIZE2-1])); - for (i=0; i < 100; i++) - { - if ((hashval >= hash[i]) || (sum >= sums[i])) - { - if ((hashval > hash[i]) || (sum > sums[i])) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Quality: %ld (approximate)",i+1); - else - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Quality: %ld",i+1); - break; - } - } - } - else - if (jpeg_info.quant_tbl_ptrs[0] != NULL) - { - int - bwhash[]= - { - 510, 505, 422, 380, 355, 338, 326, 318, 311, 305, - 300, 297, 293, 291, 288, 286, 284, 283, 281, 280, - 279, 278, 277, 273, 262, 251, 243, 233, 225, 218, - 211, 205, 198, 193, 186, 181, 177, 172, 168, 164, - 158, 156, 152, 148, 145, 142, 139, 136, 133, 131, - 129, 126, 123, 120, 118, 115, 113, 110, 107, 105, - 102, 100, 97, 94, 92, 89, 87, 83, 81, 79, - 76, 74, 70, 68, 66, 63, 61, 57, 55, 52, - 50, 48, 44, 42, 39, 37, 34, 31, 29, 26, - 24, 21, 18, 16, 13, 11, 8, 6, 3, 2, - 0 - }, - bwsum[]= - { - 16320,16315,15946,15277,14655,14073,13623,13230,12859,12560, - 12240,11861,11456,11081,10714,10360,10027, 9679, 9368, 9056, - 8680, 8331, 7995, 7668, 7376, 7084, 6823, 6562, 6345, 6125, - 5939, 5756, 5571, 5421, 5240, 5086, 4976, 4829, 4719, 4616, - 4463, 4393, 4280, 4166, 4092, 3980, 3909, 3835, 3755, 3688, - 3621, 3541, 3467, 3396, 3323, 3247, 3170, 3096, 3021, 2952, - 2874, 2804, 2727, 2657, 2583, 2509, 2437, 2362, 2290, 2211, - 2136, 2068, 1996, 1915, 1858, 1773, 1692, 1620, 1552, 1477, - 1398, 1326, 1251, 1179, 1109, 1031, 961, 884, 814, 736, - 667, 592, 518, 441, 369, 292, 221, 151, 86, 64, - 0 - }; - - hashval=(long) ((jpeg_info.quant_tbl_ptrs[0]->quantval[2]+ - jpeg_info.quant_tbl_ptrs[0]->quantval[53])); - for (i=0; i < 100; i++) - { - if ((hashval >= bwhash[i]) || (sum >= bwsum[i])) - { - if ((hashval > bwhash[i]) || (sum > bwsum[i])) - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Quality: %ld (approximate)",i+1); - else - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Quality: %ld",i+1); - break; - } - } - } - } - switch (jpeg_info.out_color_space) - { - case JCS_CMYK: - { - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Colorspace: CMYK"); - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Sampling factors: (%d,%d),(%d,%d),(%d,%d),(%d,%d)", - jpeg_info.comp_info[0].h_samp_factor, - jpeg_info.comp_info[0].v_samp_factor, - jpeg_info.comp_info[1].h_samp_factor, - jpeg_info.comp_info[1].v_samp_factor, - jpeg_info.comp_info[2].h_samp_factor, - jpeg_info.comp_info[2].v_samp_factor, - jpeg_info.comp_info[3].h_samp_factor, - jpeg_info.comp_info[3].v_samp_factor); - break; - } - case JCS_GRAYSCALE: - { - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Colorspace: GRAYSCALE"); - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Sampling factors: (%d,%d)", - jpeg_info.comp_info[0].h_samp_factor, - jpeg_info.comp_info[0].v_samp_factor); - break; - } - case JCS_RGB: - { - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Colorspace: RGB"); - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Sampling factors: (%d,%d),(%d,%d),(%d,%d)", - jpeg_info.comp_info[0].h_samp_factor, - jpeg_info.comp_info[0].v_samp_factor, - jpeg_info.comp_info[1].h_samp_factor, - jpeg_info.comp_info[1].v_samp_factor, - jpeg_info.comp_info[2].h_samp_factor, - jpeg_info.comp_info[2].v_samp_factor); - break; - } - default: - { - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Colorspace: %d",jpeg_info.out_color_space); - (void) LogMagickEvent(CoderEvent,GetMagickModule(), - "Sampling factors: (%d,%d),(%d,%d),(%d,%d),(%d,%d)", - jpeg_info.comp_info[0].h_samp_factor, - jpeg_info.comp_info[0].v_samp_factor, - jpeg_info.comp_info[1].h_samp_factor, - jpeg_info.comp_info[1].v_samp_factor, - jpeg_info.comp_info[2].h_samp_factor, - jpeg_info.comp_info[2].v_samp_factor, - jpeg_info.comp_info[3].h_samp_factor, - jpeg_info.comp_info[3].v_samp_factor); - break; - } - } - } - if (image_info->ping != MagickFalse) - { - jpeg_destroy_decompress(&jpeg_info); - (void) CloseBlob(image); - return(GetFirstImageInList(image)); - } - jpeg_pixels=(JSAMPLE *) AcquireQuantumMemory((size_t) - image->columns,jpeg_info.output_components*sizeof(JSAMPLE)); - if (jpeg_pixels == (JSAMPLE *) NULL) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - /* - Convert JPEG pixels to pixel packets. - */ - scanline[0]=(JSAMPROW) jpeg_pixels; - for (y=0; y < (long) image->rows; y++) - { - (void) jpeg_read_scanlines(&jpeg_info,scanline,1); - p=jpeg_pixels; - q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - indexes=GetAuthenticIndexQueue(image); - if (jpeg_info.data_precision > 8) - { - if (jpeg_info.output_components == 1) - for (x=0; x < (long) image->columns; x++) - { - index=ConstrainColormapIndex(image,16*(unsigned long) - GETJSAMPLE(*p)); - indexes[x]=(IndexPacket) index; - *q++=image->colormap[(long) index]; - p++; - } - else - for (x=0; x < (long) image->columns; x++) - { - q->red=ScaleShortToQuantum((unsigned short) - (16*GETJSAMPLE(*p++))); - q->green=ScaleShortToQuantum((unsigned short) - (16*GETJSAMPLE(*p++))); - q->blue=ScaleShortToQuantum((unsigned short) - (16*GETJSAMPLE(*p++))); - if (image->colorspace == CMYKColorspace) - indexes[x]=ScaleShortToQuantum((unsigned short) - (16*GETJSAMPLE(*p++))); - q++; - } - } - else - if (jpeg_info.output_components == 1) - for (x=0; x < (long) image->columns; x++) - { - index=ConstrainColormapIndex(image,(unsigned long) - GETJSAMPLE(*p)); - indexes[x]=(IndexPacket) index; - *q++=image->colormap[(long) index]; - p++; - } - else - for (x=0; x < (long) image->columns; x++) - { - q->red=ScaleCharToQuantum((unsigned char) GETJSAMPLE(*p++)); - q->green=ScaleCharToQuantum((unsigned char) - GETJSAMPLE(*p++)); - q->blue=ScaleCharToQuantum((unsigned char) - GETJSAMPLE(*p++)); - if (image->colorspace == CMYKColorspace) - indexes[x]=ScaleCharToQuantum((unsigned char) - GETJSAMPLE(*p++)); - q++; - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - if (image->previous == (Image *) NULL) - { - status=SetImageProgress(image,LoadImageTag,y,image->rows); - if (status == MagickFalse) - break; - } - } - if (jpeg_info.quantize_colors != MagickFalse) - for (i=0; i < jpeg_info.actual_number_of_colors; i++) - { - image->colormap[i].red= - ScaleCharToQuantum(jpeg_info.colormap[0][i]); - image->colormap[i].green= - ScaleCharToQuantum(jpeg_info.colormap[1][i]); - image->colormap[i].blue= - ScaleCharToQuantum(jpeg_info.colormap[2][i]); - } - if (image->colorspace == CMYKColorspace) - { - /* - Correct CMYK levels. - */ - for (y=0; y < (long) image->rows; y++) - { - q=GetAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - indexes=GetAuthenticIndexQueue(image); - for (x=0; x < (long) image->columns; x++) - { - q->red=(Quantum) (QuantumRange-q->red); - q->green=(Quantum) (QuantumRange-q->green); - q->blue=(Quantum) (QuantumRange-q->blue); - indexes[x]=(IndexPacket) (QuantumRange-indexes[x]); - q++; - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - } - } - /* - Consume Buffer. - */ - chunk_size=(unsigned long) ((SourceManager *) - jpeg_info.src)->source_length; - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - /* - Free jpeg resources. - */ - (void) jpeg_finish_decompress(&jpeg_info); - jpeg_pixels=(unsigned char *) RelinquishMagickMemory(jpeg_pixels); -#else - (void) CloseBlob(image); - DestroyImageList(image); - return(DecodeAVIImage(image_info,exception)); -#endif - } - /* - Read BMP image - */ - else - { - /* - Initialize image structure. - */ - image->columns=avi_info.width; - image->rows=avi_info.height; - image->depth=8; - image->units=PixelsPerCentimeterResolution; - image->x_resolution=(double) bmp_info.x_pixels/100.0; - image->y_resolution=(double) bmp_info.y_pixels/100.0; - status=AcquireImageColormap(image,number_colors != 0 ? number_colors : - 256); - if (status == MagickFalse) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - if (number_colors != 0) - (void) CopyMagickMemory(image->colormap,colormap,(size_t) - number_colors*sizeof(PixelPacket)); - if ((image_info->ping != MagickFalse) && - (image_info->number_scenes != 0)) - if (image->scene >= (image_info->scene+image_info->number_scenes-1)) - break; - bytes_per_line=4*((image->columns*bmp_info.bits_per_pixel+31)/32); - pixels=(unsigned char *) AcquireQuantumMemory((size_t) image->rows, - MagickMax(bytes_per_line,image->columns+256UL)*sizeof(*pixels)); - if (pixels == (unsigned char *) NULL) - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); - (void) ResetMagickMemory(pixels,0,(size_t) MagickMax( - bytes_per_line,image->columns+1)*image->rows); - if (LocaleCompare(id,"00db") == 0) - { - count=ReadBlob(image,(size_t) bytes_per_line*image->rows,pixels); - if (count != (ssize_t) (bytes_per_line*image->rows)) - ThrowReaderException(CorruptImageError, - "InsufficientImageDataInFile"); - } - else - { - status=DecodeImage(image,MagickTrue,pixels); - if (status == MagickFalse) - ThrowReaderException(CorruptImageError, - "UnableToRunlengthDecodeImage"); - } - /* - Convert BMP raster image to pixel packets. - */ - switch ((int) bmp_info.bits_per_pixel) - { - case 1: - { - /* - Convert bitmap scanline. - */ - for (y=(long) image->rows-1; y >= 0; y--) - { - p=pixels+(image->rows-y-1)*bytes_per_line; - q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - indexes=GetAuthenticIndexQueue(image); - for (x=0; x < ((long) image->columns-7); x+=8) - { - for (bit=0; bit < 8; bit++) - { - index=(IndexPacket) - (((*p) & (0x80 >> bit)) != 0 ? 0x01 : 0x00); - indexes[x+bit]=index; - *q++=image->colormap[(long) index]; - } - p++; - } - if ((image->columns % 8) != 0) - { - for (bit=0; bit < (image->columns % 8); bit++) - { - index=(IndexPacket) - (((*p) & (0x80 >> bit)) != 0 ? 0x01 : 0x00); - indexes[x+bit]=index; - *q++=image->colormap[(long) index]; - } - p++; - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - offset=(MagickOffsetType) image->rows-y-1; - if (image->previous == (Image *) NULL) - { - status=SetImageProgress(image,LoadImageTag,y,image->rows); - if (status == MagickFalse) - break; - } - } - break; - } - case 4: - { - /* - Convert PseudoColor scanline. - */ - for (y=(long) image->rows-1; y >= 0; y--) - { - p=pixels+(image->rows-y-1)*bytes_per_line; - q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - indexes=GetAuthenticIndexQueue(image); - for (x=0; x < ((long) image->columns-1); x+=2) - { - index=ConstrainColormapIndex(image,((*p >> 4) & 0xf)); - indexes[x]=index; - *q++=image->colormap[(long) index]; - index=ConstrainColormapIndex(image,(*p & 0xf)); - indexes[x+1]=index; - *q++=image->colormap[(long) index]; - p++; - } - if ((image->columns % 2) != 0) - { - index=ConstrainColormapIndex(image,((*p >> 4) & 0xf)); - indexes[x]=index; - *q++=image->colormap[(long) index]; - p++; - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - offset=(MagickOffsetType) image->rows-y-1; - if (image->previous == (Image *) NULL) - { - status=SetImageProgress(image,LoadImageTag,y,image->rows); - if (status == MagickFalse) - break; - } - } - break; - } - case 8: - { - /* - Convert PseudoColor scanline. - */ - bytes_per_line=image->columns; - for (y=(long) image->rows-1; y >= 0; y--) - { - p=pixels+(image->rows-y-1)*bytes_per_line; - q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - indexes=GetAuthenticIndexQueue(image); - for (x=0; x < (long) image->columns; x++) - { - index=ConstrainColormapIndex(image,*p); - indexes[x]=index; - *q=image->colormap[(long) index]; - p++; - q++; - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - offset=(MagickOffsetType) image->rows-y-1; - if (image->previous == (Image *) NULL) - { - status=SetImageProgress(image,LoadImageTag,y,image->rows); - if (status == MagickFalse) - break; - } - } - break; - } - case 16: - { - unsigned long - word; - - /* - Convert PseudoColor scanline. - */ - bytes_per_line=image->columns << 1; - image->storage_class=DirectClass; - for (y=(long) image->rows-1; y >= 0; y--) - { - p=pixels+(image->rows-y-1)*bytes_per_line; - q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - for (x=0; x < (long) image->columns; x++) - { - word=(unsigned long) (*p++); - word|=(*p++ << 8); - q->red=ScaleCharToQuantum(ScaleColor5to8((word >> 11) & - 0x1f)); - q->green=ScaleCharToQuantum(ScaleColor6to8((word >> 5) & - 0x3f)); - q->blue=ScaleCharToQuantum(ScaleColor5to8(word & 0x1f)); - q++; - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - offset=(MagickOffsetType) image->rows-y-1; - if (image->previous == (Image *) NULL) - { - status=SetImageProgress(image,LoadImageTag,y,image->rows); - if (status == MagickFalse) - break; - } - } - break; - } - case 24: - case 32: - { - /* - Convert DirectColor scanline. - */ - image->storage_class=DirectClass; - for (y=(long) image->rows-1; y >= 0; y--) - { - p=pixels+(image->rows-y-1)*bytes_per_line; - q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); - if (q == (PixelPacket *) NULL) - break; - for (x=0; x < (long) image->columns; x++) - { - q->blue=ScaleCharToQuantum(*p++); - q->green=ScaleCharToQuantum(*p++); - q->red=ScaleCharToQuantum(*p++); - if (image->matte != MagickFalse) - q->opacity=ScaleCharToQuantum(*p++); - q++; - } - if (SyncAuthenticPixels(image,exception) == MagickFalse) - break; - offset=(MagickOffsetType) image->rows-y-1; - if (image->previous == (Image *) NULL) - { - status=SetImageProgress(image,LoadImageTag,y,image->rows); - if (status == MagickFalse) - break; - } - } - break; - } - default: - ThrowReaderException(CorruptImageError,"ImproperImageHeader"); - } - pixels=(unsigned char *) RelinquishMagickMemory(pixels); - } - - /* - Setup for next image - */ - - if ((unsigned long) image->scene < (avi_info.total_frames-1)) - { - /* - Allocate next image structure. - */ - AcquireNextImage(image_info,image); - if (GetNextImageInList(image) == (Image *) NULL) - { - image=DestroyImageList(image); - return((Image *) NULL); - } - image=SyncNextImageInList(image); - status=SetImageProgress(image,LoadImagesTag,TellBlob(image), - GetBlobSize(image)); - if (status == MagickFalse) - break; - } - continue; - } - if (LocaleCompare(id,"avih") == 0) - { - /* - AVI header. - */ - if (image_info->verbose != MagickFalse) - (void) fprintf(stdout," AVI header\n"); - avi_info.delay=ReadBlobLSBLong(image); - avi_info.max_data_rate=ReadBlobLSBLong(image); - avi_info.pad_granularity=ReadBlobLSBLong(image); - avi_info.flags=ReadBlobLSBLong(image); - avi_info.total_frames=ReadBlobLSBLong(image); - avi_info.initial_frames=ReadBlobLSBLong(image); - avi_info.number_streams=ReadBlobLSBLong(image); - avi_info.buffer_size=ReadBlobLSBLong(image); - avi_info.width=ReadBlobLSBLong(image); - avi_info.height=ReadBlobLSBLong(image); - avi_info.time_scale=ReadBlobLSBLong(image); - avi_info.data_rate=ReadBlobLSBLong(image); - avi_info.start_time=ReadBlobLSBLong(image); - avi_info.data_length=ReadBlobLSBLong(image); - continue; - } - if (LocaleCompare(id,"idx1") == 0) - { - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - continue; - } - if (LocaleCompare(id,"JUNK") == 0) - { - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - continue; - } - if (LocaleCompare(id,"LIST") == 0) - { - /* - List of chunks. - */ - count=ReadBlob(image,4,(unsigned char *) id); - if (image_info->verbose != MagickFalse) - (void) fprintf(stdout," List type %s\n",id); - continue; - } - if (LocaleCompare(id,"RIFF") == 0) - { - /* - File header. - */ - count=ReadBlob(image,4,(unsigned char *) id); - if (image_info->verbose != MagickFalse) - (void) fprintf(stdout," RIFF form type %s\n",id); - continue; - } - if (LocaleCompare(id,"strf") == 0) - { - /* - Stream format. - */ - if (image_info->verbose != MagickFalse) - (void) fprintf(stdout," Stream fcc\n"); - if (LocaleCompare(stream_info.data_type,"vids") == 0) - { - bmp_info.size=ReadBlobLSBLong(image); - bmp_info.width=ReadBlobLSBLong(image); - bmp_info.height=ReadBlobLSBLong(image); - bmp_info.planes=ReadBlobLSBShort(image); - bmp_info.bits_per_pixel=ReadBlobLSBShort(image); - count=ReadBlob(image,4,(unsigned char *) bmp_info.compression); - bmp_info.compression[4]='\0'; - bmp_info.image_size=ReadBlobLSBLong(image); - bmp_info.x_pixels=ReadBlobLSBLong(image); - bmp_info.y_pixels=ReadBlobLSBLong(image); - bmp_info.number_colors=ReadBlobLSBLong(image); - bmp_info.important_colors=ReadBlobLSBLong(image); - chunk_size-=40; - number_colors=bmp_info.number_colors; - if ((number_colors == 0) && (bmp_info.bits_per_pixel <= 8)) - number_colors=1 << bmp_info.bits_per_pixel; - if (number_colors != 0) - { - colormap=(PixelPacket *) AcquireQuantumMemory((size_t) - number_colors,sizeof(*colormap)); - if (colormap == (PixelPacket *) NULL) - ThrowReaderException(ResourceLimitError, - "MemoryAllocationFailed"); - for (i=0; i < (long) number_colors; i++) - { - colormap[i].blue=ScaleCharToQuantum((unsigned char) - ReadBlobByte(image)); - colormap[i].green=ScaleCharToQuantum((unsigned char) - ReadBlobByte(image)); - colormap[i].red=ScaleCharToQuantum((unsigned char) - ReadBlobByte(image)); - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError, - "UnexpectedEndOfFile"); - chunk_size-=4; - } - } - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - if (image_info->verbose != MagickFalse) - (void) fprintf(stdout,"Video compression: %s\n", - bmp_info.compression); - continue; - } - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - continue; - } - if (LocaleCompare(id,"strh") == 0) - { - if (image_info->verbose != MagickFalse) - (void) fprintf(stdout," Stream header\n"); - count=ReadBlob(image,4,(unsigned char *) stream_info.data_type); - stream_info.data_type[4]='\0'; - count=ReadBlob(image,4,(unsigned char *) stream_info.data_handler); - stream_info.data_handler[4]='\0'; - stream_info.flags=ReadBlobLSBLong(image); - stream_info.priority=ReadBlobLSBLong(image); - stream_info.initial_frames=ReadBlobLSBLong(image); - stream_info.time_scale=ReadBlobLSBLong(image); - stream_info.data_rate=ReadBlobLSBLong(image); - stream_info.start_time=ReadBlobLSBLong(image); - stream_info.data_length=ReadBlobLSBLong(image); - stream_info.buffer_size=ReadBlobLSBLong(image); - stream_info.quality=ReadBlobLSBLong(image); - stream_info.sample_size=ReadBlobLSBLong(image); - if ((chunk_size & 0x01) != 0) - chunk_size++; - for (chunk_size-=48; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - if (image_info->verbose != MagickFalse) - (void) fprintf(stdout,"AVI Test handler: %s\n", - stream_info.data_handler); - continue; - } - if (LocaleCompare(id,"strn") == 0) - { - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - continue; - } - if (LocaleCompare(id,"vedt") == 0) - { - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - continue; - } - if (strlen(id) == 4 && LocaleCompare(id + 2,"wb") == 0) - { - /* - Skip audio chunks (##wb). - */ - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - continue; - } - if (LocaleCompare(id,"ISFT") == 0) - { - /* - Skip Info Chunks. - */ - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - continue; - } - if (LocaleCompare(id,"IDIT") == 0) - { - /* - Skip Timecode Information (TODO: seeking). - */ - for ( ; chunk_size != 0; chunk_size--) - if (ReadBlobByte(image) == EOF) - ThrowReaderException(CorruptImageError,"UnexpectedEndOfFile"); - continue; - } - (void) CloseBlob(image); - DestroyImageList(image); - return(DecodeAVIImage(image_info,exception)); - } - (void) CloseBlob(image); - if ((image->columns == 0) || (image->rows == 0)) - { - image=DestroyImageList(image); - return((Image *) NULL); - } - return(GetFirstImageInList(image)); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% R e g i s t e r A V I I m a g e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% RegisterAVIImage() adds properties for the AVI image format to -% the list of supported formats. The properties include the image format -% tag, a method to read and/or write the format, whether the format -% supports the saving of more than one frame to the same file or blob, -% whether the format supports native in-memory I/O, and a brief -% description of the format. -% -% The format of the RegisterAVIImage method is: -% -% unsigned long RegisterAVIImage(void) -% -*/ -ModuleExport unsigned long RegisterAVIImage(void) -{ - MagickInfo - *entry; - - entry=SetMagickInfo("AVI"); - entry->decoder=(DecodeImageHandler *) ReadAVIImage; - entry->magick=(IsImageFormatHandler *) IsAVI; - entry->description=ConstantString("Microsoft Audio/Visual Interleaved"); - entry->module=ConstantString("AVI"); - (void) RegisterMagickInfo(entry); - return(MagickImageCoderSignature); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -% U n r e g i s t e r A V I I m a g e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% UnregisterAVIImage() removes format registrations made by the -% AVI module from the list of supported formats. -% -% The format of the UnregisterAVIImage method is: -% -% UnregisterAVIImage(void) -% -*/ -ModuleExport void UnregisterAVIImage(void) -{ - (void) UnregisterMagickInfo("AVI"); -} diff --git a/coders/mpeg.c b/coders/mpeg.c index 2e9d88a0d..780a3e10b 100644 --- a/coders/mpeg.c +++ b/coders/mpeg.c @@ -205,6 +205,12 @@ ModuleExport unsigned long RegisterMPEGImage(void) MagickInfo *entry; + entry=SetMagickInfo("AVI"); + entry->decoder=(DecodeImageHandler *) ReadAVIImage; + entry->magick=(IsImageFormatHandler *) IsAVI; + entry->description=ConstantString("Microsoft Audio/Visual Interleaved"); + entry->module=ConstantString("AVI"); + (void) RegisterMagickInfo(entry); entry=SetMagickInfo("MOV"); entry->decoder=(DecodeImageHandler *) ReadMPEGImage; entry->encoder=(EncodeImageHandler *) WriteMPEGImage; @@ -292,6 +298,7 @@ ModuleExport void UnregisterMPEGImage(void) (void) UnregisterMagickInfo("MPG"); (void) UnregisterMagickInfo("MPEG"); (void) UnregisterMagickInfo("MOV"); + (void) UnregisterMagickInfo("AVI"); } /* diff --git a/magick/cache.c b/magick/cache.c index cd209e070..9618e1d91 100644 --- a/magick/cache.c +++ b/magick/cache.c @@ -268,6 +268,59 @@ MagickExport NexusInfo **AcquirePixelCacheNexus( % % % % % % ++ C a c h e C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% CacheComponentGenesis() instantiates the cache component. +% +% The format of the CacheComponentGenesis method is: +% +% MagickBooleanType CacheComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType CacheComponentGenesis(void) +{ + AcquireSemaphoreInfo(&cache_semaphore); + RelinquishSemaphoreInfo(cache_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ C a c h e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% CacheComponentTerminus() destroys the cache component. +% +% The format of the CacheComponentTerminus() method is: +% +% CacheComponentTerminus(void) +% +*/ +MagickExport void CacheComponentTerminus(void) +{ + AcquireSemaphoreInfo(&cache_semaphore); + if (cache_resources != (SplayTreeInfo *) NULL) + cache_resources=DestroySplayTree(cache_resources); + instantiate_cache=MagickFalse; + RelinquishSemaphoreInfo(cache_semaphore); + DestroySemaphoreInfo(&cache_semaphore); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % + C l i p P i x e l C a c h e N e x u s % % % % % @@ -1337,34 +1390,6 @@ MagickExport void ClonePixelCacheMethods(Cache clone,const Cache cache) % % % % % % -+ D e s t r o y C a c h e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyCacheFaclity() destroys the cache component. -% -% The format of the DestroyCacheFaclity() method is: -% -% DestroyCacheFaclity(void) -% -*/ -MagickExport void DestroyCacheFaclity(void) -{ - AcquireSemaphoreInfo(&cache_semaphore); - if (cache_resources != (SplayTreeInfo *) NULL) - cache_resources=DestroySplayTree(cache_resources); - instantiate_cache=MagickFalse; - RelinquishSemaphoreInfo(cache_semaphore); - DestroySemaphoreInfo(&cache_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + D e s t r o y I m a g e P i x e l C a c h e % % % % % @@ -3674,31 +3699,6 @@ MagickExport const PixelPacket *GetVirtualPixelsNexus(const Cache cache, % % % % % % -+ I n s t a n t i a t e C a c h e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateCacheComponent() instantiates the cache component. -% -% The format of the InstantiateCacheComponent method is: -% -% MagickBooleanType InstantiateCacheComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateCacheComponent(void) -{ - AcquireSemaphoreInfo(&cache_semaphore); - RelinquishSemaphoreInfo(cache_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + M a s k P i x e l C a c h e N e x u s % % % % % diff --git a/magick/cache.h b/magick/cache.h index d9c8a9c6e..32ca17dfc 100644 --- a/magick/cache.h +++ b/magick/cache.h @@ -36,6 +36,7 @@ extern MagickExport IndexPacket *GetAuthenticIndexQueue(const Image *); extern MagickExport MagickBooleanType + CacheComponentGenesis(void), GetOneVirtualMagickPixel(const Image *,const long,const long, MagickPixelPacket *,ExceptionInfo *), GetOneVirtualPixel(const Image *,const long,const long,PixelPacket *, @@ -44,7 +45,6 @@ extern MagickExport MagickBooleanType const long,PixelPacket *,ExceptionInfo *), GetOneAuthenticPixel(Image *,const long,const long,PixelPacket *, ExceptionInfo *), - InstantiateCacheComponent(void), PersistPixelCache(Image *,const char *,const MagickBooleanType, MagickOffsetType *,ExceptionInfo *), SyncAuthenticPixels(Image *,ExceptionInfo *); @@ -64,7 +64,7 @@ extern MagickExport VirtualPixelMethod SetPixelCacheVirtualMethod(const Image *,const VirtualPixelMethod); extern MagickExport void - DestroyCacheFaclity(void); + CacheComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/coder.c b/magick/coder.c index 6b065855d..e6c86754b 100644 --- a/magick/coder.c +++ b/magick/coder.c @@ -240,20 +240,45 @@ static MagickBooleanType % % % % % % -+ D e s t r o y C o d e r C o m p o n e n t % ++ C o d e r C o m p o n e n t G e n e s i s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% DestroyCoderComponent() destroys the coder component. +% CoderComponentGenesis() instantiates the coder component. % -% The format of the DestroyCoderComponent method is: +% The format of the CoderComponentGenesis method is: % -% DestroyCoderComponent(void) +% MagickBooleanType CoderComponentGenesis(void) % */ -MagickExport void DestroyCoderComponent(void) +MagickExport MagickBooleanType CoderComponentGenesis(void) +{ + AcquireSemaphoreInfo(&coder_semaphore); + RelinquishSemaphoreInfo(coder_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ C o d e r C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% CoderComponentTerminus() destroys the coder component. +% +% The format of the CoderComponentTerminus method is: +% +% CoderComponentTerminus(void) +% +*/ +MagickExport void CoderComponentTerminus(void) { AcquireSemaphoreInfo(&coder_semaphore); if (coder_list != (SplayTreeInfo *) NULL) @@ -522,31 +547,6 @@ static MagickBooleanType InitializeCoderList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e C o d e r C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateCoderComponent() instantiates the coder component. -% -% The format of the InstantiateCoderComponent method is: -% -% MagickBooleanType InstantiateCoderComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateCoderComponent(void) -{ - AcquireSemaphoreInfo(&coder_semaphore); - RelinquishSemaphoreInfo(coder_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % L i s t C o d e r I n f o % % % % % diff --git a/magick/coder.h b/magick/coder.h index 71cf00883..75792bbd2 100644 --- a/magick/coder.h +++ b/magick/coder.h @@ -49,11 +49,11 @@ extern MagickExport const CoderInfo **GetCoderInfoList(const char *,unsigned long *,ExceptionInfo *); extern MagickExport MagickBooleanType - InstantiateCoderComponent(void), + CoderComponentGenesis(void), ListCoderInfo(FILE *,ExceptionInfo *); MagickExport void - DestroyCoderComponent(void); + CoderComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/color.c b/magick/color.c index 46476c729..4b1f81142 100644 --- a/magick/color.c +++ b/magick/color.c @@ -801,108 +801,24 @@ static MagickBooleanType % % % % % % -+ C o n c a t e n a t e C o l o r C o m p o n e n t % ++ C o l o r C o m p o n e n t G e n e s i s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% ConcatenateColorComponent() returns the pixel as a canonical string. -% -% The format of the ConcatenateColorComponent() method is: -% -% void ConcatenateColorComponent(const MagickPixelPacket *pixel, -% const ChannelType channel,const ComplianceType compliance,char *tuple) -% -% A description of each parameter follows. -% -% o pixel: The pixel. +% ColorComponentGenesis() instantiates the color component. % -% channel: The channel. -% -% o compliance: Adhere to this color standard: SVG, X11, or XPM. +% The format of the ColorComponentGenesis method is: % -% tuple: The color tuple. +% MagickBooleanType ColorComponentGenesis(void) % */ -MagickExport void ConcatenateColorComponent(const MagickPixelPacket *pixel, - const ChannelType channel,const ComplianceType compliance,char *tuple) +MagickExport MagickBooleanType ColorComponentGenesis(void) { - char - component[MaxTextExtent]; - - MagickRealType - color; - - color=0.0; - switch (channel) - { - case RedChannel: - { - color=pixel->red; - break; - } - case GreenChannel: - { - color=pixel->green; - break; - } - case BlueChannel: - { - color=pixel->blue; - break; - } - case AlphaChannel: - { - color=QuantumRange-pixel->opacity; - break; - } - case IndexChannel: - { - color=pixel->index; - break; - } - default: - break; - } - if (compliance != SVGCompliance) - { - if (pixel->depth > 16) - { - (void) FormatMagickString(component,MaxTextExtent,"%10lu", - (unsigned long) ScaleQuantumToLong(RoundToQuantum(color))); - (void) ConcatenateMagickString(tuple,component,MaxTextExtent); - return; - } - if (pixel->depth > 8) - { - (void) FormatMagickString(component,MaxTextExtent,"%5d", - ScaleQuantumToShort(RoundToQuantum(color))); - (void) ConcatenateMagickString(tuple,component,MaxTextExtent); - return; - } - (void) FormatMagickString(component,MaxTextExtent,"%3d", - ScaleQuantumToChar(RoundToQuantum(color))); - (void) ConcatenateMagickString(tuple,component,MaxTextExtent); - return; - } - if (channel == OpacityChannel) - { - (void) FormatMagickString(component,MaxTextExtent,"%g", - (double) (QuantumScale*color)); - (void) ConcatenateMagickString(tuple,component,MaxTextExtent); - return; - } - if (pixel->depth > 8) - { - (void) FormatMagickString(component,MaxTextExtent,"%g%%", - (double) (100.0*QuantumScale*color)); - (void) ConcatenateMagickString(tuple,component,MaxTextExtent); - return; - } - (void) FormatMagickString(component,MaxTextExtent,"%d", - ScaleQuantumToChar(RoundToQuantum(color))); - (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + AcquireSemaphoreInfo(&color_semaphore); + RelinquishSemaphoreInfo(color_semaphore); + return(MagickTrue); } /* @@ -910,17 +826,17 @@ MagickExport void ConcatenateColorComponent(const MagickPixelPacket *pixel, % % % % % % -+ D e s t r o y C o l o r C o m p o n e n t % ++ C o l o r C o m p o n e n t T e r m i n u s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% DestroyColorComponent() destroys the color component. +% ColorComponentTerminus() destroys the color component. % -% The format of the DestroyColorComponent method is: +% The format of the ColorComponentTerminus method is: % -% DestroyColorComponent(void) +% ColorComponentTerminus(void) % */ @@ -941,7 +857,7 @@ static void *DestroyColorElement(void *color_info) return((void *) NULL); } -MagickExport void DestroyColorComponent(void) +MagickExport void ColorComponentTerminus(void) { AcquireSemaphoreInfo(&color_semaphore); if (color_list != (LinkedListInfo *) NULL) @@ -1040,6 +956,115 @@ MagickExport const ColorInfo *GetColorInfo(const char *name, % % % % % % ++ C o n c a t e n a t e C o l o r C o m p o n e n t % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ConcatenateColorComponent() returns the pixel as a canonical string. +% +% The format of the ConcatenateColorComponent() method is: +% +% void ConcatenateColorComponent(const MagickPixelPacket *pixel, +% const ChannelType channel,const ComplianceType compliance,char *tuple) +% +% A description of each parameter follows. +% +% o pixel: The pixel. +% +% channel: The channel. +% +% o compliance: Adhere to this color standard: SVG, X11, or XPM. +% +% tuple: The color tuple. +% +*/ +MagickExport void ConcatenateColorComponent(const MagickPixelPacket *pixel, + const ChannelType channel,const ComplianceType compliance,char *tuple) +{ + char + component[MaxTextExtent]; + + MagickRealType + color; + + color=0.0; + switch (channel) + { + case RedChannel: + { + color=pixel->red; + break; + } + case GreenChannel: + { + color=pixel->green; + break; + } + case BlueChannel: + { + color=pixel->blue; + break; + } + case AlphaChannel: + { + color=QuantumRange-pixel->opacity; + break; + } + case IndexChannel: + { + color=pixel->index; + break; + } + default: + break; + } + if (compliance != SVGCompliance) + { + if (pixel->depth > 16) + { + (void) FormatMagickString(component,MaxTextExtent,"%10lu", + (unsigned long) ScaleQuantumToLong(RoundToQuantum(color))); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + return; + } + if (pixel->depth > 8) + { + (void) FormatMagickString(component,MaxTextExtent,"%5d", + ScaleQuantumToShort(RoundToQuantum(color))); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + return; + } + (void) FormatMagickString(component,MaxTextExtent,"%3d", + ScaleQuantumToChar(RoundToQuantum(color))); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + return; + } + if (channel == OpacityChannel) + { + (void) FormatMagickString(component,MaxTextExtent,"%g", + (double) (QuantumScale*color)); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + return; + } + if (pixel->depth > 8) + { + (void) FormatMagickString(component,MaxTextExtent,"%g%%", + (double) (100.0*QuantumScale*color)); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); + return; + } + (void) FormatMagickString(component,MaxTextExtent,"%d", + ScaleQuantumToChar(RoundToQuantum(color))); + (void) ConcatenateMagickString(tuple,component,MaxTextExtent); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % G e t C o l o r I n f o L i s t % % % % % @@ -1438,31 +1463,6 @@ static MagickBooleanType InitializeColorList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e C o l o r C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateColorComponent() instantiates the color component. -% -% The format of the InstantiateColorComponent method is: -% -% MagickBooleanType InstantiateColorComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateColorComponent(void) -{ - AcquireSemaphoreInfo(&color_semaphore); - RelinquishSemaphoreInfo(color_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + I s C o l o r S i m i l a r % % % % % diff --git a/magick/color.h b/magick/color.h index a501ffa27..cb54a3eeb 100644 --- a/magick/color.h +++ b/magick/color.h @@ -75,7 +75,7 @@ extern MagickExport const ColorInfo **GetColorInfoList(const char *,unsigned long *,ExceptionInfo *); extern MagickExport MagickBooleanType - InstantiateColorComponent(void), + ColorComponentGenesis(void), IsColorSimilar(const Image *,const PixelPacket *,const PixelPacket *), IsGrayImage(const Image *,ExceptionInfo *), IsImageSimilar(const Image *,const Image *,long *x,long *y,ExceptionInfo *), @@ -92,9 +92,9 @@ extern MagickExport MagickBooleanType const ComplianceType,char *,ExceptionInfo *); extern MagickExport void + ColorComponentTerminus(void), ConcatenateColorComponent(const MagickPixelPacket *,const ChannelType, const ComplianceType,char *), - DestroyColorComponent(void), GetColorTuple(const MagickPixelPacket *,const MagickBooleanType,char *); #if defined(__cplusplus) || defined(c_plusplus) diff --git a/magick/configure.c b/magick/configure.c index e9ba21d46..5dee531cb 100644 --- a/magick/configure.c +++ b/magick/configure.c @@ -99,17 +99,42 @@ static MagickBooleanType % % % % % % -+ D e s t r o y C o n f i g u r e C o m p o n e n t % ++ C o n f i g u r e C o m p o n e n t G e n e s i s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% DestroyConfigureComponent() destroys the configure component. +% ConfigureComponentGenesis() instantiates the configure component. % -% The format of the DestroyConfigureComponent method is: +% The format of the ConfigureComponentGenesis method is: % -% DestroyConfigureComponent(void) +% MagickBooleanType ConfigureComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType ConfigureComponentGenesis(void) +{ + AcquireSemaphoreInfo(&configure_semaphore); + RelinquishSemaphoreInfo(configure_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ C o n f i g u r e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ConfigureComponentTerminus() destroys the configure component. +% +% The format of the ConfigureComponentTerminus method is: +% +% ConfigureComponentTerminus(void) % */ @@ -132,7 +157,7 @@ static void *DestroyConfigureElement(void *configure_info) return((void *) NULL); } -MagickExport void DestroyConfigureComponent(void) +MagickExport void ConfigureComponentTerminus(void) { AcquireSemaphoreInfo(&configure_semaphore); if (configure_list != (LinkedListInfo *) NULL) @@ -860,31 +885,6 @@ static MagickBooleanType InitializeConfigureList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e C o n f i g u r e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateConfigureComponent() instantiates the configure component. -% -% The format of the InstantiateConfigureComponent method is: -% -% MagickBooleanType InstantiateConfigureComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateConfigureComponent(void) -{ - AcquireSemaphoreInfo(&configure_semaphore); - RelinquishSemaphoreInfo(configure_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % L i s t C o n f i g u r e I n f o % % % % % diff --git a/magick/configure.h b/magick/configure.h index 058a39eba..259ce3795 100644 --- a/magick/configure.h +++ b/magick/configure.h @@ -60,11 +60,11 @@ extern MagickExport LinkedListInfo *GetConfigureOptions(const char *,ExceptionInfo *); extern MagickExport MagickBooleanType - InstantiateConfigureComponent(void), + ConfigureComponentGenesis(void), ListConfigureInfo(FILE *,ExceptionInfo *); extern MagickExport void - DestroyConfigureComponent(void); + ConfigureComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/constitute.c b/magick/constitute.c index 44e83a39b..96283b403 100644 --- a/magick/constitute.c +++ b/magick/constitute.c @@ -79,6 +79,55 @@ static SemaphoreInfo % % % % % % ++ C o n s t i t u t e C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ConstituteComponentGenesis() instantiates the constitute component. +% +% The format of the ConstituteComponentGenesis method is: +% +% MagickBooleanType ConstituteComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType ConstituteComponentGenesis(void) +{ + AcquireSemaphoreInfo(&constitute_semaphore); + RelinquishSemaphoreInfo(constitute_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ C o n s t i t u t e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ConstituteComponentTerminus() destroys the constitute component. +% +% The format of the ConstituteComponentTerminus method is: +% +% ConstituteComponentTerminus(void) +% +*/ +MagickExport void ConstituteComponentTerminus(void) +{ + if (constitute_semaphore != (SemaphoreInfo *) NULL) + DestroySemaphoreInfo(&constitute_semaphore); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % C o n s t i t u t e I m a g e % % % % % @@ -163,55 +212,6 @@ MagickExport Image *ConstituteImage(const unsigned long columns, % % % % % % -+ D e s t r o y C o n s t i t u t e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyConstituteComponent() destroys the constitute component. -% -% The format of the DestroyConstituteComponent method is: -% -% DestroyConstituteComponent(void) -% -*/ -MagickExport void DestroyConstituteComponent(void) -{ - if (constitute_semaphore != (SemaphoreInfo *) NULL) - DestroySemaphoreInfo(&constitute_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % -+ I n s t a n t i a t e C o n s t i t u t e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateConstituteComponent() instantiates the constitute component. -% -% The format of the InstantiateConstituteComponent method is: -% -% MagickBooleanType InstantiateConstituteComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateConstituteComponent(void) -{ - AcquireSemaphoreInfo(&constitute_semaphore); - RelinquishSemaphoreInfo(constitute_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % P i n g I m a g e % % % % % diff --git a/magick/constitute.h b/magick/constitute.h index 9118ea562..9755ca9d7 100644 --- a/magick/constitute.h +++ b/magick/constitute.h @@ -44,12 +44,12 @@ extern MagickExport Image *ReadInlineImage(const ImageInfo *,const char *,ExceptionInfo *); extern MagickExport MagickBooleanType - InstantiateConstituteComponent(void), + ConstituteComponentGenesis(void), WriteImage(const ImageInfo *,Image *), WriteImages(const ImageInfo *,Image *,const char *,ExceptionInfo *); extern MagickExport void - DestroyConstituteComponent(void); + ConstituteComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/delegate.c b/magick/delegate.c index f12b50a98..822881a04 100644 --- a/magick/delegate.c +++ b/magick/delegate.c @@ -149,17 +149,42 @@ static MagickBooleanType % % % % % % -% D e s t r o y D e l e g a t e C o m p o n e n t % ++ D e l e g a t e C o m p o n e n t T e r m i n u s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% DestroyDelegateComponent() destroys the delegate component. +% DelegateComponentGenesis() instantiates the delegate component. % -% The format of the DestroyDelegateComponent method is: +% The format of the DelegateComponentGenesis method is: % -% DestroyDelegateComponent(void) +% MagickBooleanType DelegateComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType DelegateComponentGenesis(void) +{ + AcquireSemaphoreInfo(&delegate_semaphore); + RelinquishSemaphoreInfo(delegate_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% D e l e g a t e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% DelegateComponentTerminus() destroys the delegate component. +% +% The format of the DelegateComponentTerminus method is: +% +% DelegateComponentTerminus(void) % */ @@ -182,7 +207,7 @@ static void *DestroyDelegate(void *delegate_info) } -MagickExport void DestroyDelegateComponent(void) +MagickExport void DelegateComponentTerminus(void) { AcquireSemaphoreInfo(&delegate_semaphore); if (delegate_list != (LinkedListInfo *) NULL) @@ -698,31 +723,6 @@ static MagickBooleanType InitializeDelegateList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e D e l e g a t e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateDelegateComponent() instantiates the delegate component. -% -% The format of the InstantiateDelegateComponent method is: -% -% MagickBooleanType InstantiateDelegateComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateDelegateComponent(void) -{ - AcquireSemaphoreInfo(&delegate_semaphore); - RelinquishSemaphoreInfo(delegate_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % I n v o k e D e l e g a t e % % % % % diff --git a/magick/delegate.h b/magick/delegate.h index cc6840124..67e4f89e2 100644 --- a/magick/delegate.h +++ b/magick/delegate.h @@ -62,13 +62,13 @@ extern MagickExport long GetDelegateMode(const DelegateInfo *); extern MagickExport MagickBooleanType + DelegateComponentGenesis(void), GetDelegateThreadSupport(const DelegateInfo *), - InstantiateDelegateComponent(void), InvokeDelegate(ImageInfo *,Image *,const char *,const char *,ExceptionInfo *), ListDelegateInfo(FILE *,ExceptionInfo *); extern MagickExport void - DestroyDelegateComponent(void); + DelegateComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/deprecate.c b/magick/deprecate.c index 761a447a0..4e29df041 100644 --- a/magick/deprecate.c +++ b/magick/deprecate.c @@ -1383,7 +1383,7 @@ MagickExport MagickBooleanType DeleteMagickRegistry(const long id) */ MagickExport void DestroyMagickRegistry(void) { - DestroyRegistryComponent(); + RegistryComponentTerminus(); } /* diff --git a/magick/locale.c b/magick/locale.c index b89fc2458..5fa0dc297 100644 --- a/magick/locale.c +++ b/magick/locale.c @@ -98,34 +98,6 @@ static MagickBooleanType % % % % % % -+ D e s t r o y L o c a l e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyLocaleComponent() destroys the locale component. -% -% The format of the DestroyLocaleComponent method is: -% -% DestroyLocaleComponent(void) -% -*/ -MagickExport void DestroyLocaleComponent(void) -{ - AcquireSemaphoreInfo(&locale_semaphore); - if (locale_list != (SplayTreeInfo *) NULL) - locale_list=DestroySplayTree(locale_list); - instantiate_locale=MagickFalse; - RelinquishSemaphoreInfo(locale_semaphore); - DestroySemaphoreInfo(&locale_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % D e s t r o y L o c a l e O p t i o n s % % % % % @@ -617,31 +589,6 @@ static MagickBooleanType InitializeLocaleList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e L o c a l e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateLocaleComponent() instantiates the locale component. -% -% The format of the InstantiateLocaleComponent method is: -% -% MagickBooleanType InstantiateLocaleComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateLocaleComponent(void) -{ - AcquireSemaphoreInfo(&locale_semaphore); - RelinquishSemaphoreInfo(locale_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % L i s t L o c a l e I n f o % % % % % @@ -1080,3 +1027,56 @@ static MagickBooleanType LoadLocaleLists(const char *filename, return(status != 0 ? MagickTrue : MagickFalse); #endif } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ L o c a l e C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% LocaleComponentGenesis() instantiates the locale component. +% +% The format of the LocaleComponentGenesis method is: +% +% MagickBooleanType LocaleComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType LocaleComponentGenesis(void) +{ + AcquireSemaphoreInfo(&locale_semaphore); + RelinquishSemaphoreInfo(locale_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ L o c a l e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% LocaleComponentTerminus() destroys the locale component. +% +% The format of the LocaleComponentTerminus method is: +% +% LocaleComponentTerminus(void) +% +*/ +MagickExport void LocaleComponentTerminus(void) +{ + AcquireSemaphoreInfo(&locale_semaphore); + if (locale_list != (SplayTreeInfo *) NULL) + locale_list=DestroySplayTree(locale_list); + instantiate_locale=MagickFalse; + RelinquishSemaphoreInfo(locale_semaphore); + DestroySemaphoreInfo(&locale_semaphore); +} diff --git a/magick/locale_.h b/magick/locale_.h index de9f4ac2a..07e404fc7 100644 --- a/magick/locale_.h +++ b/magick/locale_.h @@ -57,11 +57,11 @@ extern MagickExport LinkedListInfo *GetLocaleOptions(const char *,ExceptionInfo *); extern MagickExport MagickBooleanType - InstantiateLocaleComponent(void), - ListLocaleInfo(FILE *,ExceptionInfo *); + ListLocaleInfo(FILE *,ExceptionInfo *), + LocaleComponentGenesis(void); extern MagickExport void - DestroyLocaleComponent(void); + LocaleComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/log.c b/magick/log.c index c9a60c244..05429e94e 100644 --- a/magick/log.c +++ b/magick/log.c @@ -241,61 +241,6 @@ MagickExport void CloseMagickLog(void) % % % % % % -+ D e s t r o y L o g C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyLogComponent() destroys the logging component. -% -% The format of the DestroyLogComponent method is: -% -% DestroyLogComponent(void) -% -*/ - -static void *DestroyLogElement(void *log_info) -{ - register LogInfo - *p; - - p=(LogInfo *) log_info; - if (p->file != (FILE *) NULL) - { - if (p->append == MagickFalse) - (void) fprintf(p->file,"\n"); - (void) fclose(p->file); - p->file=(FILE *) NULL; - } - if (p->exempt == MagickFalse) - { - if (p->format != (char *) NULL) - p->format=DestroyString(p->format); - if (p->path != (char *) NULL) - p->path=DestroyString(p->path); - if (p->filename != (char *) NULL) - p->filename=DestroyString(p->filename); - } - p=(LogInfo *) RelinquishMagickMemory(p); - return((void *) NULL); -} - -MagickExport void DestroyLogComponent(void) -{ - AcquireSemaphoreInfo(&log_semaphore); - if (log_list != (LinkedListInfo *) NULL) - log_list=DestroyLinkedList(log_list,DestroyLogElement); - instantiate_log=MagickFalse; - RelinquishSemaphoreInfo(log_semaphore); - DestroySemaphoreInfo(&log_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + G e t L o g I n f o % % % % % @@ -602,31 +547,6 @@ static MagickBooleanType InitializeLogList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e L o g C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateLogComponent() instantiates the log component. -% -% The format of the InstantiateLogComponent method is: -% -% MagickBooleanType InstantiateLogComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateLogComponent(void) -{ - AcquireSemaphoreInfo(&log_semaphore); - RelinquishSemaphoreInfo(log_semaphore); - return(MagickFalse); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % I s E v e n t L o g g i n g % % % % % @@ -747,6 +667,86 @@ MagickExport MagickBooleanType ListLogInfo(FILE *file,ExceptionInfo *exception) % % % % % % ++ L o g C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% LogComponentGenesis() instantiates the log component. +% +% The format of the LogComponentGenesis method is: +% +% MagickBooleanType LogComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType LogComponentGenesis(void) +{ + AcquireSemaphoreInfo(&log_semaphore); + RelinquishSemaphoreInfo(log_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ L o g C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% LogComponentTerminus() destroys the logging component. +% +% The format of the LogComponentTerminus method is: +% +% LogComponentTerminus(void) +% +*/ + +static void *DestroyLogElement(void *log_info) +{ + register LogInfo + *p; + + p=(LogInfo *) log_info; + if (p->file != (FILE *) NULL) + { + if (p->append == MagickFalse) + (void) fprintf(p->file,"\n"); + (void) fclose(p->file); + p->file=(FILE *) NULL; + } + if (p->exempt == MagickFalse) + { + if (p->format != (char *) NULL) + p->format=DestroyString(p->format); + if (p->path != (char *) NULL) + p->path=DestroyString(p->path); + if (p->filename != (char *) NULL) + p->filename=DestroyString(p->filename); + } + p=(LogInfo *) RelinquishMagickMemory(p); + return((void *) NULL); +} + +MagickExport void LogComponentTerminus(void) +{ + AcquireSemaphoreInfo(&log_semaphore); + if (log_list != (LinkedListInfo *) NULL) + log_list=DestroyLinkedList(log_list,DestroyLogElement); + instantiate_log=MagickFalse; + RelinquishSemaphoreInfo(log_semaphore); + DestroySemaphoreInfo(&log_semaphore); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % L o g M a g i c k E v e n t % % % % % diff --git a/magick/log.h b/magick/log.h index fdd8e35ec..831cf5bce 100644 --- a/magick/log.h +++ b/magick/log.h @@ -72,9 +72,9 @@ extern MagickExport LogEventType SetLogEventMask(const char *); extern MagickExport MagickBooleanType - InstantiateLogComponent(void), IsEventLogging(void), ListLogInfo(FILE *,ExceptionInfo *), + LogComponentGenesis(void), LogMagickEvent(const LogEventType,const char *,const char *, const unsigned long,const char *,...) magick_attribute((format (printf,5,6))), @@ -84,7 +84,7 @@ extern MagickExport MagickBooleanType extern MagickExport void CloseMagickLog(void), - DestroyLogComponent(void), + LogComponentTerminus(void), SetLogFormat(const char *); #if defined(__cplusplus) || defined(c_plusplus) diff --git a/magick/magic.c b/magick/magic.c index 0c6b5a646..0ef4c870f 100644 --- a/magick/magic.c +++ b/magick/magic.c @@ -214,56 +214,6 @@ static MagickBooleanType % % % % % % -+ D e s t r o y M a g i c C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyMagicComponent() destroys the magic component. -% -% The format of the DestroyMagicComponent method is: -% -% DestroyMagicComponent(void) -% -*/ - -static void *DestroyMagicElement(void *magic_info) -{ - register MagicInfo - *p; - - p=(MagicInfo *) magic_info; - if (p->exempt == MagickFalse) - { - if (p->path != (char *) NULL) - p->path=DestroyString(p->path); - if (p->name != (char *) NULL) - p->name=DestroyString(p->name); - if (p->target != (char *) NULL) - p->target=DestroyString(p->target); - if (p->magic != (unsigned char *) NULL) - p->magic=(unsigned char *) RelinquishMagickMemory(p->magic); - } - p=(MagicInfo *) RelinquishMagickMemory(p); - return((void *) NULL); -} - -MagickExport void DestroyMagicComponent(void) -{ - AcquireSemaphoreInfo(&magic_semaphore); - if (magic_list != (LinkedListInfo *) NULL) - magic_list=DestroyLinkedList(magic_list,DestroyMagicElement); - instantiate_magic=MagickFalse; - RelinquishSemaphoreInfo(magic_semaphore); - DestroySemaphoreInfo(&magic_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + G e t M a g i c I n f o % % % % % @@ -589,31 +539,6 @@ static MagickBooleanType InitializeMagicList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e M a g i c C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateMagicComponent() instantiates the magic component. -% -% The format of the InstantiateMagicComponent method is: -% -% MagickBooleanType InstantiateMagicComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateMagicComponent(void) -{ - AcquireSemaphoreInfo(&magic_semaphore); - RelinquishSemaphoreInfo(magic_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % L i s t M a g i c I n f o % % % % % @@ -1064,3 +989,78 @@ static MagickBooleanType LoadMagicLists(const char *filename, options=DestroyConfigureOptions(options); return(status != 0 ? MagickTrue : MagickFalse); } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M a g i c C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagicComponentGenesis() instantiates the magic component. +% +% The format of the MagicComponentGenesis method is: +% +% MagickBooleanType MagicComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType MagicComponentGenesis(void) +{ + AcquireSemaphoreInfo(&magic_semaphore); + RelinquishSemaphoreInfo(magic_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M a g i c C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagicComponentTerminus() destroys the magic component. +% +% The format of the MagicComponentTerminus method is: +% +% MagicComponentTerminus(void) +% +*/ + +static void *DestroyMagicElement(void *magic_info) +{ + register MagicInfo + *p; + + p=(MagicInfo *) magic_info; + if (p->exempt == MagickFalse) + { + if (p->path != (char *) NULL) + p->path=DestroyString(p->path); + if (p->name != (char *) NULL) + p->name=DestroyString(p->name); + if (p->target != (char *) NULL) + p->target=DestroyString(p->target); + if (p->magic != (unsigned char *) NULL) + p->magic=(unsigned char *) RelinquishMagickMemory(p->magic); + } + p=(MagicInfo *) RelinquishMagickMemory(p); + return((void *) NULL); +} + +MagickExport void MagicComponentTerminus(void) +{ + AcquireSemaphoreInfo(&magic_semaphore); + if (magic_list != (LinkedListInfo *) NULL) + magic_list=DestroyLinkedList(magic_list,DestroyMagicElement); + instantiate_magic=MagickFalse; + RelinquishSemaphoreInfo(magic_semaphore); + DestroySemaphoreInfo(&magic_semaphore); +} diff --git a/magick/magic.h b/magick/magic.h index 4b86daba2..1a1f7f3e4 100644 --- a/magick/magic.h +++ b/magick/magic.h @@ -57,15 +57,15 @@ extern MagickExport const char *GetMagicName(const MagicInfo *); extern MagickExport MagickBooleanType - InstantiateMagicComponent(void), - ListMagicInfo(FILE *,ExceptionInfo *); + ListMagicInfo(FILE *,ExceptionInfo *), + MagicComponentGenesis(void); extern MagickExport const MagicInfo *GetMagicInfo(const unsigned char *,const size_t,ExceptionInfo *), **GetMagicInfoList(const char *,unsigned long *,ExceptionInfo *); extern MagickExport void - DestroyMagicComponent(void); + MagicComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/magick.c b/magick/magick.c index a23c22772..678330cc5 100644 --- a/magick/magick.c +++ b/magick/magick.c @@ -124,34 +124,6 @@ static MagickBooleanType % % % % % % -+ D e s t r o y M a g i c k C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyMagickComponent() destroys the magick component. -% -% The format of the DestroyMagickComponent method is: -% -% void DestroyMagickComponent(void) -% -*/ -MagickExport void DestroyMagickComponent(void) -{ - AcquireSemaphoreInfo(&magick_semaphore); - if (magick_list != (SplayTreeInfo *) NULL) - magick_list=DestroySplayTree(magick_list); - instantiate_magick=MagickFalse; - RelinquishSemaphoreInfo(magick_semaphore); - DestroySemaphoreInfo(&magick_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + G e t I m a g e D e c o d e r % % % % % @@ -855,31 +827,6 @@ static MagickBooleanType InitializeMagickList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e M a g i c k C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateMagickComponent() instantiates the magick component. -% -% The format of the InstantiateMagickComponent method is: -% -% MagickBooleanType InstantiateMagickComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateMagickComponent(void) -{ - AcquireSemaphoreInfo(&magick_semaphore); - RelinquishSemaphoreInfo(magick_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + I s M a g i c k C o n f l i c t % % % % % @@ -1067,6 +1014,59 @@ MagickExport MagickBooleanType IsMagickInstantiated(void) % % % % % % ++ M a g i c k C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickComponentGenesis() instantiates the magick component. +% +% The format of the MagickComponentGenesis method is: +% +% MagickBooleanType MagickComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType MagickComponentGenesis(void) +{ + AcquireSemaphoreInfo(&magick_semaphore); + RelinquishSemaphoreInfo(magick_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M a g i c k C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MagickComponentTerminus() destroys the magick component. +% +% The format of the MagickComponentTerminus method is: +% +% void MagickComponentTerminus(void) +% +*/ +MagickExport void MagickComponentTerminus(void) +{ + AcquireSemaphoreInfo(&magick_semaphore); + if (magick_list != (SplayTreeInfo *) NULL) + magick_list=DestroySplayTree(magick_list); + instantiate_magick=MagickFalse; + RelinquishSemaphoreInfo(magick_semaphore); + DestroySemaphoreInfo(&magick_semaphore); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % M a g i c k C o r e G e n e s i s % % % % % @@ -1127,7 +1127,7 @@ static void MagickSignalHandler(int signal_number) #if !defined(MAGICKCORE_HAVE_SIGACTION) (void) signal(signal_number,SIG_IGN); #endif - AsynchronousDestroyResourceComponent(); + AsynchronousResourceComponentTerminus(); instantiate_magick=MagickFalse; (void) SetMagickSignalHandler(signal_number,signal_handlers[signal_number]); #if defined(MAGICKCORE_HAVE_RAISE) @@ -1177,19 +1177,15 @@ MagickExport void MagickCoreGenesis(const char *path, execution_path[MaxTextExtent], filename[MaxTextExtent]; - time_t - seconds; - /* Initialize the Magick environment. */ (void) setlocale(LC_ALL,""); (void) setlocale(LC_NUMERIC,"C"); - (void) InstantiateSemaphoreComponent(); - (void) InstantiateLogComponent(); - (void) InstantiateLocaleComponent(); - (void) InstantiateRandomComponent(); - seconds=time((time_t *) NULL); + (void) SemaphoreComponentGenesis(); + (void) LogComponentGenesis(); + (void) LocaleComponentGenesis(); + (void) RandomComponentGenesis(); events=GetEnvironmentValue("MAGICK_DEBUG"); if (events != (char *) NULL) { @@ -1265,23 +1261,23 @@ MagickExport void MagickCoreGenesis(const char *path, /* Instantiate magick resources. */ - (void) InstantiatePolicyComponent(); - (void) InstantiateCacheComponent(); - (void) InstantiateRegistryComponent(); - (void) InstantiateResourcesComponent(); - (void) InstantiateCoderComponent(); - (void) InstantiateMagickComponent(); + (void) PolicyComponentGenesis(); + (void) CacheComponentGenesis(); + (void) RegistryComponentGenesis(); + (void) ResourceComponentGenesis(); + (void) CoderComponentGenesis(); + (void) MagickComponentGenesis(); #if defined(MAGICKCORE_MODULES_SUPPORT) - (void) InstantiateModuleComponent(); + (void) ModuleComponentGenesis(); #endif - (void) InstantiateDelegateComponent(); - (void) InstantiateMagicComponent(); - (void) InstantiateColorComponent(); - (void) InstantiateTypeComponent(); - (void) InstantiateConfigureComponent(); - (void) InstantiateMimeComponent(); - (void) InstantiateConstituteComponent(); - (void) InstantiateXComponent(); + (void) DelegateComponentGenesis(); + (void) MagicComponentGenesis(); + (void) ColorComponentGenesis(); + (void) TypeComponentGenesis(); + (void) ConfigureComponentGenesis(); + (void) MimeComponentGenesis(); + (void) ConstituteComponentGenesis(); + (void) XComponentGenesis(); } /* @@ -1297,7 +1293,7 @@ MagickExport void MagickCoreGenesis(const char *path, % % MagickCoreTerminus() destroys the MagickCore environment. % -% The format of the DestroyMagick function is: +% The format of the MagickCoreTerminus function is: % % MagickCoreTerminus(void) % @@ -1305,34 +1301,34 @@ MagickExport void MagickCoreGenesis(const char *path, MagickExport void MagickCoreTerminus(void) { #if defined(MAGICKCORE_X11_DELEGATE) - DestroyXComponent(); + XComponentTerminus(); #endif - DestroyConstituteComponent(); - DestroyMimeComponent(); - DestroyConfigureComponent(); - DestroyTypeComponent(); - DestroyColorComponent(); + ConstituteComponentTerminus(); + MimeComponentTerminus(); + ConfigureComponentTerminus(); + TypeComponentTerminus(); + ColorComponentTerminus(); #if defined(__WINDOWS__) NTGhostscriptUnLoadDLL(); #endif - DestroyMagicComponent(); - DestroyDelegateComponent(); - DestroyMagickComponent(); + MagicComponentTerminus(); + DelegateComponentTerminus(); + MagickComponentTerminus(); #if !defined(MAGICKCORE_BUILD_MODULES) UnregisterStaticModules(); #endif #if defined(MAGICKCORE_MODULES_SUPPORT) - DestroyModuleComponent(); + ModuleComponentTerminus(); #endif - DestroyCoderComponent(); - DestroyResourceComponent(); - DestroyRegistryComponent(); - DestroyCacheFaclity(); - DestroyPolicyComponent(); - DestroyRandomComponent(); - DestroyLocaleComponent(); - DestroyLogComponent(); - DestroySemaphoreComponent(); + CoderComponentTerminus(); + ResourceComponentTerminus(); + RegistryComponentTerminus(); + CacheComponentTerminus(); + PolicyComponentTerminus(); + RandomComponentTerminus(); + LocaleComponentTerminus(); + LogComponentTerminus(); + SemaphoreComponentTerminus(); instantiate_magick=MagickFalse; } diff --git a/magick/magick.h b/magick/magick.h index 39bccc7e0..19fdedce0 100644 --- a/magick/magick.h +++ b/magick/magick.h @@ -112,8 +112,8 @@ extern MagickExport MagickBooleanType GetMagickEndianSupport(const MagickInfo *), GetMagickRawSupport(const MagickInfo *), GetMagickSeekableStream(const MagickInfo *), - InstantiateMagickComponent(void), IsMagickInstantiated(void), + MagickComponentGenesis(void), UnregisterMagickInfo(const char *); extern const MagickExport MagickInfo @@ -128,7 +128,7 @@ extern MagickExport MagickStatusType GetMagickThreadSupport(const MagickInfo *); extern MagickExport void - DestroyMagickComponent(void), + MagickComponentTerminus(void), MagickCoreGenesis(const char *,const MagickBooleanType), MagickCoreTerminus(void); diff --git a/magick/methods.h b/magick/methods.h index 40cd3c5a8..b8a7a50b2 100644 --- a/magick/methods.h +++ b/magick/methods.h @@ -107,7 +107,7 @@ extern "C" { #define Ascii85Encode PrependMagickMethod(Ascii85Encode) #define Ascii85Flush PrependMagickMethod(Ascii85Flush) #define Ascii85Initialize PrependMagickMethod(Ascii85Initialize) -#define AsynchronousDestroyResourceComponent PrependMagickMethod(AsynchronousDestroyResourceComponent) +#define AsynchronousResourceComponentTerminus PrependMagickMethod(AsynchronousResourceComponentTerminus) #define AttachBlob PrependMagickMethod(AttachBlob) #define AverageImages PrependMagickMethod(AverageImages) #define Base64Decode PrependMagickMethod(Base64Decode) @@ -223,12 +223,12 @@ extern "C" { #define DespeckleImage PrependMagickMethod(DespeckleImage) #define DestroyBlob PrependMagickMethod(DestroyBlob) #define DestroyCacheView PrependMagickMethod(DestroyCacheView) -#define DestroyCoderComponent PrependMagickMethod(DestroyCoderComponent) -#define DestroyColorComponent PrependMagickMethod(DestroyColorComponent) -#define DestroyConfigureComponent PrependMagickMethod(DestroyConfigureComponent) +#define CoderComponentTerminus PrependMagickMethod(CoderComponentTerminus) +#define ColorComponentTerminus PrependMagickMethod(ColorComponentTerminus) +#define ConfigureComponentTerminus PrependMagickMethod(ConfigureComponentTerminus) #define DestroyConfigureOptions PrependMagickMethod(DestroyConfigureOptions) -#define DestroyConstituteComponent PrependMagickMethod(DestroyConstituteComponent) -#define DestroyDelegateComponent PrependMagickMethod(DestroyDelegateComponent) +#define ConstituteComponentTerminus PrependMagickMethod(ConstituteComponentTerminus) +#define DelegateComponentTerminus PrependMagickMethod(DelegateComponentTerminus) #define DestroyDrawInfo PrependMagickMethod(DestroyDrawInfo) #define DestroyExceptionInfo PrependMagickMethod(DestroyExceptionInfo) #define DestroyFxInfo PrependMagickMethod(DestroyFxInfo) @@ -242,28 +242,28 @@ extern "C" { #define DestroyImage PrependMagickMethod(DestroyImage) #define DestroyImageProfiles PrependMagickMethod(DestroyImageProfiles) #define DestroyImageProperties PrependMagickMethod(DestroyImageProperties) -#define DestroyRegistryComponent PrependMagickMethod(DestroyRegistryComponent) +#define RegistryComponentTerminus PrependMagickMethod(RegistryComponentTerminus) #define DestroyImages PrependMagickMethod(DestroyImages) #define DestroyLinkedList PrependMagickMethod(DestroyLinkedList) -#define DestroyLocaleComponent PrependMagickMethod(DestroyLocaleComponent) +#define LocaleComponentTerminus PrependMagickMethod(LocaleComponentTerminus) #define DestroyLocaleOptions PrependMagickMethod(DestroyLocaleOptions) -#define DestroyLogComponent PrependMagickMethod(DestroyLogComponent) -#define DestroyMagickComponent PrependMagickMethod(DestroyMagickComponent) +#define LogComponentTerminus PrependMagickMethod(LogComponentTerminus) +#define MagickComponentTerminus PrependMagickMethod(MagickComponentTerminus) #define DestroyMagickMemory PrependMagickMethod(DestroyMagickMemory) #define DestroyMagick PrependMagickMethod(DestroyMagick) #define DestroyMagickRegistry PrependMagickMethod(DestroyMagickRegistry) -#define DestroyResourceComponent PrependMagickMethod(DestroyResourceComponent) -#define DestroyMagicComponent PrependMagickMethod(DestroyMagicComponent) -#define DestroyMimeComponent PrependMagickMethod(DestroyMimeComponent) +#define ResourceComponentTerminus PrependMagickMethod(ResourceComponentTerminus) +#define MagicComponentTerminus PrependMagickMethod(MagicComponentTerminus) +#define MimeComponentTerminus PrependMagickMethod(MimeComponentTerminus) #define DestroyMontageInfo PrependMagickMethod(DestroyMontageInfo) #define DestroyPixelCache PrependMagickMethod(DestroyPixelCache) #define DestroyPixelCacheNexus PrependMagickMethod(DestroyPixelCacheNexus) -#define DestroyCacheFaclity PrependMagickMethod(DestroyCacheFaclity) -#define DestroyPolicyComponent PrependMagickMethod(DestroyPolicyComponent) +#define CacheComponentTerminus PrependMagickMethod(CacheComponentTerminus) +#define PolicyComponentTerminus PrependMagickMethod(PolicyComponentTerminus) #define DestroyQuantizeInfo PrependMagickMethod(DestroyQuantizeInfo) #define DestroyQuantumInfo PrependMagickMethod(DestroyQuantumInfo) #define DestroyRandomInfo PrependMagickMethod(DestroyRandomInfo) -#define DestroyRandomComponent PrependMagickMethod(DestroyRandomComponent) +#define RandomComponentTerminus PrependMagickMethod(RandomComponentTerminus) #define DestroyResampleFilter PrependMagickMethod(DestroyResampleFilter) #define DestroyResizeFilter PrependMagickMethod(DestroyResizeFilter) #define DestroySemaphoreInfo PrependMagickMethod(DestroySemaphoreInfo) @@ -277,7 +277,7 @@ extern "C" { #define DestroyThresholdMap PrependMagickMethod(DestroyThresholdMap) #define DestroyTimerInfo PrependMagickMethod(DestroyTimerInfo) #define DestroyTokenInfo PrependMagickMethod(DestroyTokenInfo) -#define DestroyTypeComponent PrependMagickMethod(DestroyTypeComponent) +#define TypeComponentTerminus PrependMagickMethod(TypeComponentTerminus) #define DestroyXMLTree PrependMagickMethod(DestroyXMLTree) #define DestroyXResources PrependMagickMethod(DestroyXResources) #define DestroyXWidget PrependMagickMethod(DestroyXWidget) @@ -622,7 +622,7 @@ extern "C" { #define InheritException PrependMagickMethod(InheritException) #define InitializeMagick PrependMagickMethod(InitializeMagick) #define InitializeMagickResources PrependMagickMethod(InitializeMagickResources) -#define InstantiateSemaphoreComponent PrependMagickMethod(InstantiateSemaphoreComponent) +#define SemaphoreComponentGenesis PrependMagickMethod(SemaphoreComponentGenesis) #define InitializeSignature PrependMagickMethod(InitializeSignature) #define InjectImageBlob PrependMagickMethod(InjectImageBlob) #define InsertImageInList PrependMagickMethod(InsertImageInList) diff --git a/magick/mime.c b/magick/mime.c index 2eb8143cf..7e151fd37 100644 --- a/magick/mime.c +++ b/magick/mime.c @@ -131,55 +131,6 @@ static MagickBooleanType % % % % % % -+ D e s t r o y M i m e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyMimeComponent() destroys the mime component. -% -% The format of the DestroyMimeComponent method is: -% -% DestroyMimeComponent(void) -% -*/ - -static void *DestroyMimeElement(void *mime_info) -{ - register MimeInfo - *p; - - p=(MimeInfo *) mime_info; - if (p->magic != (unsigned char *) NULL) - p->magic=(unsigned char *) RelinquishMagickMemory(p->magic); - if (p->pattern != (char *) NULL) - p->pattern=DestroyString(p->pattern); - if (p->description != (char *) NULL) - p->description=DestroyString(p->description); - if (p->type != (char *) NULL) - p->type=DestroyString(p->type); - if (p->path != (char *) NULL) - p->path=DestroyString(p->path); - p=(MimeInfo *) RelinquishMagickMemory(p); - return((void *) NULL); -} - -MagickExport void DestroyMimeComponent(void) -{ - AcquireSemaphoreInfo(&mime_semaphore); - if (mime_list != (LinkedListInfo *) NULL) - mime_list=DestroyLinkedList(mime_list,DestroyMimeElement); - instantiate_mime=MagickFalse; - RelinquishSemaphoreInfo(mime_semaphore); - DestroySemaphoreInfo(&mime_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + G e t M i m e I n f o % % % % % @@ -670,31 +621,6 @@ static MagickBooleanType InitializeMimeList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e M i m e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateMimeComponent() instantiates the mime component. -% -% The format of the InstantiateMimeComponent method is: -% -% MagickBooleanType InstantiateMimeComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateMimeComponent(void) -{ - AcquireSemaphoreInfo(&mime_semaphore); - RelinquishSemaphoreInfo(mime_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % L i s t M i m e I n f o % % % % % @@ -1103,3 +1029,77 @@ MagickExport char *MagickToMime(const char *magick) LocaleLower(media+8); return(ConstantString(media)); } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M i m e C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MimeComponentGenesis() instantiates the mime component. +% +% The format of the MimeComponentGenesis method is: +% +% MagickBooleanType MimeComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType MimeComponentGenesis(void) +{ + AcquireSemaphoreInfo(&mime_semaphore); + RelinquishSemaphoreInfo(mime_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M i m e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% MimeComponentTerminus() destroys the mime component. +% +% The format of the MimeComponentTerminus method is: +% +% MimeComponentTerminus(void) +% +*/ + +static void *DestroyMimeElement(void *mime_info) +{ + register MimeInfo + *p; + + p=(MimeInfo *) mime_info; + if (p->magic != (unsigned char *) NULL) + p->magic=(unsigned char *) RelinquishMagickMemory(p->magic); + if (p->pattern != (char *) NULL) + p->pattern=DestroyString(p->pattern); + if (p->description != (char *) NULL) + p->description=DestroyString(p->description); + if (p->type != (char *) NULL) + p->type=DestroyString(p->type); + if (p->path != (char *) NULL) + p->path=DestroyString(p->path); + p=(MimeInfo *) RelinquishMagickMemory(p); + return((void *) NULL); +} + +MagickExport void MimeComponentTerminus(void) +{ + AcquireSemaphoreInfo(&mime_semaphore); + if (mime_list != (LinkedListInfo *) NULL) + mime_list=DestroyLinkedList(mime_list,DestroyMimeElement); + instantiate_mime=MagickFalse; + RelinquishSemaphoreInfo(mime_semaphore); + DestroySemaphoreInfo(&mime_semaphore); +} diff --git a/magick/mime.h b/magick/mime.h index 5ba7a7c79..b366c2142 100644 --- a/magick/mime.h +++ b/magick/mime.h @@ -34,16 +34,16 @@ extern MagickExport const char *GetMimeType(const MimeInfo *); extern MagickExport MagickBooleanType - InstantiateMimeComponent(void), ListMimeInfo(FILE *,ExceptionInfo *), - LoadMimeLists(const char *,ExceptionInfo *); + LoadMimeLists(const char *,ExceptionInfo *), + MimeComponentGenesis(void); extern MagickExport const MimeInfo *GetMimeInfo(const char *,const unsigned char *,const size_t,ExceptionInfo *), **GetMimeInfoList(const char *,unsigned long *,ExceptionInfo *); extern MagickExport void - DestroyMimeComponent(void); + MimeComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/module.c b/magick/module.c index 1ad967af7..4b6203e68 100644 --- a/magick/module.c +++ b/magick/module.c @@ -191,30 +191,6 @@ MagickExport void DestroyModuleList(void) % % % % % % -+ D e s t r o y M o d u l e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyModuleComponent() destroys the module component. -% -% The format of the DestroyModuleComponent method is: -% -% DestroyModuleComponent(void) -% -*/ -MagickExport void DestroyModuleComponent(void) -{ - DestroyModuleList(); - DestroySemaphoreInfo(&module_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % G e t M o d u l e I n f o % % % % % @@ -907,35 +883,6 @@ MagickExport MagickBooleanType InitializeModuleList( % % % % % % -+ I n s t a n t i a t e M o d u l e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateModuleComponent() instantiates the module component. -% -% The format of the InstantiateModuleComponent method is: -% -% MagickBooleanType InstantiateModuleComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateModuleComponent(void) -{ - ExceptionInfo - *exception; - - exception=AcquireExceptionInfo(); - InitializeModuleList(exception); - exception=DestroyExceptionInfo(exception); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % I n v o k e D y n a m i c I m a g e F i l t e r % % % % % @@ -1140,6 +1087,59 @@ MagickExport MagickBooleanType ListModuleInfo(FILE *file, % % % % % % ++ M o d u l e C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ModuleComponentGenesis() instantiates the module component. +% +% The format of the ModuleComponentGenesis method is: +% +% MagickBooleanType ModuleComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType ModuleComponentGenesis(void) +{ + ExceptionInfo + *exception; + + exception=AcquireExceptionInfo(); + InitializeModuleList(exception); + exception=DestroyExceptionInfo(exception); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ M o d u l e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ModuleComponentTerminus() destroys the module component. +% +% The format of the ModuleComponentTerminus method is: +% +% ModuleComponentTerminus(void) +% +*/ +MagickExport void ModuleComponentTerminus(void) +{ + DestroyModuleList(); + DestroySemaphoreInfo(&module_semaphore); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % O p e n M o d u l e % % % % % diff --git a/magick/module.h b/magick/module.h index 4374c86df..a18b83f62 100644 --- a/magick/module.h +++ b/magick/module.h @@ -74,10 +74,10 @@ extern MagickExport const ModuleInfo extern MagickExport MagickBooleanType InitializeModuleList(ExceptionInfo *), - InstantiateModuleComponent(void), InvokeDynamicImageFilter(const char *,Image **,const int,const char **, ExceptionInfo *), ListModuleInfo(FILE *,ExceptionInfo *), + ModuleComponentGenesis(void), OpenModule(const char *,ExceptionInfo *), OpenModules(ExceptionInfo *); @@ -86,7 +86,7 @@ extern MagickExport ModuleInfo extern MagickExport void DestroyModuleList(void), - DestroyModuleComponent(void), + ModuleComponentTerminus(void), RegisterStaticModules(void), UnregisterStaticModules(void); diff --git a/magick/nt-base.c b/magick/nt-base.c index 293178066..c7a9e0271 100644 --- a/magick/nt-base.c +++ b/magick/nt-base.c @@ -350,7 +350,7 @@ MagickExport int NTCloseLibrary(void *handle) static BOOL ControlHandler(DWORD type) { (void) type; - AsynchronousDestroyResourceComponent(); + AsynchronousResourceComponentTerminus(); return(FALSE); } diff --git a/magick/policy.c b/magick/policy.c index b7646bc22..fd31a38d5 100644 --- a/magick/policy.c +++ b/magick/policy.c @@ -137,56 +137,6 @@ static MagickBooleanType % % % % % % -+ D e s t r o y P o l i c y C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyPolicyComponent() destroys the policy component. -% -% The format of the DestroyPolicyComponent method is: -% -% DestroyPolicyComponent(void) -% -*/ - -static void *DestroyPolicyElement(void *policy_info) -{ - register PolicyInfo - *p; - - p=(PolicyInfo *) policy_info; - if (p->exempt == MagickFalse) - { - if (p->value != (char *) NULL) - p->value=DestroyString(p->value); - if (p->pattern != (char *) NULL) - p->pattern=DestroyString(p->pattern); - if (p->name != (char *) NULL) - p->name=DestroyString(p->name); - if (p->path != (char *) NULL) - p->path=DestroyString(p->path); - } - p=(PolicyInfo *) RelinquishMagickMemory(p); - return((void *) NULL); -} - -MagickExport void DestroyPolicyComponent(void) -{ - AcquireSemaphoreInfo(&policy_semaphore); - if (policy_list != (LinkedListInfo *) NULL) - policy_list=DestroyLinkedList(policy_list,DestroyPolicyElement); - instantiate_policy=MagickFalse; - RelinquishSemaphoreInfo(policy_semaphore); - DestroySemaphoreInfo(&policy_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + G e t P o l i c y I n f o % % % % % @@ -495,31 +445,6 @@ static MagickBooleanType InitializePolicyList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e P o l i c y C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiatePolicyComponent() instantiates the policy component. -% -% The format of the InstantiatePolicyComponent method is: -% -% MagickBooleanType InstantiatePolicyComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiatePolicyComponent(void) -{ - AcquireSemaphoreInfo(&policy_semaphore); - RelinquishSemaphoreInfo(policy_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % I s R i g h t s A u t h o r i z e d % % % % % @@ -1018,3 +943,78 @@ static MagickBooleanType LoadPolicyLists(const char *filename, options=DestroyConfigureOptions(options); return(status != 0 ? MagickTrue : MagickFalse); } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ P o l i c y C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% PolicyComponentGenesis() instantiates the policy component. +% +% The format of the PolicyComponentGenesis method is: +% +% MagickBooleanType PolicyComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType PolicyComponentGenesis(void) +{ + AcquireSemaphoreInfo(&policy_semaphore); + RelinquishSemaphoreInfo(policy_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ P o l i c y C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% PolicyComponentTerminus() destroys the policy component. +% +% The format of the PolicyComponentTerminus method is: +% +% PolicyComponentTerminus(void) +% +*/ + +static void *DestroyPolicyElement(void *policy_info) +{ + register PolicyInfo + *p; + + p=(PolicyInfo *) policy_info; + if (p->exempt == MagickFalse) + { + if (p->value != (char *) NULL) + p->value=DestroyString(p->value); + if (p->pattern != (char *) NULL) + p->pattern=DestroyString(p->pattern); + if (p->name != (char *) NULL) + p->name=DestroyString(p->name); + if (p->path != (char *) NULL) + p->path=DestroyString(p->path); + } + p=(PolicyInfo *) RelinquishMagickMemory(p); + return((void *) NULL); +} + +MagickExport void PolicyComponentTerminus(void) +{ + AcquireSemaphoreInfo(&policy_semaphore); + if (policy_list != (LinkedListInfo *) NULL) + policy_list=DestroyLinkedList(policy_list,DestroyPolicyElement); + instantiate_policy=MagickFalse; + RelinquishSemaphoreInfo(policy_semaphore); + DestroySemaphoreInfo(&policy_semaphore); +} diff --git a/magick/policy.h b/magick/policy.h index 829e12acc..019f2cb92 100644 --- a/magick/policy.h +++ b/magick/policy.h @@ -55,12 +55,12 @@ extern MagickExport const PolicyInfo **GetPolicyInfoList(const char *,unsigned long *,ExceptionInfo *); extern MagickExport MagickBooleanType - InstantiatePolicyComponent(void), IsRightsAuthorized(const PolicyDomain,const PolicyRights,const char *), - ListPolicyInfo(FILE *,ExceptionInfo *); + ListPolicyInfo(FILE *,ExceptionInfo *), + PolicyComponentGenesis(void); extern MagickExport void - DestroyPolicyComponent(void); + PolicyComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/random.c b/magick/random.c index 10d4b01e1..2500cb600 100644 --- a/magick/random.c +++ b/magick/random.c @@ -252,31 +252,6 @@ MagickExport RandomInfo *AcquireRandomInfo(void) % % % % % % -+ D e s t r o y R a n d o m C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyRandomComponent() destroys the random component. -% -% The format of the DestroyRandomComponent method is: -% -% DestroyRandomComponent(void) -% -*/ -MagickExport void DestroyRandomComponent(void) -{ - AcquireSemaphoreInfo(&random_semaphore); - (void) UnlockSemaphoreInfo(random_semaphore); - DestroySemaphoreInfo(&random_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + D e s t r o y R a n d o m I n f o % % % % % @@ -714,20 +689,20 @@ MagickExport double GetRandomValue(RandomInfo *random_info) % % % % % % -+ I n s t a n t i a t e R a n d o m C o m p o n e n t % ++ R a n d o m C o m p o n e n t G e n e s i s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% InstantiateRandomComponent() instantiates the random component. +% RandomComponentGenesis() instantiates the random component. % -% The format of the InstantiateRandomComponent method is: +% The format of the RandomComponentGenesis method is: % -% MagickBooleanType InstantiateRandomComponent(void) +% MagickBooleanType RandomComponentGenesis(void) % */ -MagickExport MagickBooleanType InstantiateRandomComponent(void) +MagickExport MagickBooleanType RandomComponentGenesis(void) { AcquireSemaphoreInfo(&random_semaphore); RelinquishSemaphoreInfo(random_semaphore); @@ -739,6 +714,31 @@ MagickExport MagickBooleanType InstantiateRandomComponent(void) % % % % % % ++ R a n d o m C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% RandomComponentTerminus() destroys the random component. +% +% The format of the RandomComponentTerminus method is: +% +% RandomComponentTerminus(void) +% +*/ +MagickExport void RandomComponentTerminus(void) +{ + AcquireSemaphoreInfo(&random_semaphore); + (void) UnlockSemaphoreInfo(random_semaphore); + DestroySemaphoreInfo(&random_semaphore); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % S e e d P s e u d o R a n d o m G e n e r a t o r % % % % % diff --git a/magick/random_.h b/magick/random_.h index c5890431f..6d0ccdb61 100644 --- a/magick/random_.h +++ b/magick/random_.h @@ -38,7 +38,7 @@ extern MagickExport double GetPseudoRandomValue(RandomInfo *); extern MagickExport MagickBooleanType - InstantiateRandomComponent(void); + RandomComponentGenesis(void); extern MagickExport RandomInfo *AcquireRandomInfo(void), @@ -48,7 +48,7 @@ extern MagickExport StringInfo *GetRandomKey(RandomInfo *,const size_t); extern MagickExport void - DestroyRandomComponent(void), + RandomComponentTerminus(void), SeedPseudoRandomGenerator(const unsigned long), SetRandomKey(RandomInfo *,const size_t,unsigned char *), SetRandomTrueRandom(const MagickBooleanType); diff --git a/magick/registry.c b/magick/registry.c index b40d6c884..3e850a01d 100644 --- a/magick/registry.c +++ b/magick/registry.c @@ -163,36 +163,6 @@ MagickExport MagickBooleanType DeleteImageRegistry(const char *key) % % % % % % -% D e s t r o y R e g i s t r y C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyRegistryComponent() destroys the registry component. -% -% The format of the DestroyDefines method is: -% -% void DestroyRegistryComponent(void) -% -*/ -MagickExport void DestroyRegistryComponent(void) -{ - AcquireSemaphoreInfo(®istry_semaphore); - if (IsEventLogging() != MagickFalse) - (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); - if (registry != (void *) NULL) - registry=DestroySplayTree(registry); - instantiate_registry=MagickFalse; - RelinquishSemaphoreInfo(registry_semaphore); - DestroySemaphoreInfo(®istry_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % G e t I m a g e R e g i s t r y % % % % % @@ -314,20 +284,20 @@ MagickExport char *GetNextImageRegistry(void) % % % % % % -+ I n s t a n t i a t e R e g i s t r y C o m p o n e n t % ++ R e g i s t r y C o m p o n e n t G e n e s i s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% InstantiateRegistryComponent() instantiates the registry component. +% RegistryComponentGenesis() instantiates the registry component. % -% The format of the InstantiateRegistryComponent method is: +% The format of the RegistryComponentGenesis method is: % -% MagickBooleanType InstantiateRegistryComponent(void) +% MagickBooleanType RegistryComponentGenesis(void) % */ -MagickExport MagickBooleanType InstantiateRegistryComponent(void) +MagickExport MagickBooleanType RegistryComponentGenesis(void) { AcquireSemaphoreInfo(®istry_semaphore); RelinquishSemaphoreInfo(registry_semaphore); @@ -339,6 +309,36 @@ MagickExport MagickBooleanType InstantiateRegistryComponent(void) % % % % % % +% R e g i s t r y C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% RegistryComponentTerminus() destroys the registry component. +% +% The format of the DestroyDefines method is: +% +% void RegistryComponentTerminus(void) +% +*/ +MagickExport void RegistryComponentTerminus(void) +{ + AcquireSemaphoreInfo(®istry_semaphore); + if (IsEventLogging() != MagickFalse) + (void) LogMagickEvent(TraceEvent,GetMagickModule(),"..."); + if (registry != (void *) NULL) + registry=DestroySplayTree(registry); + instantiate_registry=MagickFalse; + RelinquishSemaphoreInfo(registry_semaphore); + DestroySemaphoreInfo(®istry_semaphore); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % R e m o v e I m a g e R e g i s t r y % % % % % diff --git a/magick/registry.h b/magick/registry.h index 37bbc9c35..53619ddb7 100644 --- a/magick/registry.h +++ b/magick/registry.h @@ -36,13 +36,13 @@ extern MagickExport char extern MagickExport MagickBooleanType DefineImageRegistry(const RegistryType,const char *,ExceptionInfo *), DeleteImageRegistry(const char *), - InstantiateRegistryComponent(void), + RegistryComponentGenesis(void), SetImageRegistry(const RegistryType,const char *,const void *, ExceptionInfo *); extern MagickExport void - DestroyRegistryComponent(void), *GetImageRegistry(const RegistryType,const char *,ExceptionInfo *), + RegistryComponentTerminus(void), *RemoveImageRegistry(const char *), ResetImageRegistryIterator(void); diff --git a/magick/resource.c b/magick/resource.c index 8b06c0394..727283d94 100644 --- a/magick/resource.c +++ b/magick/resource.c @@ -265,22 +265,22 @@ MagickExport MagickBooleanType AcquireMagickResource(const ResourceType type, % % % % % % -+ A s y n c h r o n o u s D e s t r o y R e s o u r c e C o m p o n e n t % ++ A s y n c h r o n o u s R e s o u r c e C o m p o n e n t T e r m i n u s % % % % % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% AsynchronousDestroyResourceComponent() destroys the resource environment. -% It differs from DestroyResourceComponent() in that it can be called from a +% AsynchronousResourceComponentTerminus() destroys the resource environment. +% It differs from ResourceComponentTerminus() in that it can be called from a % asynchronous signal handler. % -% The format of the DestroyResourceComponent() method is: +% The format of the ResourceComponentTerminus() method is: % -% DestroyResourceComponent(void) +% ResourceComponentTerminus(void) % */ -MagickExport void AsynchronousDestroyResourceComponent(void) +MagickExport void AsynchronousResourceComponentTerminus(void) { const char *path; @@ -482,35 +482,6 @@ MagickExport int AcquireUniqueFileResource(char *path) % % % % % % -+ D e s t r o y R e s o u r c e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyResourceComponent() destroys the resource component. -% -% The format of the DestroyResourceComponent() method is: -% -% DestroyResourceComponent(void) -% -*/ -MagickExport void DestroyResourceComponent(void) -{ - AcquireSemaphoreInfo(&resource_semaphore); - if (temporary_resources != (SplayTreeInfo *) NULL) - temporary_resources=DestroySplayTree(temporary_resources); - if (random_info != (RandomInfo *) NULL) - random_info=DestroyRandomInfo(random_info); - RelinquishSemaphoreInfo(resource_semaphore); - DestroySemaphoreInfo(&resource_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % G e t M a g i c k R e s o u r c e % % % % % @@ -657,162 +628,6 @@ MagickExport MagickSizeType GetMagickResourceLimit(const ResourceType type) % % % % % % -+ I n s t a n t i a t e R e s o u r c e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateResourcesComponent() instantiates the resource component. -% -% The format of the InstantiateResourcesComponent method is: -% -% MagickBooleanType InstantiateResourcesComponent(void) -% -*/ - -static inline unsigned long MagickMax(const unsigned long x, - const unsigned long y) -{ - if (x > y) - return(x); - return(y); -} - -static inline MagickSizeType StringToSizeType(const char *string, - const double interval) -{ - double - value; - - value=StringToDouble(string,interval); - if (value >= (double) MagickULLConstant(~0)) - return(MagickULLConstant(~0)); - return((MagickSizeType) value); -} - -MagickExport MagickBooleanType InstantiateResourcesComponent(void) -{ - char - *limit; - - long - files, - pages, - pagesize; - - MagickSizeType - memory; - - /* - Set Magick resource limits. - */ - AcquireSemaphoreInfo(&resource_semaphore); - RelinquishSemaphoreInfo(resource_semaphore); - pagesize=GetMagickPageSize(); - pages=(-1); -#if defined(MAGICKCORE_HAVE_SYSCONF) && defined(_SC_PHYS_PAGES) - pages=sysconf(_SC_PHYS_PAGES); -#endif - memory=(MagickSizeType) pages*pagesize; - if ((pagesize <= 0) || (pages <= 0)) - memory=2048UL*1024UL*1024UL; -#if defined(PixelCacheThreshold) - memory=PixelCacheThreshold; -#endif - (void) SetMagickResourceLimit(AreaResource,2UL*memory); - (void) SetMagickResourceLimit(MemoryResource,3UL*memory/2UL); - (void) SetMagickResourceLimit(MapResource,4UL*memory); - limit=GetEnvironmentValue("MAGICK_AREA_LIMIT"); - if (limit == (char *) NULL) - limit=GetPolicyValue("area"); - if (limit != (char *) NULL) - { - (void) SetMagickResourceLimit(AreaResource,StringToSizeType(limit,100.0)); - limit=DestroyString(limit); - } - limit=GetEnvironmentValue("MAGICK_MEMORY_LIMIT"); - if (limit == (char *) NULL) - limit=GetPolicyValue("memory"); - if (limit != (char *) NULL) - { - (void) SetMagickResourceLimit(MemoryResource, - StringToSizeType(limit,100.0)); - limit=DestroyString(limit); - } - limit=GetEnvironmentValue("MAGICK_MAP_LIMIT"); - if (limit == (char *) NULL) - limit=GetPolicyValue("map"); - if (limit != (char *) NULL) - { - (void) SetMagickResourceLimit(MapResource,StringToSizeType(limit,100.0)); - limit=DestroyString(limit); - } - limit=GetEnvironmentValue("MAGICK_DISK_LIMIT"); - if (limit == (char *) NULL) - limit=GetPolicyValue("disk"); - if (limit != (char *) NULL) - { - (void) SetMagickResourceLimit(DiskResource,StringToSizeType(limit,100.0)); - limit=DestroyString(limit); - } - files=(-1); -#if defined(MAGICKCORE_HAVE_SYSCONF) && defined(_SC_OPEN_MAX) - files=sysconf(_SC_OPEN_MAX); -#endif -#if defined(MAGICKCORE_HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) - if (files < 0) - { - struct rlimit - resources; - - if (getrlimit(RLIMIT_NOFILE,&resources) != -1) - files=resources.rlim_cur; - } -#endif -#if defined(MAGICKCORE_HAVE_GETDTABLESIZE) && defined(MAGICKCORE_POSIX_SUPPORT) - if (files < 0) - files=getdtablesize(); -#endif - if (files < 0) - files=64; - (void) SetMagickResourceLimit(FileResource,MagickMax((unsigned long) - (3*files/4),64)); - limit=GetEnvironmentValue("MAGICK_FILE_LIMIT"); - if (limit == (char *) NULL) - limit=GetPolicyValue("file"); - if (limit != (char *) NULL) - { - (void) SetMagickResourceLimit(FileResource,StringToSizeType(limit,100.0)); - limit=DestroyString(limit); - } - (void) SetMagickResourceLimit(ThreadResource,GetOpenMPMaximumThreads()); - limit=GetEnvironmentValue("MAGICK_THREAD_LIMIT"); - if (limit == (char *) NULL) - limit=GetPolicyValue("thread"); - if (limit != (char *) NULL) - { - SetOpenMPMaximumThreads((unsigned long) atol(limit)); - (void) SetMagickResourceLimit(ThreadResource,StringToSizeType(limit, - 100.0)); - limit=DestroyString(limit); - } - limit=GetEnvironmentValue("MAGICK_TIME_LIMIT"); - if (limit == (char *) NULL) - limit=GetPolicyValue("time"); - if (limit != (char *) NULL) - { - (void) SetMagickResourceLimit(TimeResource,StringToSizeType(limit,100.0)); - limit=DestroyString(limit); - } - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % L i s t M a g i c k R e s o u r c e I n f o % % % % % @@ -1027,6 +842,191 @@ MagickExport MagickBooleanType RelinquishUniqueFileResource(const char *path) % % % % % % ++ R e s o u r c e C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ResourceComponentGenesis() instantiates the resource component. +% +% The format of the ResourceComponentGenesis method is: +% +% MagickBooleanType ResourceComponentGenesis(void) +% +*/ + +static inline unsigned long MagickMax(const unsigned long x, + const unsigned long y) +{ + if (x > y) + return(x); + return(y); +} + +static inline MagickSizeType StringToSizeType(const char *string, + const double interval) +{ + double + value; + + value=StringToDouble(string,interval); + if (value >= (double) MagickULLConstant(~0)) + return(MagickULLConstant(~0)); + return((MagickSizeType) value); +} + +MagickExport MagickBooleanType ResourceComponentGenesis(void) +{ + char + *limit; + + long + files, + pages, + pagesize; + + MagickSizeType + memory; + + /* + Set Magick resource limits. + */ + AcquireSemaphoreInfo(&resource_semaphore); + RelinquishSemaphoreInfo(resource_semaphore); + pagesize=GetMagickPageSize(); + pages=(-1); +#if defined(MAGICKCORE_HAVE_SYSCONF) && defined(_SC_PHYS_PAGES) + pages=sysconf(_SC_PHYS_PAGES); +#endif + memory=(MagickSizeType) pages*pagesize; + if ((pagesize <= 0) || (pages <= 0)) + memory=2048UL*1024UL*1024UL; +#if defined(PixelCacheThreshold) + memory=PixelCacheThreshold; +#endif + (void) SetMagickResourceLimit(AreaResource,2UL*memory); + (void) SetMagickResourceLimit(MemoryResource,3UL*memory/2UL); + (void) SetMagickResourceLimit(MapResource,4UL*memory); + limit=GetEnvironmentValue("MAGICK_AREA_LIMIT"); + if (limit == (char *) NULL) + limit=GetPolicyValue("area"); + if (limit != (char *) NULL) + { + (void) SetMagickResourceLimit(AreaResource,StringToSizeType(limit,100.0)); + limit=DestroyString(limit); + } + limit=GetEnvironmentValue("MAGICK_MEMORY_LIMIT"); + if (limit == (char *) NULL) + limit=GetPolicyValue("memory"); + if (limit != (char *) NULL) + { + (void) SetMagickResourceLimit(MemoryResource, + StringToSizeType(limit,100.0)); + limit=DestroyString(limit); + } + limit=GetEnvironmentValue("MAGICK_MAP_LIMIT"); + if (limit == (char *) NULL) + limit=GetPolicyValue("map"); + if (limit != (char *) NULL) + { + (void) SetMagickResourceLimit(MapResource,StringToSizeType(limit,100.0)); + limit=DestroyString(limit); + } + limit=GetEnvironmentValue("MAGICK_DISK_LIMIT"); + if (limit == (char *) NULL) + limit=GetPolicyValue("disk"); + if (limit != (char *) NULL) + { + (void) SetMagickResourceLimit(DiskResource,StringToSizeType(limit,100.0)); + limit=DestroyString(limit); + } + files=(-1); +#if defined(MAGICKCORE_HAVE_SYSCONF) && defined(_SC_OPEN_MAX) + files=sysconf(_SC_OPEN_MAX); +#endif +#if defined(MAGICKCORE_HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE) + if (files < 0) + { + struct rlimit + resources; + + if (getrlimit(RLIMIT_NOFILE,&resources) != -1) + files=resources.rlim_cur; + } +#endif +#if defined(MAGICKCORE_HAVE_GETDTABLESIZE) && defined(MAGICKCORE_POSIX_SUPPORT) + if (files < 0) + files=getdtablesize(); +#endif + if (files < 0) + files=64; + (void) SetMagickResourceLimit(FileResource,MagickMax((unsigned long) + (3*files/4),64)); + limit=GetEnvironmentValue("MAGICK_FILE_LIMIT"); + if (limit == (char *) NULL) + limit=GetPolicyValue("file"); + if (limit != (char *) NULL) + { + (void) SetMagickResourceLimit(FileResource,StringToSizeType(limit,100.0)); + limit=DestroyString(limit); + } + (void) SetMagickResourceLimit(ThreadResource,GetOpenMPMaximumThreads()); + limit=GetEnvironmentValue("MAGICK_THREAD_LIMIT"); + if (limit == (char *) NULL) + limit=GetPolicyValue("thread"); + if (limit != (char *) NULL) + { + SetOpenMPMaximumThreads((unsigned long) atol(limit)); + (void) SetMagickResourceLimit(ThreadResource,StringToSizeType(limit, + 100.0)); + limit=DestroyString(limit); + } + limit=GetEnvironmentValue("MAGICK_TIME_LIMIT"); + if (limit == (char *) NULL) + limit=GetPolicyValue("time"); + if (limit != (char *) NULL) + { + (void) SetMagickResourceLimit(TimeResource,StringToSizeType(limit,100.0)); + limit=DestroyString(limit); + } + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ R e s o u r c e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ResourceComponentTerminus() destroys the resource component. +% +% The format of the ResourceComponentTerminus() method is: +% +% ResourceComponentTerminus(void) +% +*/ +MagickExport void ResourceComponentTerminus(void) +{ + AcquireSemaphoreInfo(&resource_semaphore); + if (temporary_resources != (SplayTreeInfo *) NULL) + temporary_resources=DestroySplayTree(temporary_resources); + if (random_info != (RandomInfo *) NULL) + random_info=DestroyRandomInfo(random_info); + RelinquishSemaphoreInfo(resource_semaphore); + DestroySemaphoreInfo(&resource_semaphore); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % S e t M a g i c k R e s o u r c e L i m i t % % % % % diff --git a/magick/resource_.h b/magick/resource_.h index ae8841bc2..3c7cfb14f 100644 --- a/magick/resource_.h +++ b/magick/resource_.h @@ -41,9 +41,9 @@ extern MagickExport int extern MagickExport MagickBooleanType AcquireMagickResource(const ResourceType,const MagickSizeType), - InstantiateResourcesComponent(void), ListMagickResourceInfo(FILE *,ExceptionInfo *), RelinquishUniqueFileResource(const char *), + ResourceComponentGenesis(void), SetMagickResourceLimit(const ResourceType,const MagickSizeType); extern MagickExport MagickSizeType @@ -51,9 +51,9 @@ extern MagickExport MagickSizeType GetMagickResourceLimit(const ResourceType); extern MagickExport void - AsynchronousDestroyResourceComponent(void), - DestroyResourceComponent(void), - RelinquishMagickResource(const ResourceType,const MagickSizeType); + AsynchronousResourceComponentTerminus(void), + RelinquishMagickResource(const ResourceType,const MagickSizeType), + ResourceComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/semaphore.c b/magick/semaphore.c index 6cc9e8287..2af57a323 100644 --- a/magick/semaphore.c +++ b/magick/semaphore.c @@ -195,33 +195,6 @@ MagickExport SemaphoreInfo *AllocateSemaphoreInfo(void) % % % % % % -% D e s t r o y S e m a p h o r e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroySemaphoreComponent() destroys the semaphore component. -% -% The format of the DestroySemaphoreComponent method is: -% -% DestroySemaphoreComponent(void) -% -*/ -MagickExport void DestroySemaphoreComponent(void) -{ -#if defined(MAGICKCORE_HAVE_PTHREAD) - if (pthread_mutex_destroy(&semaphore_mutex) != 0) - (void) fprintf(stderr,"pthread_mutex_destroy failed %s\n", - GetExceptionMessage(errno)); -#endif -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % D e s t r o y S e m a p h o r e I n f o % % % % % @@ -260,31 +233,6 @@ MagickExport void DestroySemaphoreInfo(SemaphoreInfo **semaphore_info) % % % % % % -% I n s t a n t i a t e S e m a p h o r e % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateSemaphoreComponent() instantiates the semaphore environment. -% -% The format of the InstantiateSemaphoreComponent method is: -% -% MagickBooleanType InstantiateSemaphoreComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateSemaphoreComponent(void) -{ - LockMagickMutex(); - UnlockMagickMutex(); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + L o c k M a g i c k M u t e x % % % % % @@ -410,6 +358,58 @@ MagickExport void RelinquishSemaphoreInfo(SemaphoreInfo *semaphore_info) % % % % % % +% S e m a p h o r e C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SemaphoreComponentGenesis() instantiates the semaphore environment. +% +% The format of the SemaphoreComponentGenesis method is: +% +% MagickBooleanType SemaphoreComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType SemaphoreComponentGenesis(void) +{ + LockMagickMutex(); + UnlockMagickMutex(); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% S e m a p h o r e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% SemaphoreComponentTerminus() destroys the semaphore component. +% +% The format of the SemaphoreComponentTerminus method is: +% +% SemaphoreComponentTerminus(void) +% +*/ +MagickExport void SemaphoreComponentTerminus(void) +{ +#if defined(MAGICKCORE_HAVE_PTHREAD) + if (pthread_mutex_destroy(&semaphore_mutex) != 0) + (void) fprintf(stderr,"pthread_mutex_destroy failed %s\n", + GetExceptionMessage(errno)); +#endif +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % + U n l o c k M a g i c k M u t e x % % % % % diff --git a/magick/semaphore.h b/magick/semaphore.h index 810a6afb1..c03eb3db4 100644 --- a/magick/semaphore.h +++ b/magick/semaphore.h @@ -26,8 +26,8 @@ typedef struct SemaphoreInfo SemaphoreInfo; extern MagickExport MagickBooleanType - InstantiateSemaphoreComponent(void), LockSemaphoreInfo(SemaphoreInfo *), + SemaphoreComponentGenesis(void), UnlockSemaphoreInfo(SemaphoreInfo *); extern MagickExport SemaphoreInfo @@ -35,9 +35,9 @@ extern MagickExport SemaphoreInfo extern MagickExport void AcquireSemaphoreInfo(SemaphoreInfo **), - DestroySemaphoreComponent(void), DestroySemaphoreInfo(SemaphoreInfo **), - RelinquishSemaphoreInfo(SemaphoreInfo *); + RelinquishSemaphoreInfo(SemaphoreInfo *), + SemaphoreComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/type.c b/magick/type.c index d599358ed..f400d59f0 100644 --- a/magick/type.c +++ b/magick/type.c @@ -133,34 +133,6 @@ static MagickBooleanType % % % % % % -+ D e s t r o y T y p e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyTypeComponent() destroy type component. -% -% The format of the DestroyTypeComponent method is: -% -% void DestroyTypeComponent(void) -% -*/ -MagickExport void DestroyTypeComponent(void) -{ - AcquireSemaphoreInfo(&type_semaphore); - if (type_list != (SplayTreeInfo *) NULL) - type_list=DestroySplayTree(type_list); - instantiate_type=MagickFalse; - RelinquishSemaphoreInfo(type_semaphore); - DestroySemaphoreInfo(&type_semaphore); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % + G e t T y p e I n f o % % % % % @@ -822,31 +794,6 @@ static MagickBooleanType InitializeTypeList(ExceptionInfo *exception) % % % % % % -+ I n s t a n t i a t e T y p e C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateTypeComponent() instantiates the type component. -% -% The format of the InstantiateTypeComponent method is: -% -% MagickBooleanType InstantiateTypeComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateTypeComponent(void) -{ - AcquireSemaphoreInfo(&type_semaphore); - RelinquishSemaphoreInfo(type_semaphore); - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % L i s t T y p e I n f o % % % % % @@ -1374,3 +1321,56 @@ static MagickBooleanType LoadTypeLists(const char *filename, return(status != 0 ? MagickTrue : MagickFalse); #endif } + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ T y p e C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% TypeComponentGenesis() instantiates the type component. +% +% The format of the TypeComponentGenesis method is: +% +% MagickBooleanType TypeComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType TypeComponentGenesis(void) +{ + AcquireSemaphoreInfo(&type_semaphore); + RelinquishSemaphoreInfo(type_semaphore); + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ T y p e C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% TypeComponentTerminus() destroy type component. +% +% The format of the TypeComponentTerminus method is: +% +% void TypeComponentTerminus(void) +% +*/ +MagickExport void TypeComponentTerminus(void) +{ + AcquireSemaphoreInfo(&type_semaphore); + if (type_list != (SplayTreeInfo *) NULL) + type_list=DestroySplayTree(type_list); + instantiate_type=MagickFalse; + RelinquishSemaphoreInfo(type_semaphore); + DestroySemaphoreInfo(&type_semaphore); +} diff --git a/magick/type.h b/magick/type.h index 597233ca5..61f7cea00 100644 --- a/magick/type.h +++ b/magick/type.h @@ -88,8 +88,8 @@ extern MagickExport char **GetTypeList(const char *,unsigned long *,ExceptionInfo *); extern MagickExport MagickBooleanType - InstantiateTypeComponent(void), - ListTypeInfo(FILE *,ExceptionInfo *); + ListTypeInfo(FILE *,ExceptionInfo *), + TypeComponentGenesis(void); extern MagickExport const TypeInfo *GetTypeInfo(const char *,ExceptionInfo *), @@ -98,7 +98,7 @@ extern MagickExport const TypeInfo **GetTypeInfoList(const char *,unsigned long *,ExceptionInfo *); MagickExport void - DestroyTypeComponent(void); + TypeComponentTerminus(void); #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/magick/xwindow-private.h b/magick/xwindow-private.h index f7d24903d..13a8a8eae 100644 --- a/magick/xwindow-private.h +++ b/magick/xwindow-private.h @@ -516,8 +516,8 @@ extern MagickExport int XError(Display *,XErrorEvent *); extern MagickExport MagickBooleanType - InstantiateXComponent(void), XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *), + XComponentGenesis(void), XDrawImage(Display *,const XPixelInfo *,XDrawInfo *,Image *), XGetWindowColor(Display *,XWindows *,char *), XMagickProgressMonitor(const char *,const MagickOffsetType, @@ -528,12 +528,12 @@ extern MagickExport MagickBooleanType XRemoteCommand(Display *,const char *,const char *); extern MagickExport void - DestroyXComponent(void), DestroyXResources(void), XBestIconSize(Display *,XWindowInfo *,Image *), XBestPixel(Display *,const Colormap,XColor *,unsigned int,XColor *), XCheckRefreshWindows(Display *,XWindows *), XClientMessage(Display *,const Window,const Atom,const Atom,const Time), + XComponentTerminus(void), XConfigureImageColormap(Display *,XResourceInfo *,XWindows *,Image *), XConstrainWindowPosition(Display *,XWindowInfo *), XDelay(Display *,const unsigned long), diff --git a/magick/xwindow.c b/magick/xwindow.c index 4eee99a87..e8ef46f4c 100644 --- a/magick/xwindow.c +++ b/magick/xwindow.c @@ -1622,6 +1622,52 @@ static Window XClientWindow(Display *display,Window target_window) % % % % % % ++ X C o m p o n e n t G e n e s i s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% XComponentGenesis() instantiates the X component. +% +% The format of the XComponentGenesis method is: +% +% MagickBooleanType XComponentGenesis(void) +% +*/ +MagickExport MagickBooleanType XComponentGenesis(void) +{ + return(MagickTrue); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % ++ X C o m p o n e n t T e r m i n u s % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% XComponentTerminus() destroys the module component. +% +% The format of the XComponentTerminus method is: +% +% XComponentTerminus(void) +% +*/ +MagickExport void XComponentTerminus(void) +{ + DestroyXResources(); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % % X C o n f i g u r e I m a g e C o l o r m a p % % % % % @@ -1790,29 +1836,6 @@ MagickExport void XDelay(Display *display,const unsigned long milliseconds) % % % % % % -+ D e s t r o y X C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% DestroyXComponent() destroys the module component. -% -% The format of the DestroyXComponent method is: -% -% DestroyXComponent(void) -% -*/ -MagickExport void DestroyXComponent(void) -{ - DestroyXResources(); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % X D e s t r o y R e s o u r c e I n f o % % % % % @@ -5261,29 +5284,6 @@ MagickExport XWindows *XInitializeWindows(Display *display, % % % % % % -+ I n s t a n t i a t e X C o m p o n e n t % -% % -% % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% InstantiateXComponent() instantiates the X component. -% -% The format of the InstantiateXComponent method is: -% -% MagickBooleanType InstantiateXComponent(void) -% -*/ -MagickExport MagickBooleanType InstantiateXComponent(void) -{ - return(MagickTrue); -} - -/* -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% % -% % % X M a k e C u r s o r % % % % % -- 2.40.0