% July 1992 %
% %
% %
-% Copyright 1999-2009 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2011 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 "magick/blob.h"
#include "magick/blob-private.h"
#include "magick/cache.h"
+#include "magick/colormap.h"
#include "magick/colorspace.h"
#include "magick/constitute.h"
#include "magick/exception.h"
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
+#include "magick/module.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/quantum-private.h"
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
-#include "magick/module.h"
+#include "magick/string-private.h"
\f
/*
Forward declarations.
int
c;
- long
- y;
-
MagickBooleanType
status,
value_expected;
register PixelPacket
*q;
- ssize_t
- count;
-
size_t
length;
+ ssize_t
+ count,
+ y;
+
unsigned char
*pixels;
Assign a value to the specified keyword.
*/
if (LocaleCompare(keyword,"Label_RECORDS") == 0)
- length=(ssize_t) atol(value);
+ length=(ssize_t) StringToLong(value);
if (LocaleCompare(keyword,"LBLSIZE") == 0)
- length=(ssize_t) atol(value);
+ length=(ssize_t) StringToLong(value);
if (LocaleCompare(keyword,"RECORD_BYTES") == 0)
- image->columns=1UL*atol(value);
+ image->columns=StringToUnsignedLong(value);
if (LocaleCompare(keyword,"NS") == 0)
- image->columns=1UL*atol(value);
+ image->columns=StringToUnsignedLong(value);
if (LocaleCompare(keyword,"LINES") == 0)
- image->rows=1UL*atol(value);
+ image->rows=StringToUnsignedLong(value);
if (LocaleCompare(keyword,"NL") == 0)
- image->rows=1UL*atol(value);
+ image->rows=StringToUnsignedLong(value);
}
while (isspace((int) ((unsigned char) c)) != 0)
{
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
pixels=GetQuantumPixels(quantum_info);
length=GetQuantumExtent(image,quantum_info,IndexQuantum);
- 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)
quantum_type,pixels,exception);
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
- status=SetImageProgress(image,LoadImageTag,y,image->rows);
+ status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
+ image->rows);
if (status == MagickFalse)
break;
}
%
% The format of the RegisterVICARImage method is:
%
-% unsigned long RegisterVICARImage(void)
+% size_t RegisterVICARImage(void)
%
*/
-ModuleExport unsigned long RegisterVICARImage(void)
+ModuleExport size_t RegisterVICARImage(void)
{
MagickInfo
*entry;
% stacked together to form image cubes. This method only writes a single
% grayscale plane.
%
-% WriteVICARImage was written contributed by
-% gorelick@esther.la.asu.edu.
+% WriteVICARImage was written contributed by gorelick@esther.la.asu.edu.
%
% The format of the WriteVICARImage method is:
%
register const PixelPacket
*p;
- ssize_t
- count;
-
size_t
length;
+ ssize_t
+ count;
+
unsigned char
*pixels;
*/
(void) ResetMagickMemory(header,' ',MaxTextExtent);
(void) FormatMagickString(header,MaxTextExtent,
- "LBLSIZE=%lu FORMAT='BYTE' TYPE='IMAGE' BUFSIZE=20000 DIM=2 EOL=0 "
- "RECSIZE=%lu ORG='BSQ' NL=%lu NS=%lu NB=1 N1=0 N2=0 N3=0 N4=0 NBB=0 "
- "NLB=0 TASK='ImageMagick'",(unsigned long) MaxTextExtent,image->columns,
- image->rows,image->columns);
+ "LBLSIZE=%.20g FORMAT='BYTE' TYPE='IMAGE' BUFSIZE=20000 DIM=2 EOL=0 "
+ "RECSIZE=%.20g ORG='BSQ' NL=%.20g NS=%.20g NB=1 N1=0 N2=0 N3=0 N4=0 NBB=0 "
+ "NLB=0 TASK='ImageMagick'",(double) MaxTextExtent,(double) image->columns,
+ (double) image->rows,(double) image->columns);
(void) WriteBlob(image,MaxTextExtent,(unsigned char *) header);
/*
Write VICAR pixels.
if (quantum_info == (QuantumInfo *) NULL)
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
pixels=GetQuantumPixels(quantum_info);
- for (y=0; y < (long) image->rows; y++)
+ for (y=0; y < (ssize_t) image->rows; y++)
{
p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
if (p == (const PixelPacket *) NULL)
count=WriteBlob(image,length,pixels);
if (count != (ssize_t) length)
break;
- status=SetImageProgress(image,SaveImageTag,y,image->rows);
+ status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
+ image->rows);
if (status == MagickFalse)
break;
}