From 4777498cc4bfd9e89f72e21ee6b4fdefc373d355 Mon Sep 17 00:00:00 2001 From: cristy Date: Tue, 15 Feb 2011 15:17:19 +0000 Subject: [PATCH] --- ChangeLog | 5 +- www/command-line-options.html | 10 +- www/command-line-processing.html | 4 +- www/source/contrast.c | 106 ++ www/source/core/sigmoidal-contrast.c | 116 ++ www/source/francais.xml | 1508 ++++++++++++++++++++++++++ www/source/mgk.c | 450 ++++++++ www/source/mime.xml | 1141 +++++++++++++++++++ www/source/policy.xml | 57 + www/source/thresholds.xml | 237 ++++ www/source/type-windows.xml | 102 ++ www/source/wand/sigmoidal-contrast.c | 106 ++ 12 files changed, 3834 insertions(+), 8 deletions(-) create mode 100644 www/source/contrast.c create mode 100644 www/source/core/sigmoidal-contrast.c create mode 100644 www/source/francais.xml create mode 100644 www/source/mgk.c create mode 100644 www/source/mime.xml create mode 100644 www/source/policy.xml create mode 100644 www/source/thresholds.xml create mode 100644 www/source/type-windows.xml create mode 100644 www/source/wand/sigmoidal-contrast.c diff --git a/ChangeLog b/ChangeLog index 49ac773db..50b00f837 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,7 @@ -2011-01-25 6.6.7-8 Glenn Randers-Pehrson +2011-02-15 6.6.7-8 Cristy + * New version 6.6.7-8. + +2011-02-14 6.6.7-8 Glenn Randers-Pehrson * The PNG encoder should ignore bogus q->opacity values when image->matte is MagickFalse (reference http://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=18067). diff --git a/www/command-line-options.html b/www/command-line-options.html index 2568406d9..2fe458ec9 100644 --- a/www/command-line-options.html +++ b/www/command-line-options.html @@ -599,7 +599,7 @@ negative results without clipping to the color value range (0..QuantumRange).

See the discussion on HDRI implementations of ImageMagick on the page -High Dynamic-Range Images. For more about HDRI go the ImageMagick Usage pages or this Wikipedia entry. +High Dynamic-Range Images. For more about HDRI go the ImageMagick Usage pages or this Wikipedia entry.

@@ -1529,7 +1529,7 @@ detection. Without an output bias, the negative values is clipped at zero.

When using an ImageMagick with the HDRI compile-time setting, ‑bias is not needed, as ImageMagick is able to store/handle any negative results without clipping to the color value range (0..QuantumRange). See the discussion on HDRI implementations of ImageMagick on the page High +href="../www/high-dynamic-range.html">High Dynamic-Range Images. For more about HDRI go the ImageMagick Usage pages or this Wikipedia @@ -2806,7 +2806,7 @@ equivalent to:

The real and imaginary component images resulting from +fft is also square, even dimensioned images due to the same padding that was discussed above for the magnitude and phase component images.

See the discussion on HDRI implementations of ImageMagick on the page -High Dynamic-Range Images. For more about HDRI go the ImageMagick Usage pages or this Wikipedia entry. +High Dynamic-Range Images. For more about HDRI go the ImageMagick Usage pages or this Wikipedia entry.

@@ -3026,7 +3026,7 @@ is a TrueType font file, ps:helvetica is PostScript font, and
the image format type.
-

When used with the mogrify utility, this option converts any image to the image format you specify. For a list of image format types supported by ImageMagick, use -list format.

+

When used with the mogrify utility, this option converts any image to the image format you specify. For a list of image format types supported by ImageMagick, use -list format.

By default the file is written to its original name. However, if the filename extension matches a supported format, the extension is replaced with the image format type specified with -format. For example, if you specify tiff as the format type and the input image filename is image.gif, the output image filename becomes image.tiff.

@@ -3407,7 +3407,7 @@ mapping.

This information is printed: image scene number; image name; image size; the image class (DirectClass or PseudoClass); the total number of unique colors; and the number of seconds to read and transform the image. Refer to MIFF for a description of the image class.

-

If -colors is also specified, the total unique colors in the image and color reduction error values are printed. Refer to color reduction algorithm for a description of these values.

+

If -colors is also specified, the total unique colors in the image and color reduction error values are printed. Refer to color reduction algorithm for a description of these values.

If -verbose precedes this option, copious amounts of image properties are displayed including image statistics, profiles, diff --git a/www/command-line-processing.html b/www/command-line-processing.html index 5b4b3863c..ff22a60ab 100644 --- a/www/command-line-processing.html +++ b/www/command-line-processing.html @@ -259,7 +259,7 @@ convert -size 320x90 xc:none -stroke snow4 -size 1x90 -tile gradient:white-snow4

  • zero or one output image filenames (required by convert, composite, -montage.html, +montage.html, compare, import, conjure). @@ -475,7 +475,7 @@ is reset or the command line terminates. The image settings include:

    An image operator differs from a setting in that it affects the image immediately as it appears on the command line. An operator is -any command line option +any command line option not listed as a image setting or image sequence operator. Unlike an image setting, which persists until the command line terminates, diff --git a/www/source/contrast.c b/www/source/contrast.c new file mode 100644 index 000000000..c7c204353 --- /dev/null +++ b/www/source/contrast.c @@ -0,0 +1,106 @@ +#include +#include +#include +#include + +int main(int argc,char **argv) +{ +#define QuantumScale ((MagickRealType) 1.0/(MagickRealType) QuantumRange) +#define SigmoidalContrast(x) \ + (QuantumRange*(1.0/(1+exp(10.0*(0.5-QuantumScale*x)))-0.0066928509)*1.0092503) +#define ThrowWandException(wand) \ +{ \ + char \ + *description; \ + \ + ExceptionType \ + severity; \ + \ + description=MagickGetException(wand,&severity); \ + (void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description); \ + description=(char *) MagickRelinquishMemory(description); \ + exit(-1); \ +} + + MagickBooleanType + status; + + MagickPixelPacket + pixel; + + MagickWand + *contrast_wand, + *image_wand; + + PixelIterator + *contrast_iterator, + *iterator; + + PixelWand + **contrast_pixels, + **pixels; + + register ssize_t + x; + + size_t + width; + + ssize_t + y; + + if (argc != 3) + { + (void) fprintf(stdout,"Usage: %s image sigmoidal-image\n",argv[0]); + exit(0); + } + /* + Read an image. + */ + MagickWandGenesis(); + image_wand=NewMagickWand(); + status=MagickReadImage(image_wand,argv[1]); + if (status == MagickFalse) + ThrowWandException(image_wand); + contrast_wand=CloneMagickWand(image_wand); + /* + Sigmoidal non-linearity contrast control. + */ + iterator=NewPixelIterator(image_wand); + contrast_iterator=NewPixelIterator(contrast_wand); + if ((iterator == (PixelIterator *) NULL) || + (contrast_iterator == (PixelIterator *) NULL)) + ThrowWandException(image_wand); + for (y=0; y < (ssize_t) MagickGetImageHeight(image_wand); y++) + { + pixels=PixelGetNextIteratorRow(iterator,&width); + contrast_pixels=PixelGetNextIteratorRow(contrast_iterator,&width); + if ((pixels == (PixelWand **) NULL) || + (contrast_pixels == (PixelWand **) NULL)) + break; + for (x=0; x < (ssize_t) width; x++) + { + PixelGetMagickColor(pixels[x],&pixel); + pixel.red=SigmoidalContrast(pixel.red); + pixel.green=SigmoidalContrast(pixel.green); + pixel.blue=SigmoidalContrast(pixel.blue); + pixel.index=SigmoidalContrast(pixel.index); + PixelSetMagickColor(contrast_pixels[x],&pixel); + } + (void) PixelSyncIterator(contrast_iterator); + } + if (y < (ssize_t) MagickGetImageHeight(image_wand)) + ThrowWandException(image_wand); + contrast_iterator=DestroyPixelIterator(contrast_iterator); + iterator=DestroyPixelIterator(iterator); + image_wand=DestroyMagickWand(image_wand); + /* + Write the image then destroy it. + */ + status=MagickWriteImages(contrast_wand,argv[2],MagickTrue); + if (status == MagickFalse) + ThrowWandException(image_wand); + contrast_wand=DestroyMagickWand(contrast_wand); + MagickWandTerminus(); + return(0); +} diff --git a/www/source/core/sigmoidal-contrast.c b/www/source/core/sigmoidal-contrast.c new file mode 100644 index 000000000..cc33070c0 --- /dev/null +++ b/www/source/core/sigmoidal-contrast.c @@ -0,0 +1,116 @@ +#include +#include +#include +#include + +static MagickBooleanType SigmoidalContrast(ImageView *contrast_view, + const ssize_t y,const int id,void *context) +{ +#define QuantumScale ((MagickRealType) 1.0/(MagickRealType) QuantumRange) +#define SigmoidalContrast(x) \ + (QuantumRange*(1.0/(1+exp(10.0*(0.5-QuantumScale*x)))-0.0066928509)*1.0092503) + + RectangleInfo + extent; + + register IndexPacket + *indexes; + + register PixelPacket + *pixels; + + register ssize_t + x; + + extent=GetImageViewExtent(contrast_view); + pixels=GetImageViewAuthenticPixels(contrast_view); + for (x=0; x < (ssize_t) (extent.width-extent.height); x++) + { + pixels[x].red=RoundToQuantum(SigmoidalContrast(pixels[x].red)); + pixels[x].green=RoundToQuantum(SigmoidalContrast(pixels[x].green)); + pixels[x].blue=RoundToQuantum(SigmoidalContrast(pixels[x].blue)); + pixels[x].opacity=RoundToQuantum(SigmoidalContrast(pixels[x].opacity)); + } + indexes=GetImageViewAuthenticIndexes(contrast_view); + if (indexes != (IndexPacket *) NULL) + for (x=0; x < (ssize_t) (extent.width-extent.height); x++) + indexes[x]=(IndexPacket) RoundToQuantum(SigmoidalContrast(indexes[x])); + return(MagickTrue); +} + +int main(int argc,char **argv) +{ +#define ThrowImageException(image) \ +{ \ + \ + CatchException(exception); \ + if (contrast_image != (Image *) NULL) \ + contrast_image=DestroyImage(contrast_image); \ + exit(-1); \ +} +#define ThrowViewException(view) \ +{ \ + char \ + *description; \ + \ + ExceptionType \ + severity; \ + \ + description=GetImageViewException(view,&severity); \ + (void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description); \ + description=(char *) MagickRelinquishMemory(description); \ + exit(-1); \ +} + + ExceptionInfo + *exception; + + Image + *contrast_image; + + ImageInfo + *image_info; + + ImageView + *contrast_view; + + MagickBooleanType + status; + + if (argc != 3) + { + (void) fprintf(stdout,"Usage: %s image sigmoidal-image\n",argv[0]); + exit(0); + } + /* + Read an image. + */ + MagickCoreGenesis(*argv,MagickTrue); + image_info=AcquireImageInfo(); + (void) CopyMagickString(image_info->filename,argv[1],MaxTextExtent); + exception=AcquireExceptionInfo(); + contrast_image=ReadImage(image_info,exception); + if (contrast_image == (Image *) NULL) + ThrowImageException(contrast_image); + /* + Sigmoidal non-linearity contrast control. + */ + contrast_view=NewImageView(contrast_image); + if (contrast_view == (ImageView *) NULL) + ThrowImageException(contrast_image); + status=UpdateImageViewIterator(contrast_view,SigmoidalContrast,(void *) NULL); + if (status == MagickFalse) + ThrowImageException(contrast_image); + contrast_view=DestroyImageView(contrast_view); + /* + Write the image then destroy it. + */ + status=WriteImages(image_info,contrast_image,argv[2],exception); + if (status == MagickFalse) + ThrowImageException(contrast_image); + contrast_image=DestroyImage(contrast_image); + exception=DestroyExceptionInfo(exception); + image_info=DestroyImageInfo(image_info); + MagickCoreTerminus(); + return(0); +} diff --git a/www/source/francais.xml b/www/source/francais.xml new file mode 100644 index 000000000..d83588415 --- /dev/null +++ b/www/source/francais.xml @@ -0,0 +1,1508 @@ + + + + + + + + + +]> + + + + + + impossible d'ouvrir l'image + + + impossible d'ouvrir le fichier + + + impossible de lire un blob + + + impossible d'écrire un blob + + + format d'image non reconnu + + + blob de taille nulle non autorisé + + + + + + + Ressources du cache épuisées + + + profondeur du cache persistant inconsistante + + + pas de pixels définis dans le cache + + + cache pixels non ouvert + + + pixels are not authentic + + + impossible de clôner le cache + + + impossible d'étendre le cache + + + impossible de récupérer le nexus du cache + + + impossible d'ouvrir le cache + + + impossible de rendre persistant le cache pixels + + + impossible de lire le cache pixels + + + + + échec allocation cache view + + + + + + + table de couleurs non supportée + + + espace colorimétrique non supporté + + + schéma d'encodage de données non supporté + + + type de stockage de données non supporté + + + delta-PNG non supporté + + + image WPG encryptée non supportée + + + compression Fractal non supportée + + + nombre de lignes ou de colonnes dans l'image non supporté + + + image sans masque de coupe + + + image sans vignette EXIF + + + l'image n'a pas de canal de transparence + + + l'image n'a pas tiled + + + irregular channel geometry not supported + + + compression JNG non supportée + + + compression JPEG non supportée + + + Échec incorporation JPEG + + + Type d'emplacement non supporté + + + Map storage type is not supported + + + Matrices multi-dimensionnelles non supportées + + + Liste à enregistrements multiples non supportée + + + pas de bitmap dans le presse-papier + + + pas de données APP1 disponibles + + + pas de données 8BIM disponibles + + + pas de profil colorimétrique disponible + + + aucune donnée fournie + + + pas d'image en graphique vectoriel; unable to generate SVG + + + pas de profil IPTC disponible + + + nombre d'images non supporté + + + seules les images à tons continus sont supportées + + + seuls les fichiers de niveau zéro sont supportés + + + compression PNG non supportée + + + compression RLE non supportée + + + impossible de copier le profil + + + impossible de créer la bitmap + + + impossible de créer un DC + + + impossible de décompresser l'image + + + impossible d'écrire les paramètres MPEG + + + impossible de compresser l'image en zip + + + Fichier image RLE non supporté + + + compression ZIP non supportée + + + + + Conversion JPEG sans perte vers JPEG avec perte + + + + + + + trop de niveau d'inclusion d'éléments + + + + + impossible d'accéder au fichier de configuration + + + impossible d'ouvrir le fichier de module + + + + + + + + Une erreur est survenue lors de la lecture du fichier + + + Une erreur est survenue lors de l'écriture dans un fichier + + + cipher support not enabled + + + Table de couleurs a plus que 256 couleurs + + + Image corrompue + + + erreur sur la version du format de fichier + + + profondeur d'image non supportée + + + le fichier image ne contient pas de données d'image + + + type d'image non supporté + + + En-tête d'image incorrect + + + Pas assez de données d'image dans le fichier + + + Index dans la table de couleurs invalide + + + Pixel invalide + + + Longueur et taille du fichier ne correspondent pas + + + maximum de canals dépassent les + + + Taille d'image négative ou nulle + + + Taille en-tête BMP non-OS2 plus petite que 40 + + + Pas assez de données pixel + + + Pas assez de tuiles trouvées à ce niveau + + + Trop de données d'image dans le fichier + + + Valeur statique des plans différente de 1 + + + impossible de lire le bloc d'extension + + + impossible de lire l'en-tête de l'image + + + impossible de lire les données de l'image + + + impossible de décoder l'image avec « runlength » + + + impossible de décompresser l'image + + + Fin de fichier inattendue + + + Facteur d'échantillonnage inattendu + + + Type de motif inconnu + + + bits par pixel non reconnus + + + compression non reconnue + + + nombre de couleurs non reconnu + + + + + impossible de rendre la clé persistante + + + + + Image PCD corrompue, saut à l'octet de synchronisation + + + + + + + + Échec de la délégation + + + Impossible de calculer la taille en sortie + + + Impossible de générer le fichier + + + Impossible de lire le fichier + + + pas de balise trouvée + + + Échec délégation PCL + + + Échec délégation Postscript + + + impossible de créer l'image + + + impossible de décoder le fichier d'image + + + impossible d'encoder le fichier d'image + + + impossible d'initialiser la librairie FPX + + + impossible d'initialiser la librairie WMF + + + impossible de gérer un flux JP2 + + + impossible de lire le ratio d'aspect + + + impossible de lire le résumé des informations + + + impossible de fixer la matrice affine + + + impossible de fixer le ratio d'aspect + + + impossible de fixer la torsion de couleur + + + impossible de fixer le contraste + + + impossible de fixer la valeur du filtre + + + impossible de fixer le titre de l'image + + + impossible de fixer le niveau JPEG + + + impossible de fixer la zone d'intérêt + + + impossible de fixer le résumé des informations + + + impossible d'écrire au format SVG + + + Échec délégation XPS + + + + + + + Définition de motif déjà fixée + + + Définition de primitive de dessin non conforme + + + URL non relative + + + Actuellement pas de définition de motif + + + Débordement pile de segments + + + Trop de coordonnées bézier + + + impossible d'imprimer + + + erreur d'imbrication des contextes graphiques + + + URL inaccessible + + + + + + + + impossible de créer un fichier temporaire + + + impossible d'ouvrir le fichier + + + impossible d'enregistrer le fichier + + + + + + + + angle discontinu + + + Image avec table de couleurs requise + + + Image avec couleurs séparées requise + + + Le profil colorimétrique ne peut fonctionner que dans un autre espace colorimétrique + + + différences dans les espaces colorimétriques de l'image + + + profondeur d'image non supportée + + + une séquence d'images est requise + + + différences dans la taille de l'image + + + différences dans les tailles des images gauche et droite + + + Taille d'image négative ou nulle + + + aucune image trouvée + + + aucune image chargée + + + trop de grappes + + + impossible de créer la transformation de couleurs + + + Largeur ou hauteur dépassent les limites + + + + + + + + delegate library support not built-in + + + pas de délégué pour décoder ce format d'image + + + pas de délégué pour encoder ce format d'image + + + + + delegate library support not built-in + + + + + + + + image coder signature mismatch + + + image filter signature mismatch + + + impossible de charger le module + + + impossible d'enregister le format d'image + + + + + impossible d'initialiser le chargeur de module + + + + + impossible de fermer le module + + + + + + + + impossible de trouver l'identifiant de registre + + + impossible de fixer le registre + + + + + + + + Échec allocation du cache pixel + + + Échec allocation mémoire + + + échec acquisition de la chaine + + + échec allocation table de couleurs + + + échec conversion police de caractères + + + échec création table de couleurs + + + échec tramage de l'image + + + impossible de cloner les informations du paquet + + + impossible de récupérer les informations du paquet + + + + + impossible d'allouer le motif de traits + + + échec d'allocation des dérivées + + + échec allocation table gamma + + + échec allocation image + + + échec allocation pixels de l'image + + + échec allocation informations sémaphore + + + échec allocation chaine + + + Échec allocation mémoire + + + impossible de concatener la chaine + + + impossible de convertir le texte + + + impossible de créer la table de couleurs + + + impossible de cloner l'image + + + impossible d'afficher l'image + + + impossible de rendre la chaine compatible + + + impossible d'interpréter l'image MSL + + + + + échec allocation mémoire + + + + + + + + substitution de police de caractères nécessaire + + + impossible de déterminer le type de métriques + + + impossible d'initialiser la librairie freetype + + + impossible de lire la police de caractères + + + encodage de la police de caractères non reconnu + + + + + impossible de lire la police de caractères + + + + + + + l'image de contient pas la géométrie du flux + + + pas de gestionnaire de flux défini + + + Cache pixel non ouvert + + + + + + + index invalide dans la table de couleurs + + + région de taille nulle + + + impossible d'ouvrir le fichier + + + la profondeur du quantum pour Wand ne correspond pas à celle de l'API principale + + + Pas d'images pour Wand + + + Pas d'itérateur pour Wand + + + + + + + couleur inconnue du serveur + + + aucune fenêtre avec l'ID spécifié + + + la table de couleurs standard n'est pas initialisée + + + impossible de se connecter au display distant + + + impossible de créer la bitmap + + + impossible de créer la table de couleurs + + + impossible de créer la pixmap + + + impossible de créer la propriété + + + impossible de créer la table de couleurs standard + + + impossible d'afficher les informations de l'image + + + impossible de récupérer la propriété + + + impossible de récupérer la table de couleurs standard + + + impossible de récupérer le visuel + + + unable to grab mouse + + + impossible de charger la police de caractères + + + impossible d'établir la correspondance entre le visuel et la table de couleurs standard + + + impossible de se connecter au serveur X + + + impossible de lire les attributs de la fenêtre X + + + impossible de lire l'image de la fenêtre X + + + type de table de couleurs non reconnnu + + + type de gravité non reconnu + + + spécification de visuel non reconnue + + + + + impossible de créer le curseur X + + + impossible de créer le contexte graphique + + + impossible de créer la table de couleurs standard + + + impossible de créer le propriété texte + + + impossible de créer la fenêtre X + + + impossible de créer l'image X + + + impossible de créer la pixmap X + + + impossible d'afficher l'image + + + impossible de récupérer le visuel + + + impossible de récupérer les informations de pixel + + + impossible de charger la police de caractères + + + impossible de créer la fenêtre X + + + impossible de se connecter au serveur X + + + impossible d'afficher les polices de caractères + + + + + utilisation du visuel par défaut + + + impossible de récupérer le visuel + + + + + + + + Ajouter du bruit à l'image + + + + + Ajouter à la séquence d'images + + + + + Affecter les couleurs de l'image + + + + + Moyenner la séquence d'images + + + + + Cisailler l'image + + + + + Classifier les couleurs de l'image + + + + + Remplacer une couleur dans l'image + + + + + Coloriser l'image + + + + + Combiner l'image + + + + + Contrast-stretch l'image + + + + + Convolution de l'image + + + + + Couper une zone rectangulaire de l'image + + + + + Décoder l'image + + + + + Flou intérieur de l'image + + + + + Distortion de l'image + + + + + Tramer les couleurs de l'image + + + + + Réduire le brillant du contraste de l'image + + + + + Egaliser l'image + + + + + Réflection verticale de l'image + + + + + Réflection horizontale de l'image + + + + + Ajouter un cadre à l'image + + + + + Appliquer une expression mathématique à l'image + + + + + Correction gamma de l'image + + + + + Calculer l'histogramme de l'image + + + + + Condenser les pixels de l'image autour du centre + + + + + Ajuster le niveau de contraste de l'image + + + + + Charger l'image + + + Charger les images + + + + + Magnfiy image + + + + + Filter image with neighborhood ranking + + + + + Minify image + + + + + Modulate image + + + + + Mogrify image + + + + + Montage image + + + + + Morphing de la séquence d'images + + + + + Mosaic image + + + + + Negate image + + + + + Effet peinture à l'huile pour l'image + + + + + Fixer la couleur opage dans l'image + + + + + Plasma image + + + + + Aperçu de l'image + + + + + Raise image + + + + + Re-coloriser une image couleur + + + + + Réduire le nombre de couleurs de l'image + + + + + Réduire le bruit de l'image + + + + + Render image + + + + + Redimensionner l'image + + + + + Transformation RVB de l'image + + + + + Roll image + + + + + Rotation de l'image + + + + + Sample image + + + + + Enregistrer l'image + + + Enregistrer les images + + + + + Échelle de l'image + + + + + Segmenter l'image + + + + + Extraire un canal de l'image + + + + + Effet ton sépia pour l'image + + + + + Ombrer l'image + + + + + Augmenter la netteté de l'image + + + + + Augmenter la netteté du contraste de l'image + + + + + Sigmoidal contrast image + + + + + Effet solariation pour l'image + + + + + Splice image + + + + + Spread image + + + + + Effet stégano pour l'image + + + + + Effet stéréo pour l'image + + + + + Swirl image + + + + + Texturer l'image + + + + + Appliquer un seuil à l'image + + + + + Effet tuiles pour l'image + + + + + Tint image + + + + + Transformation RVB de l'image + + + + + Choisir la couleur transparente dans l'image + + + + + Effet vagues pour l'image + + + + + X Shear image + + + + + Y Shear image + + + + diff --git a/www/source/mgk.c b/www/source/mgk.c new file mode 100644 index 000000000..11754c007 --- /dev/null +++ b/www/source/mgk.c @@ -0,0 +1,450 @@ +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% M M GGGG K K % +% MM MM G K K % +% M M M G GG KKK % +% M M G G K K % +% M M GGG K K % +% % +% % +% Read/Write MGK Image Format. % +% % +% Software Design % +% John Cristy % +% July 1992 % +% % +% % +% Copyright 1999-2011 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 "magick/studio.h" +#include "magick/blob.h" +#include "magick/blob-private.h" +#include "magick/cache.h" +#include "magick/colorspace.h" +#include "magick/exception.h" +#include "magick/exception-private.h" +#include "magick/image.h" +#include "magick/image-private.h" +#include "magick/list.h" +#include "magick/magick.h" +#include "magick/memory_.h" +#include "magick/monitor.h" +#include "magick/monitor-private.h" +#include "magick/quantum-private.h" +#include "magick/static.h" +#include "magick/string_.h" +#include "magick/module.h" + +/* + Forward declarations. +*/ +static MagickBooleanType + WriteMGKImage(const ImageInfo *,Image *); + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% I s M G K % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% IsMGK() returns MagickTrue if the image format type, identified by the +% magick string, is MGK. +% +% The format of the IsMGK method is: +% +% MagickBooleanType IsMGK(const unsigned char *magick,const size_t length) +% +% A description of each parameter follows: +% +% o magick: This string is generally the first few bytes of an image file +% or blob. +% +% o length: Specifies the length of the magick string. +% +*/ +static MagickBooleanType IsMGK(const unsigned char *magick,const size_t length) +{ + if (length < 7) + return(MagickFalse); + if (LocaleNCompare((char *) magick,"id=mgk",7) == 0) + return(MagickTrue); + return(MagickFalse); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% R e a d M G K I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ReadMGKImage() reads a MGK 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 ReadMGKImage method is: +% +% Image *ReadMGKImage(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 Image *ReadMGKImage(const ImageInfo *image_info, + ExceptionInfo *exception) +{ + char + buffer[MaxTextExtent]; + + Image + *image; + + MagickBooleanType + status; + + register ssize_t + x; + + register PixelPacket + *q; + + register unsigned char + *p; + + ssize_t + count, + y; + + size_t + columns, + rows; + + unsigned char + *pixels; + + /* + 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); + } + /* + Read MGK image. + */ + (void) ReadBlobString(image,buffer); /* read magic number */ + if (IsMGK(buffer,7) == MagickFalse) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + (void) ReadBlobString(image,buffer); + count=(ssize_t) sscanf(buffer,"%lu %lu\n",&columns,&rows); + if (count <= 0) + ThrowReaderException(CorruptImageError,"ImproperImageHeader"); + do + { + /* + Initialize image structure. + */ + image->columns=columns; + image->rows=rows; + image->depth=8; + if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0)) + if (image->scene >= (image_info->scene+image_info->number_scenes-1)) + break; + /* + Convert MGK raster image to pixel packets. + */ + if (SetImageExtent(image,0,0) == MagickFalse) + { + InheritException(exception,&image->exception); + return(DestroyImageList(image)); + } + pixels=(unsigned char *) AcquireQuantumMemory((size_t) image->columns, + 3UL*sizeof(*pixels)); + if (pixels == (unsigned char *) NULL) + ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + for (y=0; y < (ssize_t) image->rows; y++) + { + count=(ssize_t) ReadBlob(image,(size_t) (3*image->columns),pixels); + if (count != (ssize_t) (3*image->columns)) + ThrowReaderException(CorruptImageError,"UnableToReadImageData"); + p=pixels; + q=QueueAuthenticPixels(image,0,y,image->columns,1,exception); + if (q == (PixelPacket *) NULL) + break; + for (x=0; x < (ssize_t) image->columns; x++) + { + q->red=ScaleCharToQuantum(*p++); + q->green=ScaleCharToQuantum(*p++); + q->blue=ScaleCharToQuantum(*p++); + q++; + } + if (SyncAuthenticPixels(image,exception) == MagickFalse) + break; + if ((image->previous == (Image *) NULL) && + (SetImageProgress(image,LoadImageTag,y,image->rows) == MagickFalse)) + break; + } + pixels=(unsigned char *) RelinquishMagickMemory(pixels); + if (EOFBlob(image) != MagickFalse) + { + ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile", + image->filename); + break; + } + /* + Proceed to next image. + */ + if (image_info->number_scenes != 0) + if (image->scene >= (image_info->scene+image_info->number_scenes-1)) + break; + *buffer='\0'; + (void) ReadBlobString(image,buffer); + count=(ssize_t) sscanf(buffer,"%lu %lu\n",&columns,&rows); + if (count > 0) + { + /* + Allocate next image structure. + */ + AcquireNextImage(image_info,image); + if (GetNextImageInList(image) == (Image *) NULL) + { + image=DestroyImageList(image); + return((Image *) NULL); + } + image=SyncNextImageInList(image); + if (image->progress_monitor != (MagickProgressMonitor) NULL) + { + status=SetImageProgress(image,LoadImageTag,TellBlob(image), + GetBlobSize(image)); + if (status == MagickFalse) + break; + } + } + } while (count > 0); + (void) CloseBlob(image); + return(GetFirstImageInList(image)); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% R e g i s t e r M G K I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% RegisterMGKImage() adds attributes for the MGK image format to +% the list of supported formats. The attributes 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 RegisterMGKImage method is: +% +% size_t RegisterMGKImage(void) +% +*/ +ModuleExport size_t RegisterMGKImage(void) +{ + MagickInfo + *entry; + + entry=SetMagickInfo("MGK"); + entry->decoder=(DecodeImageHandler *) ReadMGKImage; + entry->encoder=(EncodeImageHandler *) WriteMGKImage; + entry->magick=(IsImageFormatHandler *) IsMGK; + entry->description=ConstantString("MGK"); + entry->module=ConstantString("MGK"); + (void) RegisterMagickInfo(entry); + return(MagickImageCoderSignature); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% U n r e g i s t e r M G K I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% UnregisterMGKImage() removes format registrations made by the +% MGK module from the list of supported formats. +% +% The format of the UnregisterMGKImage method is: +% +% UnregisterMGKImage(void) +% +*/ +ModuleExport void UnregisterMGKImage(void) +{ + (void) UnregisterMagickInfo("MGK"); +} + +/* +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% % +% % +% W r i t e M G K I m a g e % +% % +% % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% WriteMGKImage() writes an image to a file in red, green, and blue +% MGK rasterfile format. +% +% The format of the WriteMGKImage method is: +% +% MagickBooleanType WriteMGKImage(const ImageInfo *image_info, +% Image *image) +% +% A description of each parameter follows. +% +% o image_info: the image info. +% +% o image: The image. +% +*/ +static MagickBooleanType WriteMGKImage(const ImageInfo *image_info, + Image *image) +{ + char + buffer[MaxTextExtent]; + + MagickBooleanType + status; + + MagickOffsetType + scene; + + register const PixelPacket + *p; + + register ssize_t + x; + + register unsigned char + *q; + + ssize_t + y; + + unsigned char + *pixels; + + /* + Open output image file. + */ + assert(image_info != (const ImageInfo *) NULL); + assert(image_info->signature == MagickSignature); + assert(image != (Image *) NULL); + assert(image->signature == MagickSignature); + if (image->debug != MagickFalse) + (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename); + status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception); + if (status == MagickFalse) + return(status); + scene=0; + do + { + /* + Allocate memory for pixels. + */ + if (image->colorspace != RGBColorspace) + (void) SetImageColorspace(image,RGBColorspace); + pixels=(unsigned char *) AcquireQuantumMemory((size_t) image->columns, + 3UL*sizeof(*pixels)); + if (pixels == (unsigned char *) NULL) + ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed"); + /* + Initialize raster file header. + */ + (void) WriteBlobString(image,"id=mgk\n"); + (void) FormatMagickString(buffer,MaxTextExtent,"%lu %lu\n",image->columns, + image->rows); + (void) WriteBlobString(image,buffer); + for (y=0; y < (ssize_t) image->rows; y++) + { + p=AcquireImagePixels(image,0,y,image->columns,1,&image->exception); + if (p == (const PixelPacket *) NULL) + break; + q=pixels; + for (x=0; x < (ssize_t) image->columns; x++) + { + *q++=ScaleQuantumToChar(GetRedSample(p)); + *q++=ScaleQuantumToChar(GetGreenSample(p)); + *q++=ScaleQuantumToChar(GetBlueSample(p)); + p++; + } + (void) WriteBlob(image,(size_t) (q-pixels),pixels); + if ((image->previous == (Image *) NULL) && + (SetImageProgress(image,SaveImageTag,y,image->rows) == MagickFalse)) + break; + } + pixels=(unsigned char *) RelinquishMagickMemory(pixels); + if (GetNextImageInList(image) == (Image *) NULL) + break; + image=SyncNextImageInList(image); + status=SetImageProgress(image,SaveImagesTag,scene, + GetImageListLength(image)); + if (status == MagickFalse) + break; + scene++; + } while (image_info->adjoin != MagickFalse); + (void) CloseBlob(image); + return(MagickTrue); +} diff --git a/www/source/mime.xml b/www/source/mime.xml new file mode 100644 index 000000000..4dd55f293 --- /dev/null +++ b/www/source/mime.xml @@ -0,0 +1,1141 @@ + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/www/source/policy.xml b/www/source/policy.xml new file mode 100644 index 000000000..ddc3da571 --- /dev/null +++ b/www/source/policy.xml @@ -0,0 +1,57 @@ + + + + + + + + +]> + + + + + + + + + + + + + diff --git a/www/source/thresholds.xml b/www/source/thresholds.xml new file mode 100644 index 000000000..a55bb0ad0 --- /dev/null +++ b/www/source/thresholds.xml @@ -0,0 +1,237 @@ + + + + + + + + + +]> + + + + + + Threshold Non-Dither + + 1 + + + + + Checkerboard Dither + + 1 2 + 2 1 + + + + + + Ordered 2x2 Diffused Pixel + + 1 3 + 4 2 + + + + + Ordered 4x4 Diffused Pixel + + 3 7 4 + 6 1 9 + 2 8 5 + + + + + + Ordered 4x4 Diffused Pixel + + 1 9 3 11 + 13 5 15 7 + 4 12 2 10 + 16 8 14 6 + + + + + + Ordered 8x8 Diffused Pixel + + 1 49 13 61 4 52 16 64 + 33 17 45 29 36 20 48 32 + 9 57 5 53 12 60 8 56 + 41 25 37 21 44 28 40 24 + 3 51 15 63 2 50 14 62 + 35 19 47 31 34 18 46 30 + 11 59 7 55 10 58 6 54 + 43 27 39 23 42 26 38 22 + + + + + + Halftone 4x4 (angled) + + 4 2 7 5 + 3 1 8 6 + 7 5 4 2 + 8 6 3 1 + + + + + Halftone 6x6 (angled) + + 14 13 10 8 2 3 + 16 18 12 7 1 4 + 15 17 11 9 6 5 + 8 2 3 14 13 10 + 7 1 4 16 18 12 + 9 6 5 15 17 11 + + + + + Halftone 8x8 (angled) + + 13 7 8 14 17 21 22 18 + 6 1 3 9 28 31 29 23 + 5 2 4 10 27 32 30 24 + 16 12 11 15 20 26 25 19 + 17 21 22 18 13 7 8 14 + 28 31 29 23 6 1 3 9 + 27 32 30 24 5 2 4 10 + 20 26 25 19 16 12 11 15 + + + + + + Halftone 4x4 (orthogonal) + + 7 13 11 4 + 12 16 14 8 + 10 15 6 2 + 5 9 3 1 + + + + + Halftone 6x6 (orthogonal) + + 7 17 27 14 9 4 + 21 29 33 31 18 11 + 24 32 36 34 25 22 + 19 30 35 28 20 10 + 8 15 26 16 6 2 + 5 13 23 12 3 1 + + + + + Halftone 8x8 (orthogonal) + + 7 21 33 43 36 19 9 4 + 16 27 51 55 49 29 14 11 + 31 47 57 61 59 45 35 23 + 41 53 60 64 62 52 40 38 + 37 44 58 63 56 46 30 22 + 15 28 48 54 50 26 17 10 + 8 18 34 42 32 20 6 2 + 5 13 25 39 24 12 3 1 + + + + + + Halftone 16x16 (orthogonal) + + 4 12 24 44 72 100 136 152 150 134 98 70 42 23 11 3 + 7 16 32 52 76 104 144 160 158 142 102 74 50 31 15 6 + 19 27 40 60 92 132 168 180 178 166 130 90 58 39 26 18 + 36 48 56 80 124 176 188 204 203 187 175 122 79 55 47 35 + 64 68 84 116 164 200 212 224 223 211 199 162 114 83 67 63 + 88 96 112 156 192 216 232 240 239 231 214 190 154 111 95 87 + 108 120 148 184 208 228 244 252 251 243 226 206 182 147 119 107 + 128 140 172 196 219 235 247 256 255 246 234 218 194 171 139 127 + 126 138 170 195 220 236 248 253 254 245 233 217 193 169 137 125 + 106 118 146 183 207 227 242 249 250 241 225 205 181 145 117 105 + 86 94 110 155 191 215 229 238 237 230 213 189 153 109 93 85 + 62 66 82 115 163 198 210 221 222 209 197 161 113 81 65 61 + 34 46 54 78 123 174 186 202 201 185 173 121 77 53 45 33 + 20 28 37 59 91 131 167 179 177 165 129 89 57 38 25 17 + 8 13 29 51 75 103 143 159 157 141 101 73 49 30 14 5 + 1 9 21 43 71 99 135 151 149 133 97 69 41 22 10 2 + + + + + + diff --git a/www/source/type-windows.xml b/www/source/type-windows.xml new file mode 100644 index 000000000..d6735e0e5 --- /dev/null +++ b/www/source/type-windows.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/www/source/wand/sigmoidal-contrast.c b/www/source/wand/sigmoidal-contrast.c new file mode 100644 index 000000000..0183ebfaa --- /dev/null +++ b/www/source/wand/sigmoidal-contrast.c @@ -0,0 +1,106 @@ +#include +#include +#include +#include + +static MagickBooleanType SigmoidalContrast(WandView *contrast_view, + const ssize_t y,const int id,void *context) +{ +#define QuantumScale ((MagickRealType) 1.0/(MagickRealType) QuantumRange) +#define SigmoidalContrast(x) \ + (QuantumRange*(1.0/(1+exp(10.0*(0.5-QuantumScale*x)))-0.0066928509)*1.0092503) + + RectangleInfo + extent; + + MagickPixelPacket + pixel; + + PixelWand + **pixels; + + register ssize_t + x; + + extent=GetWandViewExtent(contrast_view); + pixels=GetWandViewPixels(contrast_view); + for (x=0; x < (ssize_t) (extent.width-extent.x); x++) + { + PixelGetMagickColor(pixels[x],&pixel); + pixel.red=SigmoidalContrast(pixel.red); + pixel.green=SigmoidalContrast(pixel.green); + pixel.blue=SigmoidalContrast(pixel.blue); + pixel.index=SigmoidalContrast(pixel.index); + PixelSetMagickColor(pixels[x],&pixel); + } + return(MagickTrue); +} + +int main(int argc,char **argv) +{ +#define ThrowViewException(view) \ +{ \ + description=GetWandViewException(view,&severity); \ + (void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description); \ + description=(char *) MagickRelinquishMemory(description); \ + exit(-1); \ +} +#define ThrowWandException(wand) \ +{ \ + description=MagickGetException(wand,&severity); \ + (void) fprintf(stderr,"%s %s %lu %s\n",GetMagickModule(),description); \ + description=(char *) MagickRelinquishMemory(description); \ + exit(-1); \ +} + + char + *description; + + ExceptionType + severity; + + MagickBooleanType + status; + + MagickPixelPacket + pixel; + + MagickWand + *contrast_wand; + + WandView + *contrast_view; + + if (argc != 3) + { + (void) fprintf(stdout,"Usage: %s image sigmoidal-image\n",argv[0]); + exit(0); + } + /* + Read an image. + */ + MagickWandGenesis(); + contrast_wand=NewMagickWand(); + status=MagickReadImage(contrast_wand,argv[1]); + if (status == MagickFalse) + ThrowWandException(contrast_wand); + /* + Sigmoidal non-linearity contrast control. + */ + contrast_view=NewWandView(contrast_wand); + if (contrast_view == (WandView *) NULL) + ThrowWandException(contrast_wand); + status=UpdateWandViewIterator(contrast_view,SigmoidalContrast,(void *) NULL); + if (status == MagickFalse) + ThrowWandException(contrast_wand); + contrast_view=DestroyWandView(contrast_view); + /* + Write the image then destroy it. + */ + status=MagickWriteImages(contrast_wand,argv[2],MagickTrue); + if (status == MagickFalse) + ThrowWandException(contrast_wand); + contrast_wand=DestroyMagickWand(contrast_wand); + MagickWandTerminus(); + return(0); +} -- 2.50.0