class wxImageHandler {
public:
- wxImageHandler();
+ // wxImageHandler(); Abstract Base Class
wxString GetName();
wxString GetExtension();
long GetType();
wxGIFHandler();
};
+class wxPNMHandler : public wxImageHandler {
+public:
+ wxPNMHandler();
+};
+
+class wxPCXHandler : public wxImageHandler {
+public:
+ wxPCXHandler();
+};
+
+class wxTIFFHandler : public wxImageHandler {
+public:
+ wxTIFFHandler();
+};
//---------------------------------------------------------------------------
int GetWidth();
int GetHeight();
- unsigned char *GetData();
- void SetData( unsigned char *data );
+ wxImage GetSubImage(const wxRect& rect);
+
+ //unsigned char *GetData();
+ //void SetData( unsigned char *data );
+
+ %addmethods {
+ PyObject* GetData() {
+ unsigned char* data = self->GetData();
+ int len = self->GetWidth() * self->GetHeight() * 3;
+ return PyString_FromStringAndSize((char*)data, len);
+ }
+
+ void SetData(PyObject* data) {
+ unsigned char* dataPtr;
+
+ if (! PyString_Check(data)) {
+ PyErr_SetString(PyExc_TypeError, "Expected string object");
+ return /* NULL */ ;
+ }
+
+ size_t len = self->GetWidth() * self->GetHeight() * 3;
+ dataPtr = new unsigned char[len];
+ memcpy(dataPtr, PyString_AsString(data), len);
+ self->SetData(dataPtr);
+ }
+ }
void SetMaskColour( unsigned char r, unsigned char g, unsigned char b );
unsigned char GetMaskRed();
}
%}
+void wxInitAllImageHandlers();
+
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
-
-
-
-