From 888355224cee2209bf9fde2c10cc770a7d819ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?W=C5=82odzimierz=20Skiba?= Date: Mon, 25 Sep 2006 12:42:18 +0000 Subject: [PATCH] Warning fixes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/image.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/common/image.cpp b/src/common/image.cpp index 6f1a729952..2b43ad042c 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -809,11 +809,11 @@ wxImage wxImage::BlurHorizontal(int blurRadius) } dst = dst_data + y * M_IMGDATA->m_width*3; - dst[0] = sum_r / blurArea; - dst[1] = sum_g / blurArea; - dst[2] = sum_b / blurArea; + dst[0] = (unsigned char)(sum_r / blurArea); + dst[1] = (unsigned char)(sum_g / blurArea); + dst[2] = (unsigned char)(sum_b / blurArea); if ( src_alpha ) - dst_alpha[y * M_IMGDATA->m_width] = sum_a / blurArea; + dst_alpha[y * M_IMGDATA->m_width] = (unsigned char)(sum_a / blurArea); // Now average the values of the rest of the pixels by just moving the // blur radius box along the row @@ -851,11 +851,11 @@ wxImage wxImage::BlurHorizontal(int blurRadius) // Save off the averaged data dst = dst_data + x*3 + y*M_IMGDATA->m_width; - dst[0] = sum_r / blurArea; - dst[1] = sum_g / blurArea; - dst[2] = sum_b / blurArea; + dst[0] = (unsigned char)(sum_r / blurArea); + dst[1] = (unsigned char)(sum_g / blurArea); + dst[2] = (unsigned char)(sum_b / blurArea); if ( src_alpha ) - dst_alpha[x + y * M_IMGDATA->m_width] = sum_a / blurArea; + dst_alpha[x + y * M_IMGDATA->m_width] = (unsigned char)(sum_a / blurArea); } } @@ -927,11 +927,11 @@ wxImage wxImage::BlurVertical(int blurRadius) } dst = dst_data + x*3; - dst[0] = sum_r / blurArea; - dst[1] = sum_g / blurArea; - dst[2] = sum_b / blurArea; + dst[0] = (unsigned char)(sum_r / blurArea); + dst[1] = (unsigned char)(sum_g / blurArea); + dst[2] = (unsigned char)(sum_b / blurArea); if ( src_alpha ) - dst_alpha[x] = sum_a / blurArea; + dst_alpha[x] = (unsigned char)(sum_a / blurArea); // Now average the values of the rest of the pixels by just moving the // box along the column from top to bottom @@ -969,11 +969,11 @@ wxImage wxImage::BlurVertical(int blurRadius) // Save off the averaged data dst = dst_data + (x + y * M_IMGDATA->m_width) * 3; - dst[0] = sum_r / blurArea; - dst[1] = sum_g / blurArea; - dst[2] = sum_b / blurArea; + dst[0] = (unsigned char)(sum_r / blurArea); + dst[1] = (unsigned char)(sum_g / blurArea); + dst[2] = (unsigned char)(sum_b / blurArea); if ( src_alpha ) - dst_alpha[x + y * M_IMGDATA->m_width] = sum_a / blurArea; + dst_alpha[x + y * M_IMGDATA->m_width] = (unsigned char)(sum_a / blurArea); } }