% July 1992 %
% %
% %
-% Copyright 1999-2009 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/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/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/module.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/string-private.h"
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Image
*image;
- long
- y;
-
MagickBooleanType
status;
- MagickRealType
+ double
height,
width;
Quantum
pixel;
- register IndexPacket
- *indexes;
-
- register long
+ register ssize_t
i,
x;
- register PixelPacket
+ register Quantum
*q;
ssize_t
- count;
+ count,
+ y;
unsigned char
buffer[768];
- unsigned long
+ size_t
separations,
separations_mask,
units;
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- image=AcquireImage(image_info);
+ image=AcquireImage(image_info,exception);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
{
Read control block.
*/
count=ReadBlob(image,80,buffer);
+ (void) count;
count=ReadBlob(image,2,(unsigned char *) magick);
if ((LocaleNCompare((char *) magick,"CT",2) != 0) &&
(LocaleNCompare((char *) magick,"LW",2) != 0) &&
separations_mask=ReadBlobMSBShort(image);
count=ReadBlob(image,14,buffer);
buffer[14]='\0';
- height=atof((char *) buffer);
+ height=StringToDouble((char *) buffer,(char **) NULL);
count=ReadBlob(image,14,buffer);
- width=atof((char *) buffer);
+ width=StringToDouble((char *) buffer,(char **) NULL);
count=ReadBlob(image,12,buffer);
buffer[12]='\0';
- image->rows=1UL*atol((char *) buffer);
+ image->rows=StringToUnsignedLong((char *) buffer);
count=ReadBlob(image,12,buffer);
- image->columns=1UL*atol((char *) buffer);
+ image->columns=StringToUnsignedLong((char *) buffer);
count=ReadBlob(image,200,buffer);
count=ReadBlob(image,768,buffer);
if (separations_mask == 0x0f)
- image->colorspace=CMYKColorspace;
- image->x_resolution=1.0*image->columns/width;
- image->y_resolution=1.0*image->rows/height;
+ SetImageColorspace(image,CMYKColorspace,exception);
+ image->resolution.x=1.0*image->columns/width;
+ image->resolution.y=1.0*image->rows/height;
if (image_info->ping != MagickFalse)
{
(void) CloseBlob(image);
/*
Convert SCT raster image to pixel packets.
*/
- for (y=0; y < (long) image->rows; y++)
+ for (y=0; y < (ssize_t) image->rows; y++)
{
- for (i=0; i < (long) separations; i++)
+ for (i=0; i < (ssize_t) separations; i++)
{
q=GetAuthenticPixels(image,0,y,image->columns,1,exception);
- if (q == (PixelPacket *) NULL)
+ if (q == (Quantum *) NULL)
break;
- indexes=GetAuthenticIndexQueue(image);
- for (x=0; x < (long) image->columns; x++)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
pixel=(Quantum) ScaleCharToQuantum((unsigned char) ReadBlobByte(image));
if (image->colorspace == CMYKColorspace)
{
case 0:
{
- q->red=pixel;
- q->green=pixel;
- q->blue=pixel;
+ SetPixelRed(image,pixel,q);
+ SetPixelGreen(image,pixel,q);
+ SetPixelBlue(image,pixel,q);
break;
}
case 1:
{
- q->green=pixel;
+ SetPixelGreen(image,pixel,q);
break;
}
case 2:
{
- q->blue=pixel; break;
+ SetPixelBlue(image,pixel,q);
break;
}
case 3:
{
if (image->colorspace == CMYKColorspace)
- indexes[x]=(IndexPacket) pixel;
+ SetPixelBlack(image,pixel,q);
break;
}
}
- q++;
+ q+=GetPixelChannels(image);
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
if ((image->columns % 2) != 0)
(void) ReadBlobByte(image); /* pad */
}
- status=SetImageProgress(image,LoadImageTag,y,image->rows);
+ status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
+ image->rows);
if (status == MagickFalse)
break;
}
%
% The format of the RegisterSCTImage method is:
%
-% unsigned long RegisterSCTImage(void)
+% size_t RegisterSCTImage(void)
%
*/
-ModuleExport unsigned long RegisterSCTImage(void)
+ModuleExport size_t RegisterSCTImage(void)
{
MagickInfo
*entry;