]> granicus.if.org Git - imagemagick/commitdiff
Deprecated unused methods.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sun, 25 Mar 2018 19:51:57 +0000 (21:51 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Mon, 26 Mar 2018 05:14:17 +0000 (07:14 +0200)
MagickCore/deprecate.c
MagickCore/deprecate.h
MagickCore/nt-feature.c
MagickCore/nt-feature.h

index 74d0a115e4c9e3e653cdb2b5728d1936eb0b4fc3..ac3b0d1f3827b8392a1c5029b34cad0ad8543536 100644 (file)
 /*
   Include declarations.
 */
+#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__)
+#define WIN32_LEAN_AND_MEAN
+#define VC_EXTRALEAN
+#include <windows.h>
+#endif
 #include "MagickCore/studio.h"
 #include "MagickCore/property.h"
 #include "MagickCore/blob.h"
@@ -52,6 +57,7 @@
 #include "MagickCore/colormap.h"
 #include "MagickCore/colormap-private.h"
 #include "MagickCore/colorspace.h"
+#include "MagickCore/colorspace-private.h"
 #include "MagickCore/composite.h"
 #include "MagickCore/composite-private.h"
 #include "MagickCore/constitute.h"
@@ -121,5 +127,274 @@ MagickExport MagickBooleanType GetMagickSeekableStream(
   return(((magick_info->flags & CoderSeekableStreamFlag) == 0) ? MagickFalse :
     MagickTrue);
 }
+\f
+#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__)
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%   C r o p I m a g e T o H B i t m a p                                       %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  CropImageToHBITMAP() extracts a specified region of the image and returns
+%  it as a Windows HBITMAP. While the same functionality can be accomplished by
+%  invoking CropImage() followed by ImageToHBITMAP(), this method is more
+%  efficient since it copies pixels directly to the HBITMAP.
+%
+%  The format of the CropImageToHBITMAP method is:
+%
+%      HBITMAP CropImageToHBITMAP(Image* image,const RectangleInfo *geometry,
+%        ExceptionInfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image.
+%
+%    o geometry: Define the region of the image to crop with members
+%      x, y, width, and height.
+%
+%    o exception: return any errors or warnings in this structure.
+%
+*/
+MagickExport void *CropImageToHBITMAP(Image *image,
+  const RectangleInfo *geometry,ExceptionInfo *exception)
+{
+#define CropImageTag  "Crop/Image"
+
+  BITMAP
+    bitmap;
+
+  HBITMAP
+    bitmapH;
+
+  HANDLE
+    bitmap_bitsH;
+
+  MagickBooleanType
+    proceed;
+
+  RectangleInfo
+    page;
+
+  register const Quantum
+    *p;
+
+  register RGBQUAD
+    *q;
+
+  RGBQUAD
+    *bitmap_bits;
+
+  ssize_t
+    y;
+
+  /*
+    Check crop geometry.
+  */
+  assert(image != (const Image *) NULL);
+  assert(image->signature == MagickCoreSignature);
+  if (image->debug != MagickFalse)
+    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
+  assert(geometry != (const RectangleInfo *) NULL);
+  assert(exception != (ExceptionInfo *) NULL);
+  assert(exception->signature == MagickCoreSignature);
+  if (((geometry->x+(ssize_t) geometry->width) < 0) ||
+      ((geometry->y+(ssize_t) geometry->height) < 0) ||
+      (geometry->x >= (ssize_t) image->columns) ||
+      (geometry->y >= (ssize_t) image->rows))
+    ThrowImageException(OptionError,"GeometryDoesNotContainImage");
+  page=(*geometry);
+  if ((page.x+(ssize_t) page.width) > (ssize_t) image->columns)
+    page.width=image->columns-page.x;
+  if ((page.y+(ssize_t) page.height) > (ssize_t) image->rows)
+    page.height=image->rows-page.y;
+  if (page.x < 0)
+    {
+      page.width+=page.x;
+      page.x=0;
+    }
+  if (page.y < 0)
+    {
+      page.height+=page.y;
+      page.y=0;
+    }
+
+  if ((page.width == 0) || (page.height == 0))
+    ThrowImageException(OptionError,"GeometryDimensionsAreZero");
+  /*
+    Initialize crop image attributes.
+  */
+  bitmap.bmType         = 0;
+  bitmap.bmWidth        = (LONG) page.width;
+  bitmap.bmHeight       = (LONG) page.height;
+  bitmap.bmWidthBytes   = bitmap.bmWidth * 4;
+  bitmap.bmPlanes       = 1;
+  bitmap.bmBitsPixel    = 32;
+  bitmap.bmBits         = NULL;
+
+  bitmap_bitsH=(HANDLE) GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,page.width*
+    page.height*bitmap.bmBitsPixel);
+  if (bitmap_bitsH == NULL)
+    return(NULL);
+  bitmap_bits=(RGBQUAD *) GlobalLock((HGLOBAL) bitmap_bitsH);
+  if ( bitmap.bmBits == NULL )
+    bitmap.bmBits = bitmap_bits;
+  if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
+    SetImageColorspace(image,sRGBColorspace,exception);
+  /*
+    Extract crop image.
+  */
+  q=bitmap_bits;
+  for (y=0; y < (ssize_t) page.height; y++)
+  {
+    register ssize_t
+      x;
+
+    p=GetVirtualPixels(image,page.x,page.y+y,page.width,1,exception);
+    if (p == (const Quantum *) NULL)
+      break;
+
+    /* Transfer pixels, scaling to Quantum */
+    for( x=(ssize_t) page.width ; x> 0 ; x-- )
+    {
+      q->rgbRed = ScaleQuantumToChar(GetPixelRed(image,p));
+      q->rgbGreen = ScaleQuantumToChar(GetPixelGreen(image,p));
+      q->rgbBlue = ScaleQuantumToChar(GetPixelBlue(image,p));
+      q->rgbReserved = 0;
+      p+=GetPixelChannels(image);
+      q++;
+    }
+    proceed=SetImageProgress(image,CropImageTag,y,page.height);
+    if (proceed == MagickFalse)
+      break;
+  }
+  if (y < (ssize_t) page.height)
+    {
+      GlobalUnlock((HGLOBAL) bitmap_bitsH);
+      GlobalFree((HGLOBAL) bitmap_bitsH);
+      return((void *) NULL);
+    }
+  bitmap.bmBits=bitmap_bits;
+  bitmapH=CreateBitmapIndirect(&bitmap);
+  GlobalUnlock((HGLOBAL) bitmap_bitsH);
+  GlobalFree((HGLOBAL) bitmap_bitsH);
+  return((void *) bitmapH);
+}
+#endif
+\f
+#if defined(MAGICKCORE_WINDOWS_SUPPORT) || defined(__CYGWIN__)
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%   I m a g e T o H B i t m a p                                               %
+%                                                                             %
+%                                                                             %
+%                                                                             %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+%  ImageToHBITMAP() creates a Windows HBITMAP from an image.
+%
+%  The format of the ImageToHBITMAP method is:
+%
+%      HBITMAP ImageToHBITMAP(Image *image,Exceptioninfo *exception)
+%
+%  A description of each parameter follows:
+%
+%    o image: the image to convert.
+%
+*/
+MagickExport void *ImageToHBITMAP(Image *image,ExceptionInfo *exception)
+{
+  BITMAP
+    bitmap;
+
+  HANDLE
+    bitmap_bitsH;
+
+  HBITMAP
+    bitmapH;
+
+  register ssize_t
+    x;
+
+  register const Quantum
+    *p;
+
+  register RGBQUAD
+    *q;
+
+  RGBQUAD
+    *bitmap_bits;
+
+  size_t
+    length;
+
+  ssize_t
+    y;
+
+  (void) memset(&bitmap,0,sizeof(bitmap));
+  bitmap.bmType=0;
+  bitmap.bmWidth=(LONG) image->columns;
+  bitmap.bmHeight=(LONG) image->rows;
+  bitmap.bmWidthBytes=4*bitmap.bmWidth;
+  bitmap.bmPlanes=1;
+  bitmap.bmBitsPixel=32;
+  bitmap.bmBits=NULL;
+  length=bitmap.bmWidthBytes*bitmap.bmHeight;
+  bitmap_bitsH=(HANDLE) GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,length);
+  if (bitmap_bitsH == NULL)
+    {
+      char
+        *message;
+
+      message=GetExceptionMessage(errno);
+      (void) ThrowMagickException(exception,GetMagickModule(),
+        ResourceLimitError,"MemoryAllocationFailed","`%s'",message);
+      message=DestroyString(message);
+      return(NULL);
+    }
+  bitmap_bits=(RGBQUAD *) GlobalLock((HGLOBAL) bitmap_bitsH);
+  q=bitmap_bits;
+  if (bitmap.bmBits == NULL)
+    bitmap.bmBits=bitmap_bits;
+  (void) SetImageColorspace(image,sRGBColorspace,exception);
+  for (y=0; y < (ssize_t) image->rows; y++)
+  {
+    p=GetVirtualPixels(image,0,y,image->columns,1,exception);
+    if (p == (const Quantum *) NULL)
+      break;
+    for (x=0; x < (ssize_t) image->columns; x++)
+    {
+      q->rgbRed=ScaleQuantumToChar(GetPixelRed(image,p));
+      q->rgbGreen=ScaleQuantumToChar(GetPixelGreen(image,p));
+      q->rgbBlue=ScaleQuantumToChar(GetPixelBlue(image,p));
+      q->rgbReserved=0;
+      p+=GetPixelChannels(image);
+      q++;
+    }
+  }
+  bitmap.bmBits=bitmap_bits;
+  bitmapH=CreateBitmapIndirect(&bitmap);
+  if (bitmapH == NULL)
+    {
+      char
+        *message;
+
+      message=GetExceptionMessage(errno);
+      (void) ThrowMagickException(exception,GetMagickModule(),
+        ResourceLimitError,"MemoryAllocationFailed","`%s'",message);
+      message=DestroyString(message);
+    }
+  GlobalUnlock((HGLOBAL) bitmap_bitsH);
+  GlobalFree((HGLOBAL) bitmap_bitsH);
+  return((void *) bitmapH);
+}
+#endif
 
 #endif
