diff options
Diffstat (limited to 'plugins/FreeImage/Source/FreeImageToolkit')
10 files changed, 119 insertions, 119 deletions
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++) { diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Channels.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Channels.cpp index 5f01ad815f..f6e6c5509c 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/Channels.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/Channels.cpp @@ -31,7 +31,7 @@ FIBITMAP * DLL_CALLCONV FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) { - if(!FreeImage_HasPixels(src)) return NULL; + if (!FreeImage_HasPixels(src)) return NULL; FREE_IMAGE_TYPE image_type = FreeImage_GetImageType(src); unsigned bpp = FreeImage_GetBPP(src); @@ -63,7 +63,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) { unsigned width = FreeImage_GetWidth(src); unsigned height = FreeImage_GetHeight(src); FIBITMAP *dst = FreeImage_Allocate(width, height, 8) ; - if(!dst) return NULL; + if (!dst) return NULL; // build a greyscale palette RGBQUAD *pal = FreeImage_GetPalette(dst); for(int i = 0; i < 256; i++) { @@ -90,7 +90,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) { } // 48-bit RGB or 64-bit RGBA images - if((image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) { + if ((image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) { int c; // select the channel to extract (always RGB[A]) @@ -116,7 +116,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) { unsigned width = FreeImage_GetWidth(src); unsigned height = FreeImage_GetHeight(src); FIBITMAP *dst = FreeImage_AllocateT(FIT_UINT16, width, height) ; - if(!dst) return NULL; + if (!dst) return NULL; // perform extraction @@ -138,7 +138,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) { } // 96-bit RGBF or 128-bit RGBAF images - if((image_type == FIT_RGBF) || (image_type == FIT_RGBAF)) { + if ((image_type == FIT_RGBF) || (image_type == FIT_RGBAF)) { int c; // select the channel to extract (always RGB[A]) @@ -164,7 +164,7 @@ FreeImage_GetChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) { unsigned width = FreeImage_GetWidth(src); unsigned height = FreeImage_GetHeight(src); FIBITMAP *dst = FreeImage_AllocateT(FIT_FLOAT, width, height) ; - if(!dst) return NULL; + if (!dst) return NULL; // perform extraction @@ -199,32 +199,32 @@ BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) { int c; - if(!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE; + if (!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE; // src and dst images should have the same width and height unsigned src_width = FreeImage_GetWidth(src); unsigned src_height = FreeImage_GetHeight(src); unsigned dst_width = FreeImage_GetWidth(dst); unsigned dst_height = FreeImage_GetHeight(dst); - if((src_width != dst_width) || (src_height != dst_height)) + if ((src_width != dst_width) || (src_height != dst_height)) return FALSE; // src image should be grayscale, dst image should be RGB or RGBA FREE_IMAGE_COLOR_TYPE src_type = FreeImage_GetColorType(src); FREE_IMAGE_COLOR_TYPE dst_type = FreeImage_GetColorType(dst); - if((dst_type != FIC_RGB) && (dst_type != FIC_RGBALPHA) || (src_type != FIC_MINISBLACK)) { + if ((dst_type != FIC_RGB) && (dst_type != FIC_RGBALPHA) || (src_type != FIC_MINISBLACK)) { return FALSE; } FREE_IMAGE_TYPE src_image_type = FreeImage_GetImageType(src); FREE_IMAGE_TYPE dst_image_type = FreeImage_GetImageType(dst); - if((dst_image_type == FIT_BITMAP) && (src_image_type == FIT_BITMAP)) { + if ((dst_image_type == FIT_BITMAP) && (src_image_type == FIT_BITMAP)) { // src image should be grayscale, dst image should be 24- or 32-bit unsigned src_bpp = FreeImage_GetBPP(src); unsigned dst_bpp = FreeImage_GetBPP(dst); - if((src_bpp != 8) || (dst_bpp != 24) && (dst_bpp != 32)) + if ((src_bpp != 8) || (dst_bpp != 24) && (dst_bpp != 32)) return FALSE; @@ -263,12 +263,12 @@ FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL chan return TRUE; } - if(((dst_image_type == FIT_RGB16) || (dst_image_type == FIT_RGBA16)) && (src_image_type == FIT_UINT16)) { + if (((dst_image_type == FIT_RGB16) || (dst_image_type == FIT_RGBA16)) && (src_image_type == FIT_UINT16)) { // src image should be grayscale, dst image should be 48- or 64-bit unsigned src_bpp = FreeImage_GetBPP(src); unsigned dst_bpp = FreeImage_GetBPP(dst); - if((src_bpp != 16) || (dst_bpp != 48) && (dst_bpp != 64)) + if ((src_bpp != 16) || (dst_bpp != 48) && (dst_bpp != 64)) return FALSE; @@ -307,12 +307,12 @@ FreeImage_SetChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL chan return TRUE; } - if(((dst_image_type == FIT_RGBF) || (dst_image_type == FIT_RGBAF)) && (src_image_type == FIT_FLOAT)) { + if (((dst_image_type == FIT_RGBF) || (dst_image_type == FIT_RGBAF)) && (src_image_type == FIT_FLOAT)) { // src image should be grayscale, dst image should be 96- or 128-bit unsigned src_bpp = FreeImage_GetBPP(src); unsigned dst_bpp = FreeImage_GetBPP(dst); - if((src_bpp != 32) || (dst_bpp != 96) && (dst_bpp != 128)) + if ((src_bpp != 32) || (dst_bpp != 96) && (dst_bpp != 128)) return FALSE; @@ -367,14 +367,14 @@ FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) { double *dst_bits = NULL; FIBITMAP *dst = NULL; - if(!FreeImage_HasPixels(src)) return NULL; + if (!FreeImage_HasPixels(src)) return NULL; if(FreeImage_GetImageType(src) == FIT_COMPLEX) { // allocate a dib of type FIT_DOUBLE unsigned width = FreeImage_GetWidth(src); unsigned height = FreeImage_GetHeight(src); dst = FreeImage_AllocateT(FIT_DOUBLE, width, height) ; - if(!dst) return NULL; + if (!dst) return NULL; // perform extraction @@ -415,7 +415,7 @@ FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel) { src_bits = (FICOMPLEX *)FreeImage_GetScanLine(src, y); dst_bits = (double *)FreeImage_GetScanLine(dst, y); for(x = 0; x < width; x++) { - if((src_bits[x].r == 0) && (src_bits[x].i == 0)) { + if ((src_bits[x].r == 0) && (src_bits[x].i == 0)) { phase = 0; } else { phase = atan2(src_bits[x].i, src_bits[x].r); @@ -446,12 +446,12 @@ FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANN double *src_bits = NULL; FICOMPLEX *dst_bits = NULL; - if(!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE; + if (!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE; // src image should be of type FIT_DOUBLE, dst image should be of type FIT_COMPLEX const FREE_IMAGE_TYPE src_type = FreeImage_GetImageType(src); const FREE_IMAGE_TYPE dst_type = FreeImage_GetImageType(dst); - if((src_type != FIT_DOUBLE) || (dst_type != FIT_COMPLEX)) + if ((src_type != FIT_DOUBLE) || (dst_type != FIT_COMPLEX)) return FALSE; // src and dst images should have the same width and height @@ -459,7 +459,7 @@ FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANN unsigned src_height = FreeImage_GetHeight(src); unsigned dst_width = FreeImage_GetWidth(dst); unsigned dst_height = FreeImage_GetHeight(dst); - if((src_width != dst_width) || (src_height != dst_height)) + if ((src_width != dst_width) || (src_height != dst_height)) return FALSE; // select the channel to modify diff --git a/plugins/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp b/plugins/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp index 83c2f92123..7046a4acc9 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/ClassicRotate.cpp @@ -63,7 +63,7 @@ HorizontalSkewT(FIBITMAP *src, FIBITMAP *dst, int row, int iOffset, double weigh // background const T pxlBlack[4] = {0, 0, 0, 0 }; const T *pxlBkg = static_cast<const T*>(bkcolor); // assume at least bytespp and 4*sizeof(T) max - if(!pxlBkg) { + if (!pxlBkg) { // default background color is black pxlBkg = pxlBlack; } @@ -98,7 +98,7 @@ HorizontalSkewT(FIBITMAP *src, FIBITMAP *dst, int row, int iOffset, double weigh } // check boundaries iXPos = i + iOffset; - if((iXPos >= 0) && (iXPos < (int)dst_width)) { + if ((iXPos >= 0) && (iXPos < (int)dst_width)) { // update left over on source for(unsigned j = 0; j < samples; j++) { pxlSrc[j] = pxlSrc[j] - (pxlLeft[j] - pxlOldLeft[j]); @@ -115,7 +115,7 @@ HorizontalSkewT(FIBITMAP *src, FIBITMAP *dst, int row, int iOffset, double weigh // go to rightmost point of skew iXPos = src_width + iOffset; - if((iXPos >= 0) && (iXPos < (int)dst_width)) { + if ((iXPos >= 0) && (iXPos < (int)dst_width)) { dst_bits = FreeImage_GetScanLine(dst, row) + iXPos * bytespp; // If still in image bounds, put leftovers there @@ -194,7 +194,7 @@ VerticalSkewT(FIBITMAP *src, FIBITMAP *dst, int col, int iOffset, double weight, // background const T pxlBlack[4] = {0, 0, 0, 0 }; const T *pxlBkg = static_cast<const T*>(bkcolor); // assume at least bytespp and 4*sizeof(T) max - if(!pxlBkg) { + if (!pxlBkg) { // default background color is black pxlBkg = pxlBlack; } @@ -235,7 +235,7 @@ VerticalSkewT(FIBITMAP *src, FIBITMAP *dst, int col, int iOffset, double weight, } // check boundaries iYPos = i + iOffset; - if((iYPos >= 0) && (iYPos < (int)dst_height)) { + if ((iYPos >= 0) && (iYPos < (int)dst_height)) { // update left over on source for(unsigned j = 0; j < samples; j++) { pxlSrc[j] = pxlSrc[j] - (pxlLeft[j] - pxlOldLeft[j]); @@ -252,7 +252,7 @@ VerticalSkewT(FIBITMAP *src, FIBITMAP *dst, int col, int iOffset, double weight, // go to bottom point of skew iYPos = src_height + iOffset; - if((iYPos >= 0) && (iYPos < (int)dst_height)) { + if ((iYPos >= 0) && (iYPos < (int)dst_height)) { dst_bits = FreeImage_GetScanLine(dst, iYPos) + index; // if still in image bounds, put leftovers there @@ -367,7 +367,7 @@ Rotate90(FIBITMAP *src) { } } } - else if((bpp == 8) || (bpp == 24) || (bpp == 32)) { + else if ((bpp == 8) || (bpp == 24) || (bpp == 32)) { // anything other than BW : // This optimized version of rotation rotates image by smaller blocks. It is quite // a bit faster than obvious algorithm, because it produces much less CPU cache misses. @@ -472,7 +472,7 @@ Rotate180(FIBITMAP *src) { } break; } - // else if((bpp == 8) || (bpp == 24) || (bpp == 32)) FALL TROUGH + // else if ((bpp == 8) || (bpp == 24) || (bpp == 32)) FALL TROUGH case FIT_UINT16: case FIT_RGB16: case FIT_RGBA16: @@ -559,7 +559,7 @@ Rotate270(FIBITMAP *src) { } } } - else if((bpp == 8) || (bpp == 24) || (bpp == 32)) { + else if ((bpp == 8) || (bpp == 24) || (bpp == 32)) { // anything other than BW : // This optimized version of rotation rotates image by smaller blocks. It is quite // a bit faster than obvious algorithm, because it produces much less CPU cache misses. @@ -767,7 +767,7 @@ RotateAny(FIBITMAP *src, double dAngle, const void *bkcolor) { // Bring angle to range of [0 .. 360) dAngle += 360; } - if((dAngle > 45) && (dAngle <= 135)) { + if ((dAngle > 45) && (dAngle <= 135)) { // Angle in (45 .. 135] // Rotate image by 90 degrees into temporary image, // so it requires only an extra rotation angle @@ -775,7 +775,7 @@ RotateAny(FIBITMAP *src, double dAngle, const void *bkcolor) { image = Rotate90(src); dAngle -= 90; } - else if((dAngle > 135) && (dAngle <= 225)) { + else if ((dAngle > 135) && (dAngle <= 225)) { // Angle in (135 .. 225] // Rotate image by 180 degrees into temporary image, // so it requires only an extra rotation angle @@ -783,7 +783,7 @@ RotateAny(FIBITMAP *src, double dAngle, const void *bkcolor) { image = Rotate180(src); dAngle -= 180; } - else if((dAngle > 225) && (dAngle <= 315)) { + else if ((dAngle > 225) && (dAngle <= 315)) { // Angle in (225 .. 315] // Rotate image by 270 degrees into temporary image, // so it requires only an extra rotation angle @@ -825,7 +825,7 @@ RotateAny(FIBITMAP *src, double dAngle, const void *bkcolor) { FIBITMAP *DLL_CALLCONV FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) { - if(!FreeImage_HasPixels(dib)) return NULL; + if (!FreeImage_HasPixels(dib)) return NULL; if(0 == angle) { return FreeImage_Clone(dib); @@ -846,7 +846,7 @@ FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) { // perform the rotation FIBITMAP *dst = RotateAny(dib, angle, bkcolor); - if(!dst) throw(1); + if (!dst) throw(1); // build a greyscale palette RGBQUAD *dst_pal = FreeImage_GetPalette(dst); @@ -863,9 +863,9 @@ FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) { return dst; } - else if((bpp == 8) || (bpp == 24) || (bpp == 32)) { + else if ((bpp == 8) || (bpp == 24) || (bpp == 32)) { FIBITMAP *dst = RotateAny(dib, angle, bkcolor); - if(!dst) throw(1); + if (!dst) throw(1); if(bpp == 8) { // copy original palette to rotated bitmap @@ -878,7 +878,7 @@ FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) { // copy background color RGBQUAD bkcolor; - if( FreeImage_GetBackgroundColor(dib, &bkcolor) ) { + if ( FreeImage_GetBackgroundColor(dib, &bkcolor) ) { FreeImage_SetBackgroundColor(dst, &bkcolor); } @@ -898,7 +898,7 @@ FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor) { case FIT_RGBAF: { FIBITMAP *dst = RotateAny(dib, angle, bkcolor); - if(!dst) throw(1); + if (!dst) throw(1); // copy metadata from src to dst FreeImage_CloneMetadata(dst, dib); diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Colors.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Colors.cpp index 67191768bb..8b9bbd6482 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/Colors.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/Colors.cpp @@ -108,7 +108,7 @@ FreeImage_Invert(FIBITMAP *src) { return FALSE; } } - else if((image_type == FIT_UINT16) || (image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) { + else if ((image_type == FIT_UINT16) || (image_type == FIT_RGB16) || (image_type == FIT_RGBA16)) { // Calculate the number of words per pixel (1 for 16-bit, 3 for 48-bit or 4 for 64-bit) const unsigned wordspp = (FreeImage_GetLine(src) / width) / sizeof(WORD); @@ -149,11 +149,11 @@ FreeImage_AdjustCurve(FIBITMAP *src, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel unsigned x, y; BYTE *bits = NULL; - if(!FreeImage_HasPixels(src) || !LUT || (FreeImage_GetImageType(src) != FIT_BITMAP)) + if (!FreeImage_HasPixels(src) || !LUT || (FreeImage_GetImageType(src) != FIT_BITMAP)) return FALSE; int bpp = FreeImage_GetBPP(src); - if((bpp != 8) && (bpp != 24) && (bpp != 32)) + if ((bpp != 8) && (bpp != 24) && (bpp != 32)) return FALSE; // apply the LUT @@ -271,7 +271,7 @@ BOOL DLL_CALLCONV FreeImage_AdjustGamma(FIBITMAP *src, double gamma) { BYTE LUT[256]; // Lookup table - if(!FreeImage_HasPixels(src) || (gamma <= 0)) + if (!FreeImage_HasPixels(src) || (gamma <= 0)) return FALSE; // Build the lookup table @@ -302,7 +302,7 @@ FreeImage_AdjustBrightness(FIBITMAP *src, double percentage) { BYTE LUT[256]; // Lookup table double value; - if(!FreeImage_HasPixels(src)) + if (!FreeImage_HasPixels(src)) return FALSE; // Build the lookup table @@ -328,7 +328,7 @@ FreeImage_AdjustContrast(FIBITMAP *src, double percentage) { BYTE LUT[256]; // Lookup table double value; - if(!FreeImage_HasPixels(src)) + if (!FreeImage_HasPixels(src)) return FALSE; // Build the lookup table @@ -357,7 +357,7 @@ FreeImage_GetHistogram(FIBITMAP *src, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL cha BYTE *bits = NULL; unsigned x, y; - if(!FreeImage_HasPixels(src) || !histo) return FALSE; + if (!FreeImage_HasPixels(src) || !histo) return FALSE; unsigned width = FreeImage_GetWidth(src); unsigned height = FreeImage_GetHeight(src); @@ -377,7 +377,7 @@ FreeImage_GetHistogram(FIBITMAP *src, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL cha } return TRUE; } - else if((bpp == 24) || (bpp == 32)) { + else if ((bpp == 24) || (bpp == 32)) { int bytespp = bpp / 8; // bytes / pixel // clear histogram array diff --git a/plugins/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp b/plugins/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp index e4b8155739..59757287ed 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/CopyPaste.cpp @@ -58,12 +58,12 @@ Combine1(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned BOOL value; // check the bit depth of src and dst images - if((FreeImage_GetBPP(dst_dib) != 1) || (FreeImage_GetBPP(src_dib) != 1)) { + if ((FreeImage_GetBPP(dst_dib) != 1) || (FreeImage_GetBPP(src_dib) != 1)) { return FALSE; } // check the size of src image - if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { + if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { return FALSE; } @@ -97,12 +97,12 @@ Combine4(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned BOOL bOddStart, bOddEnd; // check the bit depth of src and dst images - if((FreeImage_GetBPP(dst_dib) != 4) || (FreeImage_GetBPP(src_dib) != 4)) { + if ((FreeImage_GetBPP(dst_dib) != 4) || (FreeImage_GetBPP(src_dib) != 4)) { return FALSE; } // check the size of src image - if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { + if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { return FALSE; } @@ -196,12 +196,12 @@ Combine4(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned static BOOL Combine8(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) { // check the bit depth of src and dst images - if((FreeImage_GetBPP(dst_dib) != 8) || (FreeImage_GetBPP(src_dib) != 8)) { + if ((FreeImage_GetBPP(dst_dib) != 8) || (FreeImage_GetBPP(src_dib) != 8)) { return FALSE; } // check the size of src image - if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { + if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { return FALSE; } @@ -238,12 +238,12 @@ Combine8(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned static BOOL Combine16_555(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) { // check the bit depth of src and dst images - if((FreeImage_GetBPP(dst_dib) != 16) || (FreeImage_GetBPP(src_dib) != 16)) { + if ((FreeImage_GetBPP(dst_dib) != 16) || (FreeImage_GetBPP(src_dib) != 16)) { return FALSE; } // check the size of src image - if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { + if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { return FALSE; } @@ -298,12 +298,12 @@ Combine16_555(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsi static BOOL Combine16_565(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) { // check the bit depth of src and dst images - if((FreeImage_GetBPP(dst_dib) != 16) || (FreeImage_GetBPP(src_dib) != 16)) { + if ((FreeImage_GetBPP(dst_dib) != 16) || (FreeImage_GetBPP(src_dib) != 16)) { return FALSE; } // check the size of src image - if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { + if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { return FALSE; } @@ -362,12 +362,12 @@ Combine16_565(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsi static BOOL Combine24(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) { // check the bit depth of src and dst images - if((FreeImage_GetBPP(dst_dib) != 24) || (FreeImage_GetBPP(src_dib) != 24)) { + if ((FreeImage_GetBPP(dst_dib) != 24) || (FreeImage_GetBPP(src_dib) != 24)) { return FALSE; } // check the size of src image - if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { + if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { return FALSE; } @@ -404,12 +404,12 @@ Combine24(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned static BOOL Combine32(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y, unsigned alpha) { // check the bit depth of src and dst images - if((FreeImage_GetBPP(dst_dib) != 32) || (FreeImage_GetBPP(src_dib) != 32)) { + if ((FreeImage_GetBPP(dst_dib) != 32) || (FreeImage_GetBPP(src_dib) != 32)) { return FALSE; } // check the size of src image - if((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { + if ((x + FreeImage_GetWidth(src_dib) > FreeImage_GetWidth(dst_dib)) || (y + FreeImage_GetHeight(src_dib) > FreeImage_GetHeight(dst_dib))) { return FALSE; } @@ -459,7 +459,7 @@ CombineSameType(FIBITMAP *dst_dib, FIBITMAP *src_dib, unsigned x, unsigned y) { unsigned dst_pitch = FreeImage_GetPitch(dst_dib); // check the size of src image - if((x + src_width > dst_width) || (y + src_height > dst_height)) { + if ((x + src_width > dst_width) || (y + src_height > dst_height)) { return FALSE; } @@ -493,7 +493,7 @@ Works with any bitmap type. FIBITMAP * DLL_CALLCONV FreeImage_Copy(FIBITMAP *src, int left, int top, int right, int bottom) { - if(!FreeImage_HasPixels(src)) + if (!FreeImage_HasPixels(src)) return NULL; // normalize the rectangle @@ -506,7 +506,7 @@ FreeImage_Copy(FIBITMAP *src, int left, int top, int right, int bottom) { // check the size of the sub image int src_width = FreeImage_GetWidth(src); int src_height = FreeImage_GetHeight(src); - if((left < 0) || (right > src_width) || (top < 0) || (bottom > src_height)) { + if ((left < 0) || (right > src_width) || (top < 0) || (bottom > src_height)) { return NULL; } @@ -608,7 +608,7 @@ FreeImage_Copy(FIBITMAP *src, int left, int top, int right, int bottom) { // copy background color RGBQUAD bkcolor; - if( FreeImage_GetBackgroundColor(src, &bkcolor) ) { + if ( FreeImage_GetBackgroundColor(src, &bkcolor) ) { FreeImage_SetBackgroundColor(dst, &bkcolor); } @@ -639,13 +639,13 @@ BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha) { BOOL bResult = FALSE; - if(!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE; + if (!FreeImage_HasPixels(src) || !FreeImage_HasPixels(dst)) return FALSE; // check the size of src image - if((left < 0) || (top < 0)) { + if ((left < 0) || (top < 0)) { return FALSE; } - if((left + FreeImage_GetWidth(src) > FreeImage_GetWidth(dst)) || (top + FreeImage_GetHeight(src) > FreeImage_GetHeight(dst))) { + if ((left + FreeImage_GetWidth(src) > FreeImage_GetWidth(dst)) || (top + FreeImage_GetHeight(src) > FreeImage_GetHeight(dst))) { return FALSE; } @@ -704,7 +704,7 @@ FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha) { return FALSE; } - if(!clone) return FALSE; + if (!clone) return FALSE; // paste src to dst switch(FreeImage_GetBPP(dst)) { diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Display.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Display.cpp index 245c5c3a18..3e4807042d 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/Display.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/Display.cpp @@ -40,20 +40,20 @@ For colour images, the computation is done separately for R, G, and B samples. */ FIBITMAP * DLL_CALLCONV FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg, RGBQUAD *appBkColor, FIBITMAP *bg) { - if(!FreeImage_HasPixels(fg)) return NULL; + if (!FreeImage_HasPixels(fg)) return NULL; int width = FreeImage_GetWidth(fg); int height = FreeImage_GetHeight(fg); int bpp = FreeImage_GetBPP(fg); - if((bpp != 8) && (bpp != 32)) + if ((bpp != 8) && (bpp != 32)) return NULL; if(bg) { int bg_width = FreeImage_GetWidth(bg); int bg_height = FreeImage_GetHeight(bg); int bg_bpp = FreeImage_GetBPP(bg); - if((bg_width != width) || (bg_height != height) || (bg_bpp != 24)) + if ((bg_width != width) || (bg_height != height) || (bg_bpp != 24)) return NULL; } @@ -71,7 +71,7 @@ FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg, RGBQUAD *appBkColor, FIBITMAP // allocate the composite image FIBITMAP *composite = FreeImage_Allocate(width, height, 24, FI_RGBA_RED_MASK, FI_RGBA_GREEN_MASK, FI_RGBA_BLUE_MASK); - if(!composite) return NULL; + if (!composite) return NULL; // get the palette RGBQUAD *pal = FreeImage_GetPalette(fg); @@ -133,7 +133,7 @@ FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg, RGBQUAD *appBkColor, FIBITMAP // background color - if(!bHasBkColor) { + if (!bHasBkColor) { if(bg) { // get the background color from the background image bkc.rgbBlue = bg_bits[FI_RGBA_BLUE]; diff --git a/plugins/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp b/plugins/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp index 5822f748a6..c5345497f5 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/JPEGTransform.cpp @@ -61,7 +61,7 @@ ls_jpeg_error_exit (j_common_ptr cinfo) { (*cinfo->err->output_message)(cinfo); // allow JPEG with a premature end of file - if((cinfo)->err->msg_parm.i[0] != 13) { + if ((cinfo)->err->msg_parm.i[0] != 13) { // let the memory manager delete any temp files before we die jpeg_destroy(cinfo); @@ -171,7 +171,7 @@ LosslessTransform(const FilenameIO *filenameIO, FREE_IMAGE_JPEG_OPERATION operat // crop option if(crop != NULL) { - if(!jtransform_parse_crop_spec(&transfoptions, crop)) { + if (!jtransform_parse_crop_spec(&transfoptions, crop)) { FreeImage_OutputMessageProc(FIF_JPEG, "Bogus crop argument %s", crop); throw(1); } @@ -180,14 +180,14 @@ LosslessTransform(const FilenameIO *filenameIO, FREE_IMAGE_JPEG_OPERATION operat // Open the input file if(bUseUnicode) { #ifdef _WIN32 - if((fp = _wfopen(filenameIO->wsrc_file, L"rb")) == NULL) { + if ((fp = _wfopen(filenameIO->wsrc_file, L"rb")) == NULL) { FreeImage_OutputMessageProc(FIF_JPEG, "Cannot open input file for reading"); } #else fp = NULL; #endif // _WIN32 } else { - if((fp = fopen(filenameIO->src_file, "rb")) == NULL) { + if ((fp = fopen(filenameIO->src_file, "rb")) == NULL) { FreeImage_OutputMessageProc(FIF_JPEG, "Cannot open %s for reading", filenameIO->src_file); } } @@ -211,7 +211,7 @@ LosslessTransform(const FilenameIO *filenameIO, FREE_IMAGE_JPEG_OPERATION operat // Prepare transformation workspace // Fails right away if perfect flag is TRUE and transformation is not perfect - if( !jtransform_request_workspace(&srcinfo, &transfoptions) ) { + if ( !jtransform_request_workspace(&srcinfo, &transfoptions) ) { FreeImage_OutputMessageProc(FIF_JPEG, "Transformation is not perfect"); throw(1); } @@ -237,14 +237,14 @@ LosslessTransform(const FilenameIO *filenameIO, FREE_IMAGE_JPEG_OPERATION operat // Open the output file if(bUseUnicode) { #ifdef _WIN32 - if((fp = _wfopen(filenameIO->wdst_file, L"wb")) == NULL) { + if ((fp = _wfopen(filenameIO->wdst_file, L"wb")) == NULL) { FreeImage_OutputMessageProc(FIF_JPEG, "Cannot open output file for writing"); } #else fp = NULL; #endif // _WIN32 } else { - if((fp = fopen(filenameIO->dst_file, "wb")) == NULL) { + if ((fp = fopen(filenameIO->dst_file, "wb")) == NULL) { FreeImage_OutputMessageProc(FIF_JPEG, "Cannot open %s for writing", filenameIO->dst_file); } } diff --git a/plugins/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp b/plugins/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp index 3b577cbd0a..6d17d45319 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/MultigridPoissonSolver.cpp @@ -311,7 +311,7 @@ static BOOL fmg_mglin(FIBITMAP *U, int n, int ncycle) { #define _CREATE_ARRAY_GRID_(array, array_size) \ array = (FIBITMAP**)malloc(array_size * sizeof(FIBITMAP*));\ - if(!array) throw(1);\ + if (!array) throw(1);\ memset(array, 0, array_size * sizeof(FIBITMAP*)) #define _FREE_ARRAY_GRID_(array, array_size) \ @@ -351,7 +351,7 @@ static BOOL fmg_mglin(FIBITMAP *U, int n, int ncycle) { // allocate storage for r.h.s. on grid (ng - 2) ... IRHO[ngrid] = FreeImage_AllocateT(FIT_FLOAT, nn, nn); - if(!IRHO[ngrid]) throw(1); + if (!IRHO[ngrid]) throw(1); // ... and fill it by restricting from the fine grid fmg_restrict(IRHO[ngrid], U, nn); @@ -361,16 +361,16 @@ static BOOL fmg_mglin(FIBITMAP *U, int n, int ncycle) { nn = nn/2 + 1; ngrid--; IRHO[ngrid] = FreeImage_AllocateT(FIT_FLOAT, nn, nn); - if(!IRHO[ngrid]) throw(1); + if (!IRHO[ngrid]) throw(1); fmg_restrict(IRHO[ngrid], IRHO[ngrid+1], nn); } nn = 3; IU[0] = FreeImage_AllocateT(FIT_FLOAT, nn, nn); - if(!IU[0]) throw(1); + if (!IU[0]) throw(1); IRHS[0] = FreeImage_AllocateT(FIT_FLOAT, nn, nn); - if(!IRHS[0]) throw(1); + if (!IRHS[0]) throw(1); // initial solution on coarsest grid fmg_solve(IU[0], IRHO[0]); @@ -384,11 +384,11 @@ static BOOL fmg_mglin(FIBITMAP *U, int n, int ncycle) { nn = 2*nn - 1; IU[j] = FreeImage_AllocateT(FIT_FLOAT, nn, nn); - if(!IU[j]) throw(1); + if (!IU[j]) throw(1); IRHS[j] = FreeImage_AllocateT(FIT_FLOAT, nn, nn); - if(!IRHS[j]) throw(1); + if (!IRHS[j]) throw(1); IRES[j] = FreeImage_AllocateT(FIT_FLOAT, nn, nn); - if(!IRES[j]) throw(1); + if (!IRES[j]) throw(1); fmg_prolongate(IU[j], IU[j-1], nn); @@ -464,7 +464,7 @@ where j is such that 2^j is the nearest larger dimension corresponding to MAX(im */ FIBITMAP* DLL_CALLCONV FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle) { - if(!FreeImage_HasPixels(Laplacian)) return NULL; + if (!FreeImage_HasPixels(Laplacian)) return NULL; int width = FreeImage_GetWidth(Laplacian); int height = FreeImage_GetHeight(Laplacian); @@ -473,7 +473,7 @@ FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle) { int n = MAX(width, height); int size = 0; while((n >>= 1) > 0) size++; - if((1 << size) < MAX(width, height)) { + if ((1 << size) < MAX(width, height)) { size++; } // size must be of the form 2^j + 1 for some integer j @@ -481,7 +481,7 @@ FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle) { // allocate a temporary square image I FIBITMAP *I = FreeImage_AllocateT(FIT_FLOAT, size, size); - if(!I) return NULL; + if (!I) return NULL; // copy Laplacian into I and shift pixels to create a boundary FreeImage_Paste(I, Laplacian, 1, 1, 255); diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp index d957d9cb5e..e79e5f456c 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp @@ -52,7 +52,7 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE break; } - if(!pFilter) { + if (!pFilter) { return NULL; } @@ -60,7 +60,7 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE // perform upsampling or downsampling - if((FreeImage_GetBPP(src) == 4) || (FreeImage_GetColorType(src) == FIC_PALETTE)) { + if ((FreeImage_GetBPP(src) == 4) || (FreeImage_GetColorType(src) == FIC_PALETTE)) { // special case for 4-bit images or color map indexed images ... if(FreeImage_IsTransparent(src) == FALSE) { FIBITMAP *src24 = NULL; @@ -68,10 +68,10 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE try { // transparent conversion to 24-bit (any transparency table will be destroyed) src24 = FreeImage_ConvertTo24Bits(src); - if(!src24) throw(1); + if (!src24) throw(1); // perform upsampling or downsampling dst24 = Engine.scale(src24, dst_width, dst_height); - if(!dst24) throw(1); + if (!dst24) throw(1); FreeImage_Unload(src24); src24 = NULL; // color quantize to 8-bit dst = FreeImage_ColorQuantize(dst24, FIQ_NNQUANT); @@ -86,10 +86,10 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE try { // transparent conversion to 32-bit (keep transparency) src32 = FreeImage_ConvertTo32Bits(src); - if(!src32) throw(1); + if (!src32) throw(1); // perform upsampling or downsampling dst = Engine.scale(src32, dst_width, dst_height); - if(!dst) throw(1); + if (!dst) throw(1); // free and return FreeImage_Unload(src32); } catch(int) { @@ -98,16 +98,16 @@ FreeImage_Rescale(FIBITMAP *src, int dst_width, int dst_height, FREE_IMAGE_FILTE } } } - else if((FreeImage_GetBPP(src) == 16) && (FreeImage_GetImageType(src) == FIT_BITMAP)) { + else if ((FreeImage_GetBPP(src) == 16) && (FreeImage_GetImageType(src) == FIT_BITMAP)) { // convert 16-bit RGB to 24-bit FIBITMAP *src24 = NULL; try { // transparent conversion to 24-bit (any transparency table will be destroyed) src24 = FreeImage_ConvertTo24Bits(src); - if(!src24) throw(1); + if (!src24) throw(1); // perform upsampling or downsampling dst = Engine.scale(src24, dst_width, dst_height); - if(!dst) throw(1); + if (!dst) throw(1); // free and return FreeImage_Unload(src24); } catch(int) { @@ -137,14 +137,14 @@ FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert) { FIBITMAP *thumbnail = NULL; int new_width, new_height; - if(!FreeImage_HasPixels(dib) || (max_pixel_size <= 0)) return NULL; + if (!FreeImage_HasPixels(dib) || (max_pixel_size <= 0)) return NULL; int width = FreeImage_GetWidth(dib); int height = FreeImage_GetHeight(dib); if(max_pixel_size == 0) max_pixel_size = 1; - if((width < max_pixel_size) && (height < max_pixel_size)) { + if ((width < max_pixel_size) && (height < max_pixel_size)) { // image is smaller than the requested thumbnail return FreeImage_Clone(dib); } @@ -192,7 +192,7 @@ FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert) { break; } - if((thumbnail != NULL) && (image_type != FIT_BITMAP) && convert) { + if ((thumbnail != NULL) && (image_type != FIT_BITMAP) && convert) { // convert to a standard bitmap FIBITMAP *bitmap = NULL; switch(image_type) { diff --git a/plugins/FreeImage/Source/FreeImageToolkit/Resize.cpp b/plugins/FreeImage/Source/FreeImageToolkit/Resize.cpp index 5dcec62af0..5421bd47ab 100644 --- a/plugins/FreeImage/Source/FreeImageToolkit/Resize.cpp +++ b/plugins/FreeImage/Source/FreeImageToolkit/Resize.cpp @@ -68,7 +68,7 @@ CWeightsTable::CWeightsTable(CGenericFilter *pFilter, unsigned uDstSize, unsigne int iRight = MIN ((int)ceil (dCenter + dWidth), int(uSrcSize) - 1); // cut edge points to fit in filter window in case of spill-off - if((iRight - iLeft + 1) > int(m_WindowSize)) { + if ((iRight - iLeft + 1) > int(m_WindowSize)) { if(iLeft < (int(uSrcSize) - 1 / 2)) { iLeft++; } else { @@ -87,7 +87,7 @@ CWeightsTable::CWeightsTable(CGenericFilter *pFilter, unsigned uDstSize, unsigne m_WeightTable[u].Weights[iSrc-iLeft] = weight; dTotalWeight += weight; } - if((dTotalWeight > 0) && (dTotalWeight != 1)) { + if ((dTotalWeight > 0) && (dTotalWeight != 1)) { // normalize weight of neighbouring points for(iSrc = iLeft; iSrc <= iRight; iSrc++) { // normalize point @@ -149,7 +149,7 @@ FIBITMAP* CResizeEngine::scale(FIBITMAP *src, unsigned dst_width, unsigned dst_h // allocate the dst image FIBITMAP *dst = FreeImage_AllocateT(image_type, dst_width, dst_height, bpp, redMask, greenMask, blueMask); - if(!dst) return NULL; + if (!dst) return NULL; if(bpp == 8) { if(FreeImage_GetColorType(src) == FIC_MINISWHITE) { @@ -191,7 +191,7 @@ FIBITMAP* CResizeEngine::scale(FIBITMAP *src, unsigned dst_width, unsigned dst_h // allocate a temporary image FIBITMAP *tmp = FreeImage_AllocateT(image_type, dst_width, src_height, bpp, redMask, greenMask, blueMask); - if(!tmp) { + if (!tmp) { FreeImage_Unload(dst); return NULL; } @@ -211,7 +211,7 @@ FIBITMAP* CResizeEngine::scale(FIBITMAP *src, unsigned dst_width, unsigned dst_h // allocate a temporary image FIBITMAP *tmp = FreeImage_AllocateT(image_type, src_width, dst_height, bpp, redMask, greenMask, blueMask); - if(!tmp) { + if (!tmp) { FreeImage_Unload(dst); return NULL; } |