]> granicus.if.org Git - imagemagick/commitdiff
(no commit message)
authorcristy <urban-warrior@git.imagemagick.org>
Mon, 24 Jan 2011 14:14:53 +0000 (14:14 +0000)
committercristy <urban-warrior@git.imagemagick.org>
Mon, 24 Jan 2011 14:14:53 +0000 (14:14 +0000)
magick/annotate.c
magick/annotate.h
magick/exception-private.h
magick/magick.c

index 05af331f4eb91ca63d92db5087fa6be1675e9e8c..e28324c91b1810f8ba6bd631985245974bce6b7e 100644 (file)
@@ -64,6 +64,7 @@
 #include "magick/quantum-private.h"
 #include "magick/property.h"
 #include "magick/resource_.h"
+#include "magick/semaphore.h"
 #include "magick/statistic.h"
 #include "magick/string_.h"
 #include "magick/token-private.h"
 #endif /* defined(FT_BBOX_H) */
 #endif
 \f
+/*
+  Annotate semaphores.
+*/
+static SemaphoreInfo
+  *annotate_semaphore = (SemaphoreInfo *) NULL;
+\f
 /*
   Forward declarations.
 */
@@ -115,6 +122,55 @@ static MagickBooleanType
 %                                                                             %
 %                                                                             %
 %                                                                             %
++   A n n o t a t e C o m p o n e n t G e n e s i s                           %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  AnnotateComponentGenesis() instantiates the annotate component.
+%
+%  The format of the AnnotateComponentGenesis method is:
+%
+%      MagickBooleanType AnnotateComponentGenesis(void)
+%
+*/
+MagickExport MagickBooleanType AnnotateComponentGenesis(void)
+{
+  AcquireSemaphoreInfo(&annotate_semaphore);
+  return(MagickTrue);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
++   A n n o t a t e C o m p o n e n t T e r m i n u s                         %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  AnnotateComponentTerminus() destroys the annotate component.
+%
+%  The format of the AnnotateComponentTerminus method is:
+%
+%      AnnotateComponentTerminus(void)
+%
+*/
+MagickExport void AnnotateComponentTerminus(void)
+{
+  if (annotate_semaphore == (SemaphoreInfo *) NULL)
+    AcquireSemaphoreInfo(&annotate_semaphore);
+  DestroySemaphoreInfo(&annotate_semaphore);
+}
+\f
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
 %   A n n o t a t e I m a g e                                                 %
 %                                                                             %
 %                                                                             %
@@ -1820,6 +1876,9 @@ static MagickBooleanType RenderX11(Image *image,const DrawInfo *draw_info,
     height,
     width;
 
+  if (annotate_semaphore == (SemaphoreInfo *) NULL)
+    AcquireSemaphoreInfo(&annotate_semaphore);
+  LockSemaphoreInfo(annotate_semaphore);
   if (display == (Display *) NULL)
     {
       const char
@@ -1900,6 +1959,7 @@ static MagickBooleanType RenderX11(Image *image,const DrawInfo *draw_info,
         }
       cache_info=(*draw_info);
     }
+  UnlockSemaphoreInfo(annotate_semaphore);
   /*
     Initialize annotate info.
   */
index 9289970b1fe3f3efcb8ccf3b14a03cb5197cb4fe..1ba4faa631e5d6e461f631d68e14866305e7781e 100644 (file)
@@ -25,6 +25,7 @@ extern "C" {
 #include "magick/draw.h"
 
 extern MagickExport MagickBooleanType
+  AnnotateComponentGenesis(void),
   AnnotateImage(Image *,const DrawInfo *),
   GetMultilineTypeMetrics(Image *,const DrawInfo *,TypeMetric *),
   GetTypeMetrics(Image *,const DrawInfo *,TypeMetric *);
@@ -33,6 +34,9 @@ extern MagickExport ssize_t
   FormatMagickCaption(Image *,DrawInfo *,const MagickBooleanType,TypeMetric *,
     char **);
 
+extern MagickExport void
+  AnnotateComponentTerminus(void);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif
index f49ad976ae35f4e6a2149216240ef7f47abc9c49..558c60bbd4560df203a4a0ab0973c0dc6136d44a 100644 (file)
@@ -23,6 +23,7 @@ extern "C" {
 #endif
 
 #include "magick/log.h"
+#include "magick/string_.h"
 
 #define ThrowBinaryException(severity,tag,context) \
 { \
index 024db6fb388c9b158cd80ef2af71b2b2bb6d0c9a..b3eca62d221df8c0d2bef6cff51b17efbbecb1b0 100644 (file)
@@ -41,6 +41,7 @@
   Include declarations.
 */
 #include "magick/studio.h"
+#include "magick/annotate.h"
 #include "magick/blob.h"
 #include "magick/cache.h"
 #include "magick/coder.h"
@@ -1311,6 +1312,7 @@ MagickExport void MagickCoreGenesis(const char *path,
   (void) TypeComponentGenesis();
   (void) MimeComponentGenesis();
   (void) ConstituteComponentGenesis();
+  (void) AnnotateComponentGenesis();
 #if defined(MAGICKCORE_X11_DELEGATE)
   (void) XComponentGenesis();
 #endif
@@ -1347,6 +1349,7 @@ MagickExport void MagickCoreTerminus(void)
 #if defined(MAGICKCORE_X11_DELEGATE)
   XComponentTerminus();
 #endif
+  AnnotateComponentTerminus();
   ConstituteComponentTerminus();
   MimeComponentTerminus();
   TypeComponentTerminus();