#endif // wxUSE_FILE/wxUSE_FFILE
#endif // HAS_FILE_STREAMS
+#if wxUSE_VARIANT
+IMPLEMENT_VARIANT_OBJECT_EXPORTED(wxImage,WXDLLEXPORT)
+#endif
+
//-----------------------------------------------------------------------------
// wxImage
//-----------------------------------------------------------------------------
unsigned char *source_alpha = 0 ;
unsigned char *target_alpha = 0 ;
- if (M_IMGDATA->m_hasMask)
- {
- image.SetMaskColour( M_IMGDATA->m_maskRed,
- M_IMGDATA->m_maskGreen,
- M_IMGDATA->m_maskBlue );
- }
- else
+ if ( !M_IMGDATA->m_hasMask )
{
source_alpha = M_IMGDATA->m_alpha ;
if ( source_alpha )
}
}
+ // If the original image has a mask, apply the mask to the new image
+ if (M_IMGDATA->m_hasMask)
+ {
+ image.SetMaskColour( M_IMGDATA->m_maskRed,
+ M_IMGDATA->m_maskGreen,
+ M_IMGDATA->m_maskBlue );
+ }
+
// In case this is a cursor, make sure the hotspot is scaled accordingly:
if ( HasOption(wxIMAGE_OPTION_CUR_HOTSPOT_X) )
image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X,
}
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
// 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);
}
}
}
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
// 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);
}
}