]> granicus.if.org Git - imagemagick/blobdiff - coders/ycbcr.c
(no commit message)
[imagemagick] / coders / ycbcr.c
index ede8af19498c716348bae7456e034bbfbeaa2e03..c596d24a907f19630b71c72e2eb1b988f91faa55 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  %
@@ -102,9 +102,6 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
     *canvas_image,
     *image;
 
-  ssize_t
-    y;
-
   MagickBooleanType
     status;
 
@@ -127,12 +124,13 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
   register PixelPacket
     *q;
 
-  ssize_t
-    count;
-
   size_t
     length;
 
+  ssize_t
+    count,
+    y;
+
   unsigned char
     *pixels;
 
@@ -320,11 +318,28 @@ static Image *ReadYCBCRImage(const ImageInfo *image_info,
                 {
                   switch (quantum_type)
                   {
-                    case RedQuantum: SetRedPixelComponent(q,GetRedPixelComponent(p)); break;
-                    case GreenQuantum: SetGreenPixelComponent(q,GetGreenPixelComponent(p)); break;
-                    case BlueQuantum: SetBluePixelComponent(q,GetBluePixelComponent(p)); break;
-                    case OpacityQuantum: SetOpacityPixelComponent(q,GetOpacityPixelComponent(p)); break;
-                    default: break;
+                    case RedQuantum:
+                    {
+                      SetRedPixelComponent(q,GetRedPixelComponent(p));
+                      break;
+                    }
+                    case GreenQuantum:
+                    {
+                      SetGreenPixelComponent(q,GetGreenPixelComponent(p));
+                      break;
+                    }
+                    case BlueQuantum:
+                    {
+                      SetBluePixelComponent(q,GetBluePixelComponent(p));
+                      break;
+                    }
+                    case OpacityQuantum:
+                    {
+                      SetOpacityPixelComponent(q,GetOpacityPixelComponent(p));
+                      break;
+                    }
+                    default:
+                      break;
                   }
                   p++;
                   q++;
@@ -940,9 +955,6 @@ ModuleExport void UnregisterYCBCRImage(void)
 static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
   Image *image)
 {
-  ssize_t
-    y;
-
   MagickBooleanType
     status;
 
@@ -958,12 +970,13 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
   register const PixelPacket
     *p;
 
-  ssize_t
-    count;
-
   size_t
     length;
 
+  ssize_t
+    count,
+    y;
+
   unsigned char
     *pixels;
 
@@ -1019,8 +1032,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
           p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
           if (p == (const PixelPacket *) NULL)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            quantum_type,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,quantum_type,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;
@@ -1044,18 +1057,18 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
           p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
           if (p == (const PixelPacket *) NULL)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            RedQuantum,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,RedQuantum,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            GreenQuantum,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,GreenQuantum,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            BlueQuantum,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,BlueQuantum,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;
@@ -1087,8 +1100,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
           p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
           if (p == (const PixelPacket *) NULL)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            RedQuantum,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,RedQuantum,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;
@@ -1104,8 +1117,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
           p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
           if (p == (const PixelPacket *) NULL)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            GreenQuantum,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,GreenQuantum,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;
@@ -1121,8 +1134,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
           p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
           if (p == (const PixelPacket *) NULL)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            BlueQuantum,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,BlueQuantum,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;
@@ -1174,8 +1187,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
           p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
           if (p == (const PixelPacket *) NULL)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            RedQuantum,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,RedQuantum,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;
@@ -1197,8 +1210,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
           p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
           if (p == (const PixelPacket *) NULL)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            GreenQuantum,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,GreenQuantum,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;
@@ -1220,8 +1233,8 @@ static MagickBooleanType WriteYCBCRImage(const ImageInfo *image_info,
           p=GetVirtualPixels(image,0,y,image->columns,1,&image->exception);
           if (p == (const PixelPacket *) NULL)
             break;
-          length=ExportQuantumPixels(image,(const CacheView *) NULL,quantum_info,
-            BlueQuantum,pixels,&image->exception);
+          length=ExportQuantumPixels(image,(const CacheView *) NULL,
+            quantum_info,BlueQuantum,pixels,&image->exception);
           count=WriteBlob(image,length,pixels);
           if (count != (ssize_t) length)
             break;