X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8f2b21e474d7f7c07fd97306d2f6d5b1f05d2844..27db4210568ff8463f38e347614f40f238c9f660:/src/common/image.cpp diff --git a/src/common/image.cpp b/src/common/image.cpp index b55fd18070..d5ea5590e7 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -231,7 +231,7 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const { if( xFactor == 1 && yFactor == 1 ) return Copy() ; - + wxImage image; wxCHECK_MSG( Ok(), image, wxT("invalid image") ); @@ -242,7 +242,7 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const long old_height = M_IMGDATA->m_height, old_width = M_IMGDATA->m_width; - + wxCHECK_MSG( (old_height > 0) && (old_width > 0), image, wxT("invalid old image size") ); @@ -265,14 +265,14 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const maskRed = M_IMGDATA->m_maskRed; maskGreen = M_IMGDATA->m_maskGreen; maskBlue =M_IMGDATA->m_maskBlue ; - + image.SetMaskColour( M_IMGDATA->m_maskRed, M_IMGDATA->m_maskGreen, M_IMGDATA->m_maskBlue ); } char unsigned *source_data = M_IMGDATA->m_data; char unsigned *target_data = data; - + for (long y = 0; y < height; y++) { for (long x = 0; x < width; x++) @@ -935,7 +935,7 @@ bool wxImage::SetMaskFromImage(const wxImage& mask, return true; } - + bool wxImage::ConvertAlphaToMask(unsigned char threshold) { if (!HasAlpha()) @@ -961,7 +961,7 @@ bool wxImage::ConvertAlphaToMask(unsigned char threshold) { for (int x = 0; x < w; x++, imgdata += 3, alphadata++) { - if ((unsigned)(*alphadata) < threshold) + if (*alphadata < threshold) { imgdata[0] = mr; imgdata[1] = mg;