diff options
Diffstat (limited to 'plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp')
-rw-r--r-- | plugins/FreeImage/Source/FreeImageToolkit/Rescale.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
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) { |