% %
% %
% %
+% CCCC L IIIII PPPP BBBB OOO AAA RRRR DDDD %
+% C L I P P B B O O A A R R D D %
+% C L I PPP BBBB O O AAAAA RRRR D D %
+% C L I P B B O O A A R R D D %
+% CCCC LLLLL IIIII P BBBB OOO A A R R DDDD %
% %
% %
% Read/Write Windows Clipboard. %
% May 2002 %
% %
% %
-% Copyright 1999-2010 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2013 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 %
/*
Include declarations.
*/
-#include "magick/studio.h"
+#include "MagickCore/studio.h"
#if defined(MAGICKCORE_WINGDI32_DELEGATE)
# if defined(__CYGWIN__)
# include <windows.h>
# else
/* All MinGW needs ... */
+# include "MagickCore/nt-base-private.h"
# include <wingdi.h>
# endif
#endif
-#include "magick/blob.h"
-#include "magick/blob-private.h"
-#include "magick/cache.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/nt-feature.h"
-#include "magick/quantum-private.h"
-#include "magick/static.h"
-#include "magick/string_.h"
-#include "magick/module.h"
+#include "MagickCore/blob.h"
+#include "MagickCore/blob-private.h"
+#include "MagickCore/cache.h"
+#include "MagickCore/exception.h"
+#include "MagickCore/exception-private.h"
+#include "MagickCore/image.h"
+#include "MagickCore/image-private.h"
+#include "MagickCore/list.h"
+#include "MagickCore/magick.h"
+#include "MagickCore/memory_.h"
+#include "MagickCore/nt-feature.h"
+#include "MagickCore/pixel-accessor.h"
+#include "MagickCore/quantum-private.h"
+#include "MagickCore/static.h"
+#include "MagickCore/string_.h"
+#include "MagickCore/module.h"
\f
/*
Forward declarations.
*/
#if defined(MAGICKCORE_WINGDI32_DELEGATE)
static MagickBooleanType
- WriteCLIPBOARDImage(const ImageInfo *,Image *);
+ WriteCLIPBOARDImage(const ImageInfo *,Image *,ExceptionInfo *);
#endif
\f
/*
Image
*image;
- long
- y;
-
- register long
+ register ssize_t
x;
- register PixelPacket
+ register Quantum
*q;
+ ssize_t
+ y;
+
assert(image_info != (const ImageInfo *) NULL);
assert(image_info->signature == MagickSignature);
if (image_info->debug != MagickFalse)
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- image=AcquireImage(image_info);
+ image=AcquireImage(image_info,exception);
{
HBITMAP
bitmapH;
*/
(void) ResetMagickMemory(&DIBinfo,0,sizeof(BITMAPINFO));
DIBinfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
- DIBinfo.bmiHeader.biWidth=image->columns;
- DIBinfo.bmiHeader.biHeight=(-1)*image->rows;
+ DIBinfo.bmiHeader.biWidth=(LONG) image->columns;
+ DIBinfo.bmiHeader.biHeight=(-1)*(LONG) image->rows;
DIBinfo.bmiHeader.biPlanes=1;
DIBinfo.bmiHeader.biBitCount=32;
DIBinfo.bmiHeader.biCompression=BI_RGB;
RealizePalette(hDC);
}
/* bitblt from the memory to the DIB-based one */
- BitBlt(hDC,0,0,image->columns,image->rows,hMemDC,0,0,SRCCOPY);
+ BitBlt(hDC,0,0,(int) image->columns,(int) image->rows,hMemDC,0,0,SRCCOPY);
/* finally copy the pixels! */
pBits=ppBits;
- for (y=0; y < (long) image->rows; y++)
+ for (y=0; y < (ssize_t) image->rows; y++)
{
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
- if (q == (PixelPacket *) NULL)
+ if (q == (Quantum *) NULL)
break;
- for (x=0; x < (long) image->columns; x++)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
- q->red=ScaleCharToQuantum(pBits->rgbRed);
- q->green=ScaleCharToQuantum(pBits->rgbGreen);
- q->blue=ScaleCharToQuantum(pBits->rgbBlue);
- q->opacity=OpaqueOpacity;
+ SetPixelRed(image,ScaleCharToQuantum(pBits->rgbRed),q);
+ SetPixelGreen(image,ScaleCharToQuantum(pBits->rgbGreen),q);
+ SetPixelBlue(image,ScaleCharToQuantum(pBits->rgbBlue),q);
+ SetPixelAlpha(image,OpaqueAlpha,q);
pBits++;
- q++;
+ q+=GetPixelChannels(image);
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
%
% The format of the RegisterCLIPBOARDImage method is:
%
-% unsigned long RegisterCLIPBOARDImage(void)
+% size_t RegisterCLIPBOARDImage(void)
%
*/
-ModuleExport unsigned long RegisterCLIPBOARDImage(void)
+ModuleExport size_t RegisterCLIPBOARDImage(void)
{
MagickInfo
*entry;
entry->encoder=(EncodeImageHandler *) WriteCLIPBOARDImage;
#endif
entry->adjoin=MagickFalse;
- entry->format_type=ExplicitFormatType;
+ entry->format_type=ImplicitFormatType;
entry->description=ConstantString("The system clipboard");
entry->module=ConstantString("CLIPBOARD");
(void) RegisterMagickInfo(entry);
% The format of the WriteCLIPBOARDImage method is:
%
% MagickBooleanType WriteCLIPBOARDImage(const ImageInfo *image_info,
-% Image *image)
+% Image *image,ExceptionInfo *exception)
%
% A description of each parameter follows.
%
%
% o image: The image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
#if defined(MAGICKCORE_WINGDI32_DELEGATE)
static MagickBooleanType WriteCLIPBOARDImage(const ImageInfo *image_info,
- Image *image)
+ Image *image,ExceptionInfo *exception)
{
/*
Allocate memory for pixels.
HBITMAP
bitmapH;
- OpenClipboard( NULL );
+ OpenClipboard(NULL);
EmptyClipboard();
- bitmapH=(HBITMAP) ImageToHBITMAP(image);
+ bitmapH=(HBITMAP) ImageToHBITMAP(image,exception);
SetClipboardData(CF_BITMAP,bitmapH);
CloseClipboard();
}
return(MagickTrue);
}
#endif /* MAGICKCORE_WINGDI32_DELEGATE */
-