]> granicus.if.org Git - imagemagick/blobdiff - MagickCore/xwindow-private.h
(no commit message)
[imagemagick] / MagickCore / xwindow-private.h
index a37978a3dfc2457de8cf8634726ce8a9de6e049b..f9516b6cdfbd2e5aee3d3a0cf344907801b9576d 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization
+  Copyright 1999-2014 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.
 #ifndef _MAGICKCORE_XWINDOW_PRIVATE_H
 #define _MAGICKCORE_XWINDOW_PRIVATE_H
 
+#include "MagickCore/draw.h"
+#include "MagickCore/exception.h"
+#include "MagickCore/geometry.h"
+#include "MagickCore/nt-base-private.h"
+#include "MagickCore/pixel-accessor.h"
+#include "MagickCore/quantize.h"
+
 #if defined(__cplusplus) || defined(c_plusplus)
 extern "C" {
 #endif
@@ -31,9 +38,6 @@ extern "C" {
 #include <X11/keysym.h>
 #include <X11/Xresource.h>
 #include <X11/Xutil.h>
-#include "MagickCore/exception.h"
-#include "MagickCore/geometry.h"
-#include "MagickCore/quantize.h"
 
 #if defined(__cplusplus) || defined(c_plusplus)
 # define klass  c_class
@@ -75,7 +79,7 @@ extern "C" {
  \
   GetExceptionInfo(&exception); \
   (void) ThrowMagickException(&exception,GetMagickModule(),severity, \
-    tag == (const char *) NULL ? "unknown" : tag,"`%s': %s",context, \
+    tag == (const char *) NULL ? "unknown" : tag,"'%s': %s",context, \
     strerror(errno)); \
   CatchException(&exception); \
   (void) DestroyExceptionInfo(&exception); \
@@ -512,10 +516,11 @@ extern MagickPrivate int
   XCheckDefineCursor(Display *,Window,Cursor);
 
 extern MagickPrivate MagickBooleanType
-  XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *),
+  XAnnotateImage(Display *,const XPixelInfo *,XAnnotateInfo *,Image *,
+    ExceptionInfo *),
   XComponentGenesis(void),
-  XDrawImage(Display *,const XPixelInfo *,XDrawInfo *,Image *),
-  XGetWindowColor(Display *,XWindows *,char *),
+  XDrawImage(Display *,const XPixelInfo *,XDrawInfo *,Image *,ExceptionInfo *),
+  XGetWindowColor(Display *,XWindows *,char *,ExceptionInfo *),
   XMagickProgressMonitor(const char *,const MagickOffsetType,
     const MagickSizeType,void *),
   XMakeImage(Display *,const XResourceInfo *,XWindowInfo *,Image *,unsigned int,
@@ -528,10 +533,12 @@ extern MagickPrivate void
   XCheckRefreshWindows(Display *,XWindows *),
   XClientMessage(Display *,const Window,const Atom,const Atom,const Time),
   XComponentTerminus(void),
-  XConfigureImageColormap(Display *,XResourceInfo *,XWindows *,Image *),
+  XConfigureImageColormap(Display *,XResourceInfo *,XWindows *,Image *,
+    ExceptionInfo *),
   XConstrainWindowPosition(Display *,XWindowInfo *),
   XDelay(Display *,const size_t),
-  XDisplayImageInfo(Display *,const XResourceInfo *,XWindows *,Image *,Image *),
+  XDisplayImageInfo(Display *,const XResourceInfo *,XWindows *,Image *,Image *,
+    ExceptionInfo *),
   XDestroyWindowColors(Display *,Window),
   XFreeResources(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *,
     XFontStruct *,XResourceInfo *,XWindowInfo *),
@@ -546,9 +553,9 @@ extern MagickPrivate void
   XGetMapInfo(const XVisualInfo *,const Colormap,XStandardColormap *),
   XGetWindowInfo(Display *,XVisualInfo *,XStandardColormap *,XPixelInfo *,
     XFontStruct *,XResourceInfo *,XWindowInfo *),
-  XMakeMagnifyImage(Display *,XWindows *),
+  XMakeMagnifyImage(Display *,XWindows *,ExceptionInfo *),
   XMakeStandardColormap(Display *,XVisualInfo *,XResourceInfo *,Image *,
-    XStandardColormap *,XPixelInfo *),
+    XStandardColormap *,XPixelInfo *,ExceptionInfo *),
   XMakeWindow(Display *,Window,char **,int,XClassHint *,XWMHints *,
     XWindowInfo *),
   XQueryPosition(Display *,const Window,int *,int *),
@@ -592,17 +599,23 @@ extern MagickExport void
 extern MagickExport XrmDatabase
   XGetResourceDatabase(Display *,const char *);
 
-static inline MagickRealType XPixelIntensity(const XColor *pixel)
+static inline double XPixelIntensity(const XColor *pixel)
 {
-  MagickRealType
+  double
     intensity;
 
-  intensity=0.299*pixel->red+0.587*pixel->green+0.114*pixel->blue;
+  if ((pixel->red  == pixel->green) && (pixel->green == pixel->blue))
+    return((double) pixel->red);
+  intensity=0.212656*pixel->red+0.715158*pixel->green+0.072186*pixel->blue;
   return(intensity);
 }
 
 #endif
 
+extern MagickPrivate MagickBooleanType
+  XRenderImage(Image *,const DrawInfo *,const PointInfo *,TypeMetric *,
+    ExceptionInfo *);
+
 #if defined(__cplusplus) || defined(c_plusplus)
 }
 #endif