]> granicus.if.org Git - imagemagick/blobdiff - coders/hrz.c
(no commit message)
[imagemagick] / coders / hrz.c
index 4a9f21c7bc5f7532732d3d68d1e61c472db7574c..c8ea57dbfb6a167f53441588fccfe63fc86f6856 100644 (file)
@@ -17,7 +17,7 @@
 %                                 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  %
@@ -95,9 +95,6 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception)
   Image
     *image;
 
-  ssize_t
-    y;
-
   MagickBooleanType
     status;
 
@@ -111,7 +108,8 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception)
     *p;
 
   ssize_t
-    count;
+    count,
+    y;
 
   size_t
     length;
@@ -142,8 +140,8 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception)
   image->columns=256;
   image->rows=240;
   image->depth=8;
-  pixels=(unsigned char *) AcquireQuantumMemory(image->columns,
-    3*sizeof(*pixels));
+  pixels=(unsigned char *) AcquireQuantumMemory(image->columns,3*
+    sizeof(*pixels));
   if (pixels == (unsigned char *) NULL) 
     ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
   length=(size_t) (3*image->columns);
@@ -158,9 +156,9 @@ static Image *ReadHRZImage(const ImageInfo *image_info,ExceptionInfo *exception)
       break;
     for (x=0; x < (ssize_t) image->columns; x++)
     {
-      q->red=4*ScaleCharToQuantum(*p++);
-      q->green=4*ScaleCharToQuantum(*p++);
-      q->blue=4*ScaleCharToQuantum(*p++);
+      SetRedPixelComponent(q,4*ScaleCharToQuantum(*p++));
+      SetGreenPixelComponent(q,4*ScaleCharToQuantum(*p++));
+      SetBluePixelComponent(q,4*ScaleCharToQuantum(*p++));
       SetOpacityPixelComponent(q,OpaqueOpacity);
       q++;
     }