From 78c0815c4118fe24ab78cce2dc48a6232dcd824a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 2 Jun 2012 20:55:18 +0000 Subject: - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../Source/FreeImageToolkit/BSplineRotate.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp') diff --git a/plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp b/plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp index 690db87d8c..e4be1d0bd2 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/BSplineRotate.cpp @@ -556,7 +556,7 @@ Rotate8Bit(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x // allocate output image FIBITMAP *dst = FreeImage_Allocate(width, height, bpp); - if(!dst) + if (!dst) return NULL; // buid a grey scale palette RGBQUAD *pal = FreeImage_GetPalette(dst); @@ -566,7 +566,7 @@ Rotate8Bit(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x // allocate a temporary array ImageRasterArray = (double*)malloc(width * height * sizeof(double)); - if(!ImageRasterArray) { + if (!ImageRasterArray) { FreeImage_Unload(dst); return NULL; } @@ -583,7 +583,7 @@ Rotate8Bit(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x // convert between a representation based on image samples // and a representation based on image B-spline coefficients bResult = SamplesToCoefficients(ImageRasterArray, width, height, spline); - if(!bResult) { + if (!bResult) { FreeImage_Unload(dst); free(ImageRasterArray); return NULL; @@ -611,7 +611,7 @@ Rotate8Bit(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x x1 = x0 + a11 * (double)x; y1 = y0 + a21 * (double)x; if(use_mask) { - if((x1 <= -0.5) || (((double)width - 0.5) <= x1) || (y1 <= -0.5) || (((double)height - 0.5) <= y1)) { + if ((x1 <= -0.5) || (((double)width - 0.5) <= x1) || (y1 <= -0.5) || (((double)height - 0.5) <= y1)) { p = 0; } else { @@ -652,7 +652,7 @@ FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift, BYTE *src_bits, *dst_bits; FIBITMAP *src8 = NULL, *dst8 = NULL, *dst = NULL; - if(!FreeImage_HasPixels(dib)) return NULL; + if (!FreeImage_HasPixels(dib)) return NULL; try { @@ -666,20 +666,20 @@ FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift, } return dst_8; } - if((bpp == 24) || (bpp == 32)) { + if ((bpp == 24) || (bpp == 32)) { // allocate dst image int width = FreeImage_GetWidth(dib); int height = FreeImage_GetHeight(dib); - if( bpp == 24 ) { + if ( bpp == 24 ) { dst = FreeImage_Allocate(width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); } else { dst = FreeImage_Allocate(width, height, bpp, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); } - if(!dst) throw(1); + if (!dst) throw(1); // allocate a temporary 8-bit dib (no need to build a palette) src8 = FreeImage_Allocate(width, height, 8); - if(!src8) throw(1); + if (!src8) throw(1); // process each channel separately // ------------------------------- @@ -698,7 +698,7 @@ FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift, // process channel dst8 = Rotate8Bit(src8, angle, x_shift, y_shift, x_origin, y_origin, ROTATE_CUBIC, use_mask); - if(!dst8) throw(1); + if (!dst8) throw(1); // insert channel to destination dib for(y = 0; y < height; y++) { -- cgit v1.2.3