index 8742e772bfdcf964c28338d925ecab776eeb68fa..b8d77226157c6f8f9fb2c8b1142e2c50c04c55ca 100644 (file)
@@ -32,6 +32,10 @@ typedef int
 extern MagickExport MagickBooleanType
   GetMagickSeekableStream(const MagickInfo *);
 
+extern MagickExport void
+  *CropImageToHBITMAP(Image *,const RectangleInfo *,ExceptionInfo *),
+  *ImageToHBITMAP(Image *,ExceptionInfo *);
+
 #endif
 
 #if defined(__cplusplus) || defined(c_plusplus)
index a8ca74ab5d31f21d190eb55fbf27bcaa9622736e..fbaa2c22d2bb2640731d0c75c7e641ef3ff78408 100644 (file)
 %                                                                             %
 %                                                                             %
 %                                                                             %
-%   C r o p I m a g e T o H B i t m a p                                       %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  CropImageToHBITMAP() extracts a specified region of the image and returns
-%  it as a Windows HBITMAP. While the same functionality can be accomplished by
-%  invoking CropImage() followed by ImageToHBITMAP(), this method is more
-%  efficient since it copies pixels directly to the HBITMAP.
-%
-%  The format of the CropImageToHBITMAP method is:
-%
-%      HBITMAP CropImageToHBITMAP(Image* image,const RectangleInfo *geometry,
-%        ExceptionInfo *exception)
-%
-%  A description of each parameter follows:
-%
-%    o image: the image.
-%
-%    o geometry: Define the region of the image to crop with members
-%      x, y, width, and height.
-%
-%    o exception: return any errors or warnings in this structure.
-%
-*/
-MagickExport void *CropImageToHBITMAP(Image *image,
-  const RectangleInfo *geometry,ExceptionInfo *exception)
-{
-#define CropImageTag  "Crop/Image"
-
-  BITMAP
-    bitmap;
-
-  HBITMAP
-    bitmapH;
-
-  HANDLE
-    bitmap_bitsH;
-
-  MagickBooleanType
-    proceed;
-
-  RectangleInfo
-    page;
-
-  register const Quantum
-    *p;
-
-  register RGBQUAD
-    *q;
-
-  RGBQUAD
-    *bitmap_bits;
-
-  ssize_t
-    y;
-
-  /*
-    Check crop geometry.
-  */
-  assert(image != (const Image *) NULL);
-  assert(image->signature == MagickCoreSignature);
-  if (image->debug != MagickFalse)
-    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
-  assert(geometry != (const RectangleInfo *) NULL);
-  assert(exception != (ExceptionInfo *) NULL);
-  assert(exception->signature == MagickCoreSignature);
-  if (((geometry->x+(ssize_t) geometry->width) < 0) ||
-      ((geometry->y+(ssize_t) geometry->height) < 0) ||
-      (geometry->x >= (ssize_t) image->columns) ||
-      (geometry->y >= (ssize_t) image->rows))
-    ThrowImageException(OptionError,"GeometryDoesNotContainImage");
-  page=(*geometry);
-  if ((page.x+(ssize_t) page.width) > (ssize_t) image->columns)
-    page.width=image->columns-page.x;
-  if ((page.y+(ssize_t) page.height) > (ssize_t) image->rows)
-    page.height=image->rows-page.y;
-  if (page.x < 0)
-    {
-      page.width+=page.x;
-      page.x=0;
-    }
-  if (page.y < 0)
-    {
-      page.height+=page.y;
-      page.y=0;
-    }
-
-  if ((page.width == 0) || (page.height == 0))
-    ThrowImageException(OptionError,"GeometryDimensionsAreZero");
-  /*
-    Initialize crop image attributes.
-  */
-  bitmap.bmType         = 0;
-  bitmap.bmWidth        = (LONG) page.width;
-  bitmap.bmHeight       = (LONG) page.height;
-  bitmap.bmWidthBytes   = bitmap.bmWidth * 4;
-  bitmap.bmPlanes       = 1;
-  bitmap.bmBitsPixel    = 32;
-  bitmap.bmBits         = NULL;
-
-  bitmap_bitsH=(HANDLE) GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,page.width*
-    page.height*bitmap.bmBitsPixel);
-  if (bitmap_bitsH == NULL)
-    return(NULL);
-  bitmap_bits=(RGBQUAD *) GlobalLock((HGLOBAL) bitmap_bitsH);
-  if ( bitmap.bmBits == NULL )
-    bitmap.bmBits = bitmap_bits;
-  if (IssRGBCompatibleColorspace(image->colorspace) == MagickFalse)
-    SetImageColorspace(image,sRGBColorspace,exception);
-  /*
-    Extract crop image.
-  */
-  q=bitmap_bits;
-  for (y=0; y < (ssize_t) page.height; y++)
-  {
-    register ssize_t
-      x;
-
-    p=GetVirtualPixels(image,page.x,page.y+y,page.width,1,exception);
-    if (p == (const Quantum *) NULL)
-      break;
-
-    /* Transfer pixels, scaling to Quantum */
-    for( x=(ssize_t) page.width ; x> 0 ; x-- )
-    {
-      q->rgbRed = ScaleQuantumToChar(GetPixelRed(image,p));
-      q->rgbGreen = ScaleQuantumToChar(GetPixelGreen(image,p));
-      q->rgbBlue = ScaleQuantumToChar(GetPixelBlue(image,p));
-      q->rgbReserved = 0;
-      p+=GetPixelChannels(image);
-      q++;
-    }
-    proceed=SetImageProgress(image,CropImageTag,y,page.height);
-    if (proceed == MagickFalse)
-      break;
-  }
-  if (y < (ssize_t) page.height)
-    {
-      GlobalUnlock((HGLOBAL) bitmap_bitsH);
-      GlobalFree((HGLOBAL) bitmap_bitsH);
-      return((void *) NULL);
-    }
-  bitmap.bmBits=bitmap_bits;
-  bitmapH=CreateBitmapIndirect(&bitmap);
-  GlobalUnlock((HGLOBAL) bitmap_bitsH);
-  GlobalFree((HGLOBAL) bitmap_bitsH);
-  return((void *) bitmapH);
-}
-\f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
 %   I s M a g i c k C o n f l i c t                                           %
 %                                                                             %
 %                                                                             %
