// the (most common) native bitmap format without alpha support
typedef wxPixelFormat<unsigned char, 24,
- #ifdef __WXMSW__
+ #if defined(__WXMSW__)
2, 1, 0
- #else // !__WXMSW__
+ #elif defined(__WXMAC__)
+ 1, 2, 3
+ #else // default for the others (not supported anyhow)
0, 1, 2
- #endif // __WXMSW__/!__WXMSW__
+ #endif // platform
> wxNativePixelFormat;
// the (most common) native format for bitmaps with alpha channel
wxNativePixelFormat::RED,
wxNativePixelFormat::GREEN,
wxNativePixelFormat::BLUE,
- 3> wxAlphaPixelFormat;
+ #if defined(__WXMSW__)
+ 3
+ #elif defined(__WXMAC__)
+ 0
+ #else // default for the others (not supported anyhow)
+ 3
+ #endif // platform
+ > wxAlphaPixelFormat;
// we also define the (default/best) pixel format for the given class: this is
// used as default value for the pixel format in wxPixelIterator template
{
m_pRGB += PixelFormat::SizePixel;
if ( m_pAlpha )
- m_pAlpha += PixelFormat::SizePixel;
+ ++m_pAlpha;
return *this;
}
};
};
+#ifdef __VISUALC__
+ // typedef-name 'foo' used as synonym for class-name 'bar'
+ // (VC++ gives this warning each time wxPixelData::Base is used but it
+ // doesn't make any sense here -- what's wrong with using typedef instead
+ // of class, this is what it is here for!)
+ #pragma warning(disable: 4097)
+#endif // __VISUALC__
template <class Image, class PixelFormat = wxPixelFormatFor<Image> >
class wxPixelData :
- public wxPixelDataOut<Image>::wxPixelDataIn<PixelFormat>
+ public wxPixelDataOut<Image>::template wxPixelDataIn<PixelFormat>
{
public:
- wxPixelData(Image& image)
- : wxPixelDataOut<Image>::wxPixelDataIn<PixelFormat>(image)
- {
- }
+ typedef
+ typename wxPixelDataOut<Image>::template wxPixelDataIn<PixelFormat>
+ Base;
- wxPixelData(Image& i, const wxPoint& pt, const wxSize& sz)
- : wxPixelDataOut<Image>::wxPixelDataIn<PixelFormat>(i, pt, sz)
- {
- }
+ wxPixelData(Image& image) : Base(image) { }
- wxPixelData(Image& i, const wxRect& rect)
- : wxPixelDataOut<Image>::wxPixelDataIn<PixelFormat>(i, rect)
- {
- }
+ wxPixelData(Image& i, const wxRect& rect) : Base(i, rect) { }
+
+ wxPixelData(Image& i, const wxPoint& pt, const wxSize& sz)
+ : Base(i, pt, sz)
+ {
+ }
};
#ifdef __VISUALC__
#pragma warning(default: 4355)
+ #pragma warning(default: 4097)
#endif
#endif // _WX_RAWBMP_H_BASE_