% April 2007 %
% %
% %
-% Copyright 1999-2010 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 %
min_x,
min_y;
- long
- y;
+ MagickBooleanType
+ status;
- register long
+ register ssize_t
x;
register PixelPacket
*q;
- MagickBooleanType
- status;
+ ssize_t
+ y;
/*
Open image.
(void) ImfCloseInputFile(file);
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
}
- 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)
ImfInputSetFrameBuffer(file,scanline-min_x-image->columns*(min_y+y),1,
image->columns);
ImfInputReadPixels(file,min_y+y,min_y+y);
- for (x=0; x < (long) image->columns; x++)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
- q->red=ClampToQuantum((MagickRealType) QuantumRange*ImfHalfToFloat(
- scanline[x].r));
- q->green=ClampToQuantum((MagickRealType) QuantumRange*ImfHalfToFloat(
- scanline[x].g));
- q->blue=ClampToQuantum((MagickRealType) QuantumRange*ImfHalfToFloat(
- scanline[x].b));
- q->opacity=ClampToQuantum((MagickRealType) QuantumRange-QuantumRange*
- ImfHalfToFloat(scanline[x].a));
+ SetRedPixelComponent(q,ClampToQuantum((MagickRealType) QuantumRange*
+ ImfHalfToFloat(scanline[x].r)));
+ SetGreenPixelComponent(q,ClampToQuantum((MagickRealType) QuantumRange*
+ ImfHalfToFloat(scanline[x].g)));
+ SetBluePixelComponent(q,ClampToQuantum((MagickRealType) QuantumRange*
+ ImfHalfToFloat(scanline[x].b)));
+ SetOpacityPixelComponent(q,ClampToQuantum((MagickRealType) QuantumRange-
+ QuantumRange*ImfHalfToFloat(scanline[x].a)));
q++;
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
%
% The format of the RegisterEXRImage method is:
%
-% unsigned long RegisterEXRImage(void)
+% size_t RegisterEXRImage(void)
%
*/
-ModuleExport unsigned long RegisterEXRImage(void)
+ModuleExport size_t RegisterEXRImage(void)
{
MagickInfo
*entry;
int
compression;
- long
- y;
-
MagickBooleanType
status;
register const PixelPacket
*p;
- register long
+ register ssize_t
x;
+ ssize_t
+ y;
+
/*
Open output image file.
*/
(void) ImfCloseOutputFile(file);
ThrowWriterException(ResourceLimitError,"MemoryAllocationFailed");
}
- 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)
break;
- for (x=0; x < (long) image->columns; x++)
+ for (x=0; x < (ssize_t) image->columns; x++)
{
- ImfFloatToHalf(QuantumScale*p->red,&half_quantum);
+ ImfFloatToHalf(QuantumScale*GetRedPixelComponent(p),&half_quantum);
scanline[x].r=half_quantum;
- ImfFloatToHalf(QuantumScale*p->green,&half_quantum);
+ ImfFloatToHalf(QuantumScale*GetGreenPixelComponent(p),&half_quantum);
scanline[x].g=half_quantum;
- ImfFloatToHalf(QuantumScale*p->blue,&half_quantum);
+ ImfFloatToHalf(QuantumScale*GetBluePixelComponent(p),&half_quantum);
scanline[x].b=half_quantum;
if (image->matte == MagickFalse)
ImfFloatToHalf(1.0,&half_quantum);
else
- ImfFloatToHalf(1.0-QuantumScale*p->opacity,&half_quantum);
+ ImfFloatToHalf(1.0-QuantumScale*GetOpacityPixelComponent(p),
+ &half_quantum);
scanline[x].a=half_quantum;
p++;
}