% July 1992 %
% %
% %
-% 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 "magick/blob.h"
-#include "magick/blob-private.h"
-#include "magick/cache.h"
-#include "magick/colormap.h"
-#include "magick/constitute.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"
+#include "MagickCore/studio.h"
+#include "MagickCore/blob.h"
+#include "MagickCore/blob-private.h"
+#include "MagickCore/cache.h"
+#include "MagickCore/colormap.h"
+#include "MagickCore/constitute.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/monitor.h"
+#include "MagickCore/monitor-private.h"
+#include "MagickCore/pixel-accessor.h"
+#include "MagickCore/quantum-private.h"
+#include "MagickCore/static.h"
+#include "MagickCore/string_.h"
+#include "MagickCore/module.h"
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
#define GetBit(alpha,i) MagickMin((((size_t) (alpha) >> (size_t) \
(i)) & 0x01),16)
-#define SetBit(alpha,i,set) (alpha)=(IndexPacket) ((set) != 0 ? \
- (size_t) (alpha) | (one << (size_t) (i)) : (size_t) \
- (alpha) & ~(one << (size_t) (i)))
+#define SetBit(i,set) SetPixelIndex(image,((set) != 0 ? \
+ (size_t) GetPixelIndex(image,q) | (one << (size_t) (i)) : \
+ (size_t) GetPixelIndex(image,q) & ~(one << (size_t) (i))),q)
Image
*image,
ImageInfo
*read_info;
- ssize_t
- c,
- i,
- j,
- k,
- y;
+ int
+ c;
MagickBooleanType
status;
- PixelPacket
+ PixelInfo
pixel;
- register IndexPacket
- *indexes;
+ register Quantum
+ *q;
register ssize_t
x;
- register PixelPacket
- *q;
-
size_t
depth,
one;
+ ssize_t
+ i,
+ j,
+ k,
+ y;
+
/*
Initialize Image structure.
*/
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
one=1;
- image=AcquireImage(image_info);
+ image=AcquireImage(image_info,exception);
if ((image->columns == 0) || (image->rows == 0))
ThrowReaderException(OptionError,"MustSpecifyImageSize");
read_info=CloneImageInfo(image_info);
if (watermark == (Image *) NULL)
return((Image *) NULL);
watermark->depth=MAGICKCORE_QUANTUM_DEPTH;
- if (AcquireImageColormap(image,MaxColormapSize) == MagickFalse)
+ if (AcquireImageColormap(image,MaxColormapSize,exception) == MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
if (image_info->ping != MagickFalse)
{
c=0;
i=0;
j=0;
- i=MAGICKCORE_QUANTUM_DEPTH-1;
- depth=MAGICKCORE_QUANTUM_DEPTH;
+ i=(ssize_t) (watermark->depth-1);
+ depth=watermark->depth;
for (k=image->offset; (i >= 0) && (j < (ssize_t) depth); i--)
{
for (y=0; (y < (ssize_t) image->rows) && (j < (ssize_t) depth); y++)
{
x=0;
- for (; (x < (ssize_t) image->columns) && (j < (ssize_t) depth); x++)
+ for ( ; (x < (ssize_t) image->columns) && (j < (ssize_t) depth); x++)
{
if ((k/(ssize_t) watermark->columns) >= (ssize_t) watermark->rows)
break;
- (void) GetOneVirtualPixel(watermark,k % (ssize_t) watermark->columns,
- k/(ssize_t) watermark->columns,&pixel,exception);
+ (void) GetOneVirtualPixelInfo(watermark,UndefinedVirtualPixelMethod,
+ k % (ssize_t) watermark->columns,k/(ssize_t) watermark->columns,
+ &pixel,exception);
q=GetAuthenticPixels(image,x,y,1,1,exception);
- if (q == (PixelPacket *) NULL)
+ if (q == (Quantum *) NULL)
break;
- indexes=GetAuthenticIndexQueue(image);
switch (c)
{
case 0:
{
- SetBit(*indexes,i,GetBit(pixel.red,j));
+ SetBit(i,GetBit(pixel.red,j));
break;
}
case 1:
{
- SetBit(*indexes,i,GetBit(pixel.green,j));
+ SetBit(i,GetBit(pixel.green,j));
break;
}
case 2:
{
- SetBit(*indexes,i,GetBit(pixel.blue,j));
+ SetBit(i,GetBit(pixel.blue,j));
break;
}
}
j++;
}
}
- status=SetImageProgress(image,LoadImagesTag,i,depth);
+ status=SetImageProgress(image,LoadImagesTag,(MagickOffsetType) i,depth);
if (status == MagickFalse)
break;
}
watermark=DestroyImage(watermark);
- (void) SyncImage(image);
+ (void) SyncImage(image,exception);
return(GetFirstImageInList(image));
}
\f