@@ -547,113 +391,4 @@ MagickExport MagickBooleanType NTAcquireTypeCache(SplayTreeInfo *type_cache,
   return(MagickTrue);
 }
 \f
-/*
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%   I m a g e T o H B i t m a p                                               %
-%                                                                             %
-%                                                                             %
-%                                                                             %
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%  ImageToHBITMAP() creates a Windows HBITMAP from an image.
-%
-%  The format of the ImageToHBITMAP method is:
-%
-%      HBITMAP ImageToHBITMAP(Image *image,Exceptioninfo *exception)
-%
-%  A description of each parameter follows:
-%
-%    o image: the image to convert.
-%
-*/
-MagickExport void *ImageToHBITMAP(Image *image,ExceptionInfo *exception)
-{
-  BITMAP
-    bitmap;
-
-  HANDLE
-    bitmap_bitsH;
-
-  HBITMAP
-    bitmapH;
-
-  register ssize_t
-    x;
-
-  register const Quantum
-    *p;
-
-  register RGBQUAD
-    *q;
-
-  RGBQUAD
-    *bitmap_bits;
-
-  size_t
-    length;
-
-  ssize_t
-    y;
-
-  (void) memset(&bitmap,0,sizeof(bitmap));
-  bitmap.bmType=0;
-  bitmap.bmWidth=(LONG) image->columns;
-  bitmap.bmHeight=(LONG) image->rows;
-  bitmap.bmWidthBytes=4*bitmap.bmWidth;
-  bitmap.bmPlanes=1;
-  bitmap.bmBitsPixel=32;
-  bitmap.bmBits=NULL;
-  length=bitmap.bmWidthBytes*bitmap.bmHeight;
-  bitmap_bitsH=(HANDLE) GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE,length);
-  if (bitmap_bitsH == NULL)
-    {
-      char
-        *message;
-
-      message=GetExceptionMessage(errno);
-      (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",message);
-      message=DestroyString(message);
-      return(NULL);
-    }
-  bitmap_bits=(RGBQUAD *) GlobalLock((HGLOBAL) bitmap_bitsH);
-  q=bitmap_bits;
-  if (bitmap.bmBits == NULL)
-    bitmap.bmBits=bitmap_bits;
-  (void) SetImageColorspace(image,sRGBColorspace,exception);
-  for (y=0; y < (ssize_t) image->rows; y++)
-  {
-    p=GetVirtualPixels(image,0,y,image->columns,1,exception);
-    if (p == (const Quantum *) NULL)
-      break;
-    for (x=0; x < (ssize_t) image->columns; x++)
-    {
-      q->rgbRed=ScaleQuantumToChar(GetPixelRed(image,p));
-      q->rgbGreen=ScaleQuantumToChar(GetPixelGreen(image,p));
-      q->rgbBlue=ScaleQuantumToChar(GetPixelBlue(image,p));
-      q->rgbReserved=0;
-      p+=GetPixelChannels(image);
-      q++;
-    }
-  }
-  bitmap.bmBits=bitmap_bits;
-  bitmapH=CreateBitmapIndirect(&bitmap);
-  if (bitmapH == NULL)
-    {
-      char
-        *message;
-
-      message=GetExceptionMessage(errno);
-      (void) ThrowMagickException(exception,GetMagickModule(),
-        ResourceLimitError,"MemoryAllocationFailed","`%s'",message);
-      message=DestroyString(message);
-    }
-  GlobalUnlock((HGLOBAL) bitmap_bitsH);
-  GlobalFree((HGLOBAL) bitmap_bitsH);
-  return((void *) bitmapH);
-}
-\f
 #endif
index 595c82ac0d7f5fa475b6e689d73a7e6b0f3ffbd2..1a877fcdce20b7d3369dbe6cafb867a8efa6e5d6 100644 (file)
 extern "C" {
 #endif
 
-extern MagickExport void
-  *CropImageToHBITMAP(Image *,const RectangleInfo *,ExceptionInfo *),
-  *ImageToHBITMAP(Image *,ExceptionInfo *);
-
 #if !defined(XS_VERSION)
 
 extern MagickExport MagickBooleanType