% Read/Write Slow Scan TeleVision Image Format %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% July 1992 %
% %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2014 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 %
Forward declarations.
*/
static MagickBooleanType
- WriteHRZImage(const ImageInfo *,Image *);
+ WriteHRZImage(const ImageInfo *,Image *,ExceptionInfo *);
\f
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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)
{
ThrowReaderException(CorruptImageError,"UnableToReadImageData");
p=pixels;
q=QueueAuthenticPixels(image,0,y,image->columns,1,exception);
- if (q == (const Quantum *) NULL)
+ if (q == (Quantum *) NULL)
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- SetPixelRed(image,4*ScaleCharToQuantum(*p++),q);
- SetPixelGreen(image,4*ScaleCharToQuantum(*p++),q);
- SetPixelBlue(image,4*ScaleCharToQuantum(*p++),q);
+ SetPixelRed(image,ScaleCharToQuantum(4**p++),q);
+ SetPixelGreen(image,ScaleCharToQuantum(4**p++),q);
+ SetPixelBlue(image,ScaleCharToQuantum(4**p++),q);
SetPixelAlpha(image,OpaqueAlpha,q);
- q+=GetPixelComponents(image);
+ q+=GetPixelChannels(image);
}
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
%
% The format of the WriteHRZImage method is:
%
-% MagickBooleanType WriteHRZImage(const ImageInfo *image_info,Image *image)
+% MagickBooleanType WriteHRZImage(const ImageInfo *image_info,
+% Image *image,ExceptionInfo *exception)
%
% A description of each parameter follows.
%
%
% o image: The image.
%
+% o exception: return any errors or warnings in this structure.
+%
*/
-static MagickBooleanType WriteHRZImage(const ImageInfo *image_info,Image *image)
+static MagickBooleanType WriteHRZImage(const ImageInfo *image_info,Image *image,
+ ExceptionInfo *exception)
{
Image
*hrz_image;
assert(image->signature == MagickSignature);
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
- status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
+ assert(exception != (ExceptionInfo *) NULL);
+ assert(exception->signature == MagickSignature);
+ status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
- hrz_image=ResizeImage(image,256,240,image->filter,image->blur,
- &image->exception);
+ hrz_image=ResizeImage(image,256,240,image->filter,exception);
if (hrz_image == (Image *) NULL)
return(MagickFalse);
- if (IsRGBColorspace(hrz_image->colorspace) == MagickFalse)
- (void) TransformImageColorspace(hrz_image,RGBColorspace);
+ (void) TransformImageColorspace(hrz_image,sRGBColorspace,exception);
/*
Allocate memory for pixels.
*/
*/
for (y=0; y < (ssize_t) hrz_image->rows; y++)
{
- p=GetVirtualPixels(hrz_image,0,y,hrz_image->columns,1,&image->exception);
+ p=GetVirtualPixels(hrz_image,0,y,hrz_image->columns,1,exception);
if (p == (const Quantum *) NULL)
break;
q=pixels;
for (x=0; x < (ssize_t) hrz_image->columns; x++)
{
- *q++=ScaleQuantumToChar(GetPixelRed(hrz_image,p))/4;
- *q++=ScaleQuantumToChar(GetPixelGreen(hrz_image,p))/4;
- *q++=ScaleQuantumToChar(GetPixelBlue(hrz_image,p))/4;
- p+=GetPixelComponents(hrz_image);
+ *q++=ScaleQuantumToChar(GetPixelRed(hrz_image,p)/4);
+ *q++=ScaleQuantumToChar(GetPixelGreen(hrz_image,p)/4);
+ *q++=ScaleQuantumToChar(GetPixelBlue(hrz_image,p)/4);
+ p+=GetPixelChannels(hrz_image);
}
count=WriteBlob(image,(size_t) (q-pixels),pixels);
if (count != (ssize_t) (q-pixels))