diff --git a/coders/dpx.c b/coders/dpx.c
index b439be4..788e05e 100644
--- a/coders/dpx.c
+++ b/coders/dpx.c
@@ -549,10 +549,6 @@
Image
*image;
- ssize_t
- row,
- y;
-
MagickBooleanType
status;
@@ -568,18 +564,18 @@
register ssize_t
i;
- ssize_t
- count;
-
size_t
- extent;
+ extent,
+ samples_per_pixel;
+
+ ssize_t
+ count,
+ row,
+ y;
unsigned char
component_type;
- size_t
- samples_per_pixel;
-
/*
Open image file.
*/
@@ -681,14 +677,14 @@
switch (dpx.image.orientation)
{
default:
- case 0: image->orientation=TopLeftOrientation; break;
- case 1: image->orientation=TopRightOrientation; break;
- case 2: image->orientation=BottomLeftOrientation; break;
- case 3: image->orientation=BottomRightOrientation; break;
- case 4: image->orientation=LeftTopOrientation; break;
- case 5: image->orientation=RightTopOrientation; break;
- case 6: image->orientation=LeftBottomOrientation; break;
- case 7: image->orientation=RightBottomOrientation; break;
+ case 0: image->orientation=TopLeftOrientation; break;
+ case 1: image->orientation=TopRightOrientation; break;
+ case 2: image->orientation=BottomLeftOrientation; break;
+ case 3: image->orientation=BottomRightOrientation; break;
+ case 4: image->orientation=LeftTopOrientation; break;
+ case 5: image->orientation=RightTopOrientation; break;
+ case 6: image->orientation=LeftBottomOrientation; break;
+ case 7: image->orientation=RightBottomOrientation; break;
}
dpx.image.number_elements=ReadBlobShort(image);
offset+=2;
@@ -1078,21 +1074,19 @@
MagickTrue : MagickFalse);
for (y=0; y < (ssize_t) image->rows; y++)
{
- ssize_t
- offset;
-
MagickBooleanType
sync;
register PixelPacket
*q;
- ssize_t
- count;
-
size_t
length;
+ ssize_t
+ count,
+ offset;
+
unsigned char
*pixels;
@@ -1108,7 +1102,7 @@
proceed;
proceed=SetImageProgress(image,LoadImageTag,(MagickOffsetType) row,
- image->rows);
+ image->rows);
if (proceed == MagickFalse)
status=MagickFalse;
}
@@ -1288,11 +1282,6 @@
DPXInfo
dpx;
- ssize_t
- horizontal_factor,
- vertical_factor,
- y;
-
MagickBooleanType
status;
@@ -1317,12 +1306,15 @@
register ssize_t
i;
+ ssize_t
+ count,
+ horizontal_factor,
+ vertical_factor,
+ y;
+
size_t
extent;
- ssize_t
- count;
-
time_t
seconds;
@@ -1823,7 +1815,7 @@
if (count != (ssize_t) extent)
break;
status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
- image->rows);
+ image->rows);
if (status == MagickFalse)
break;
}
diff --git a/coders/emf.c b/coders/emf.c
index a12b507..44f336c 100644
--- a/coders/emf.c
+++ b/coders/emf.c
@@ -42,7 +42,6 @@
# if defined(__CYGWIN__)
# include <windows.h>
# else
- /* All MinGW needs ... */
# include <wingdi.h>
# endif
#endif
@@ -447,11 +446,6 @@
Image
*image;
- ssize_t
- height,
- width,
- y;
-
RECT
rect;
@@ -465,6 +459,11 @@
*pBits,
*ppBits;
+ ssize_t
+ height,
+ width,
+ y;
+
image=AcquireImage(image_info);
hemf=ReadEnhMetaFile(image_info->filename,&width,&height);
if (hemf == (HENHMETAFILE) NULL)
@@ -489,8 +488,7 @@
if (image->units == PixelsPerCentimeterResolution)
x_resolution*=CENTIMETERS_INCH;
}
- image->rows=(size_t) ((height/1000.0/CENTIMETERS_INCH)*
- y_resolution+0.5);
+ image->rows=(size_t) ((height/1000.0/CENTIMETERS_INCH)*y_resolution+0.5);
image->columns=(size_t) ((width/1000.0/CENTIMETERS_INCH)*
x_resolution+0.5);
}
@@ -510,15 +508,15 @@
char
*geometry;
- ssize_t
- sans;
-
register char
*p;
MagickStatusType
flags;
+ ssize_t
+ sans;
+
geometry=GetPageGeometry(image_info->page);
p=strchr(geometry,'>');
if (p == (char *) NULL)
@@ -526,11 +524,10 @@
flags=ParseMetaGeometry(geometry,&sans,&sans,&image->columns,
&image->rows);
if (image->x_resolution != 0.0)
- image->columns=(size_t) floor((image->columns*
- image->x_resolution)+0.5);
- if (image->y_resolution != 0.0)
- image->rows=(size_t) floor((image->rows*image->y_resolution)+
+ image->columns=(size_t) floor((image->columns*image->x_resolution)+
0.5);
+ if (image->y_resolution != 0.0)
+ image->rows=(size_t) floor((image->rows*image->y_resolution)+0.5);
}
else
{
@@ -538,11 +535,11 @@
flags=ParseMetaGeometry(geometry,&sans,&sans,&image->columns,
&image->rows);
if (image->x_resolution != 0.0)
- image->columns=(size_t) floor(((image->columns*
- image->x_resolution)/DefaultResolution)+0.5);
+ image->columns=(size_t) floor(((image->columns*image->x_resolution)/
+ DefaultResolution)+0.5);
if (image->y_resolution != 0.0)
- image->rows=(size_t) floor(((image->rows*
- image->y_resolution)/DefaultResolution)+0.5);
+ image->rows=(size_t) floor(((image->rows*image->y_resolution)/
+ DefaultResolution)+0.5);
}
geometry=DestroyString(geometry);
}
@@ -562,8 +559,8 @@
DIBinfo.bmiHeader.biPlanes=1;
DIBinfo.bmiHeader.biBitCount=32;
DIBinfo.bmiHeader.biCompression=BI_RGB;
- hBitmap=CreateDIBSection(hDC,&DIBinfo,DIB_RGB_COLORS,(void **) &ppBits,
- NULL,0);
+ hBitmap=CreateDIBSection(hDC,&DIBinfo,DIB_RGB_COLORS,(void **) &ppBits,NULL,
+ 0);
ReleaseDC(NULL,hDC);
if (hBitmap == (HBITMAP) NULL)
{
@@ -615,9 +612,9 @@
break;
for (x=0; x < (ssize_t) image->columns; x++)
{
- q->red=ScaleCharToQuantum(pBits->rgbRed);
- q->green=ScaleCharToQuantum(pBits->rgbGreen);
- q->blue=ScaleCharToQuantum(pBits->rgbBlue);
+ SetRedComponentPixel(q,ScaleCharToQuantum(pBits->rgbRed));
+ SetGreenComponentPixel(q,ScaleCharToQuantum(pBits->rgbGreen));
+ SetBlueComponentPixel(q,ScaleCharToQuantum(pBits->rgbBlue));
SetOpacityPixelComponent(q,OpaqueOpacity);
pBits++;
q++;
diff --git a/coders/ept.c b/coders/ept.c
index 89755d7..72e4003 100644
--- a/coders/ept.c
+++ b/coders/ept.c
@@ -165,15 +165,15 @@
ImageInfo
*read_info;
- ssize_t
- count;
-
MagickBooleanType
status;
MagickOffsetType
offset;
+ ssize_t
+ count;
+
/*
Open image file.
*/
diff --git a/coders/exr.c b/coders/exr.c
index e481272..ccd9c97 100644
--- a/coders/exr.c
+++ b/coders/exr.c
@@ -151,8 +151,8 @@
min_x,
min_y;
- ssize_t
- y;
+ MagickBooleanType
+ status;
register ssize_t
x;
@@ -160,8 +160,8 @@
register PixelPacket
*q;
- MagickBooleanType
- status;
+ ssize_t
+ y;
/*
Open image.
@@ -224,14 +224,14 @@
ImfInputReadPixels(file,min_y+y,min_y+y);
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)
@@ -359,9 +359,6 @@
int
compression;
- ssize_t
- y;
-
MagickBooleanType
status;
@@ -371,6 +368,9 @@
register ssize_t
x;
+ ssize_t
+ y;
+
/*
Open output image file.
*/
@@ -440,7 +440,8 @@
if (image->matte == MagickFalse)
ImfFloatToHalf(1.0,&half_quantum);
else
- ImfFloatToHalf(1.0-QuantumScale*GetOpacityPixelComponent(p),&half_quantum);
+ ImfFloatToHalf(1.0-QuantumScale*GetOpacityPixelComponent(p),
+ &half_quantum);
scanline[x].a=half_quantum;
p++;
}
diff --git a/coders/fits.c b/coders/fits.c
index 8434e0a..1f4dd9e 100644
--- a/coders/fits.c
+++ b/coders/fits.c
@@ -259,10 +259,6 @@
int
c;
- ssize_t
- scene,
- y;
-
MagickBooleanType
status;
@@ -277,7 +273,9 @@
*q;
ssize_t
- count;
+ count,
+ scene,
+ y;
/*
Open image file.
@@ -445,8 +443,8 @@
for (x=0; x < (ssize_t) image->columns; x++)
{
pixel=GetFITSPixel(image,fits_info.bits_per_pixel);
- q->red=(Quantum) ClampToQuantum(scale*(fits_info.scale*(pixel-
- fits_info.min_data)+fits_info.zero));
+ SetRedPixelComponent(q,ClampToQuantum(scale*(fits_info.scale*(pixel-
+ fits_info.min_data)+fits_info.zero)));
SetGreenPixelComponent(q,GetRedPixelComponent(q));
SetBluePixelComponent(q,GetRedPixelComponent(q));
q++;
diff --git a/coders/fpx.c b/coders/fpx.c
index 3f899e0..6d92199 100644
--- a/coders/fpx.c
+++ b/coders/fpx.c
@@ -169,9 +169,6 @@
IndexPacket
index;
- ssize_t
- y;
-
MagickBooleanType
status;
@@ -194,6 +191,9 @@
size_t
memory_limit;
+ ssize_t
+ y;
+
unsigned char
*pixels;
@@ -459,21 +459,21 @@
{
if (fpx_info.numberOfComponents > 2)
{
- q->red=ScaleCharToQuantum(*r);
- q->green=ScaleCharToQuantum(*g);
- q->blue=ScaleCharToQuantum(*b);
+ SetRedPixelComponent(q,ScaleCharToQuantum(*r));
+ SetGreenPixelComponent(q,ScaleCharToQuantum(*g));
+ SetBluePixelComponent(q,ScaleCharToQuantum(*b));
}
else
{
index=ScaleCharToQuantum(*r);
- indexes[x]=index;
- q->red=index;
- q->green=index;
- q->blue=index;
+ SetIndexPixelComponent(indexes+x,index);
+ SetRedPixelComponent(q,index);
+ SetGreenPixelComponent(q,index);
+ SetBluePixelComponent(q,index);
}
SetOpacityPixelComponent(q,OpaqueOpacity);
if (image->matte != MagickFalse)
- q->opacity=ScaleCharToQuantum(255-*a);
+ SetOpacityPixelComponent(q,ScaleCharToQuantum(255-*a));
q++;
r+=red_component->columnStride;
g+=green_component->columnStride;
@@ -483,7 +483,7 @@
if (SyncAuthenticPixels(image,exception) == MagickFalse)
break;
status=SetImageProgress(image,LoadImageTag,(MagickOffsetType) y,
- image->rows);
+ image->rows);
if (status == MagickFalse)
break;
}
@@ -805,9 +805,6 @@
FPXSummaryInformation
summary_info;
- ssize_t
- y;
-
MagickBooleanType
status;
@@ -827,6 +824,9 @@
length,
memory_limit;
+ ssize_t
+ y;
+
unsigned char
*pixels;
@@ -998,7 +998,7 @@
if (fpx_status != FPX_OK)
break;
status=SetImageProgress(image,SaveImageTag,(MagickOffsetType) y,
- image->rows);
+ image->rows);
if (status == MagickFalse)
break;
}