typedef wxPixelFormat<unsigned char, 32, 1, 2, 3> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 0
+#elif defined(__WXCOCOA__)
+ // Cocoa is standard RGB or RGBA (normally it is RGBA)
+ typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat;
+
+ #define wxPIXEL_FORMAT_ALPHA 3
#endif
// the (most common) native format for bitmaps with alpha channel
int GetWidth() const { return m_width; }
int GetHeight() const { return m_height; }
+ wxSize GetSize() const { return wxSize(m_width, m_height); }
+
// the distance between two rows
int GetRowStride() const { return m_stride; }
// private: -- see comment in the beginning of the file
- // NB: for efficiency reasons this class must *not* have any other
- // fields, otherwise it won't be put into a CPU register (as it
- // should inside the inner loops) by some compilers, notably
- // gcc
+ // for efficiency reasons this class should not have any other
+ // fields, otherwise it won't be put into a CPU register (as it
+ // should inside the inner loops) by some compilers, notably gcc
ChannelType *m_ptr;
};
wxPixelDataIn(wxBitmap& bmp, const wxRect& rect)
: m_bmp(bmp), m_pixels(bmp, *this)
{
- InitRect(rect.GetPositions(), rect.GetSize());
+ InitRect(rect.GetPosition(), rect.GetSize());
}
wxPixelDataIn(wxBitmap& bmp, const wxPoint& pt, const wxSize& sz)