% July 1992 %
% %
% %
-% 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 %
%
% o exception: return any errors or warnings in this structure.
%
-%
*/
static Image *ReadUYVYImage(const ImageInfo *image_info,
ExceptionInfo *exception)
Image
*image;
- ssize_t
- y;
-
MagickBooleanType
status;
register PixelPacket
*q;
- register ssize_t
- i;
+ ssize_t
+ y;
unsigned char
u,
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
return((Image *) NULL);
- for (i=0; i < image->offset; i++)
- if (ReadBlobByte(image) == EOF)
- {
- ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
- image->filename);
- break;
- }
+ if (DiscardBlobBytes(image,image->offset) == MagickFalse)
+ ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
+ image->filename);
image->depth=8;
if (image_info->ping != MagickFalse)
{
y1=(unsigned char) ReadBlobByte(image);
v=(unsigned char) ReadBlobByte(image);
y2=(unsigned char) ReadBlobByte(image);
- q->red=ScaleCharToQuantum(y1);
- q->green=ScaleCharToQuantum(u);
- q->blue=ScaleCharToQuantum(v);
+ SetRedPixelComponent(q,ScaleCharToQuantum(y1));
+ SetGreenPixelComponent(q,ScaleCharToQuantum(u));
+ SetBluePixelComponent(q,ScaleCharToQuantum(v));
q++;
- q->red=ScaleCharToQuantum(y2);
- q->green=ScaleCharToQuantum(u);
- q->blue=ScaleCharToQuantum(v);
+ SetRedPixelComponent(q,ScaleCharToQuantum(y2));
+ SetGreenPixelComponent(q,ScaleCharToQuantum(u));
+ SetBluePixelComponent(q,ScaleCharToQuantum(v));
q++;
}
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;
}
Image
*uyvy_image;
- ssize_t
- y;
-
MagickBooleanType
full,
status;
register ssize_t
x;
+ ssize_t
+ y;
+
/*
Open output image file.
*/
(void) WriteBlobByte(image,ScaleQuantumToChar((Quantum) pixel.green));
(void) WriteBlobByte(image,ScaleQuantumToChar((Quantum) pixel.red));
(void) WriteBlobByte(image,ScaleQuantumToChar((Quantum) pixel.blue));
- (void) WriteBlobByte(image,ScaleQuantumToChar(GetRedPixelComponent(p)));
+ (void) WriteBlobByte(image,ScaleQuantumToChar(
+ GetRedPixelComponent(p)));
}
pixel.red=(double) GetRedPixelComponent(p);
pixel.green=(double) GetGreenPixelComponent(p);
full=full == MagickFalse ? MagickTrue : MagickFalse;
p++;
}
- status=SetImageProgress(image,LoadImageTag,y,image->rows);
+ status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
+ image->rows);
if (status == MagickFalse)
break;
}