X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77ffb5937e89927b621128789401db8921fe580f..1306e7d6eca73adb57bc6e50d22108371c0241e7:/include/wx/rawbmp.h diff --git a/include/wx/rawbmp.h b/include/wx/rawbmp.h index b61c7fd4a1..3fca5566a7 100644 --- a/include/wx/rawbmp.h +++ b/include/wx/rawbmp.h @@ -6,12 +6,14 @@ // Created: 10.03.03 // RCS-ID: $Id$ // Copyright: (c) 2002 Vadim Zeitlin <vadim@wxwidgets.org> -// Licence: wxWidgets licence +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_RAWBMP_H_BASE_ #define _WX_RAWBMP_H_BASE_ +#include "wx/image.h" + // ---------------------------------------------------------------------------- // Abstract Pixel API // @@ -158,6 +160,11 @@ typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxImagePixelFormat; // Cocoa is standard RGB or RGBA (normally it is RGBA) typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat; + #define wxPIXEL_FORMAT_ALPHA 3 +#elif defined(__WXGTK__) + // Under GTK+ 2.X we use GdkPixbuf, which should be RGBA + typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat; + #define wxPIXEL_FORMAT_ALPHA 3 #endif @@ -174,6 +181,7 @@ typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxImagePixelFormat; // used as default value for the pixel format in wxPixelIterator template template <class T> struct wxPixelFormatFor; +#if wxUSE_IMAGE // wxPixelFormatFor is only defined for wxImage, attempt to use it with other // classes (wxBitmap...) will result in compile errors which is exactly what we // want @@ -182,6 +190,7 @@ struct WXDLLEXPORT wxPixelFormatFor<wxImage> { typedef wxImagePixelFormat Format; }; +#endif //wxUSE_IMAGE // ---------------------------------------------------------------------------- // wxPixelData @@ -269,6 +278,7 @@ struct WXDLLEXPORT wxPixelDataOut }; }; +#if wxUSE_IMAGE // wxPixelData specialization for wxImage: this is the simplest case as we // don't have to care about different pixel formats here template <> @@ -279,6 +289,7 @@ struct WXDLLEXPORT wxPixelDataOut<wxImage> template <class dummyPixelFormat> class WXDLLEXPORT wxPixelDataIn : public wxPixelDataBase { + public: // the type of the class we're working with typedef wxImage ImageType; @@ -453,7 +464,9 @@ struct WXDLLEXPORT wxPixelDataOut<wxImage> Iterator m_pixels; }; }; +#endif //wxUSE_IMAGE +#if wxUSE_GUI // wxPixelData specialization for wxBitmap: here things are more interesting as // we also have to support different pixel formats template <> @@ -466,7 +479,7 @@ struct WXDLLEXPORT wxPixelDataOut<wxBitmap> // the type of the class we're working with typedef wxBitmap ImageType; - class Iterator + class WXDLLEXPORT Iterator { public: // the pixel format we use @@ -635,6 +648,7 @@ struct WXDLLEXPORT wxPixelDataOut<wxBitmap> } }; }; +#endif //wxUSE_GUI #ifdef __VISUALC__ // typedef-name 'foo' used as synonym for class-name 'bar' @@ -665,9 +679,13 @@ public: // some "predefined" pixel data classes +#if wxUSE_IMAGE typedef wxPixelData<wxImage> wxImagePixelData; +#endif //wxUSE_IMAGE +#if wxUSE_GUI typedef wxPixelData<wxBitmap, wxNativePixelFormat> wxNativePixelData; typedef wxPixelData<wxBitmap, wxAlphaPixelFormat> wxAlphaPixelData; +#endif //wxUSE_GUI // ---------------------------------------------------------------------------- // wxPixelIterator