%rename(STATIC_BORDER) wxSTATIC_BORDER;
%rename(TRANSPARENT_WINDOW) wxTRANSPARENT_WINDOW;
%rename(NO_BORDER) wxNO_BORDER;
+%rename(DEFAULT_CONTROL_BORDER) wxDEFAULT_CONTROL_BORDER;
%rename(TAB_TRAVERSAL) wxTAB_TRAVERSAL;
%rename(WANTS_CHARS) wxWANTS_CHARS;
%rename(POPUP_WINDOW) wxPOPUP_WINDOW;
%rename(InternetFSHandler) wxInternetFSHandler;
%rename(ZipFSHandler) wxZipFSHandler;
%rename(MemoryFSHandler) wxMemoryFSHandler;
+%rename(IMAGE_ALPHA_TRANSPARENT) wxIMAGE_ALPHA_TRANSPARENT;
+%rename(IMAGE_ALPHA_THRESHOLD) wxIMAGE_ALPHA_THRESHOLD;
+%rename(IMAGE_ALPHA_OPAQUE) wxIMAGE_ALPHA_OPAQUE;
%rename(ImageHandler) wxImageHandler;
%rename(ImageHistogram) wxImageHistogram;
%rename(Image) wxImage;
STATIC_BORDER = _core_.STATIC_BORDER
TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
NO_BORDER = _core_.NO_BORDER
+DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
WANTS_CHARS = _core_.WANTS_CHARS
POPUP_WINDOW = _core_.POPUP_WINDOW
"""MemoryFSHandler_RemoveFile(String filename)"""
return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs)
+IMAGE_ALPHA_TRANSPARENT = _core_.IMAGE_ALPHA_TRANSPARENT
+IMAGE_ALPHA_THRESHOLD = _core_.IMAGE_ALPHA_THRESHOLD
+IMAGE_ALPHA_OPAQUE = _core_.IMAGE_ALPHA_OPAQUE
#---------------------------------------------------------------------------
class ImageHandler(Object):
"""
return _core_.Image_InitAlpha(*args, **kwargs)
+ def IsTransparent(*args, **kwargs):
+ """
+ IsTransparent(self, int x, int y, unsigned char threshold=IMAGE_ALPHA_THRESHOLD) -> bool
+
+ Returns True if this pixel is masked or has an alpha value less than
+ the spcified threshold.
+ """
+ return _core_.Image_IsTransparent(*args, **kwargs)
+
def FindFirstUnusedColour(*args, **kwargs):
"""
FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
def ConvertAlphaToMask(*args, **kwargs):
"""
- ConvertAlphaToMask(self, byte threshold=128) -> bool
+ ConvertAlphaToMask(self, byte threshold=IMAGE_ALPHA_THRESHOLD) -> bool
If the image has alpha channel, this method converts it to mask. All pixels
with alpha value less than ``threshold`` are replaced with mask colour and the
}
+static PyObject *_wrap_Image_IsTransparent(PyObject *, PyObject *args, PyObject *kwargs) {
+ PyObject *resultobj;
+ wxImage *arg1 = (wxImage *) 0 ;
+ int arg2 ;
+ int arg3 ;
+ unsigned char arg4 = (unsigned char) wxIMAGE_ALPHA_THRESHOLD ;
+ bool result;
+ PyObject * obj0 = 0 ;
+ PyObject * obj1 = 0 ;
+ PyObject * obj2 = 0 ;
+ PyObject * obj3 = 0 ;
+ char *kwnames[] = {
+ (char *) "self",(char *) "x",(char *) "y",(char *) "threshold", NULL
+ };
+
+ if(!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OOO|O:Image_IsTransparent",kwnames,&obj0,&obj1,&obj2,&obj3)) goto fail;
+ SWIG_Python_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_wxImage, SWIG_POINTER_EXCEPTION | 0);
+ if (SWIG_arg_fail(1)) SWIG_fail;
+ {
+ arg2 = (int)(SWIG_As_int(obj1));
+ if (SWIG_arg_fail(2)) SWIG_fail;
+ }
+ {
+ arg3 = (int)(SWIG_As_int(obj2));
+ if (SWIG_arg_fail(3)) SWIG_fail;
+ }
+ if (obj3) {
+ {
+ arg4 = (unsigned char)(SWIG_As_unsigned_SS_char(obj3));
+ if (SWIG_arg_fail(4)) SWIG_fail;
+ }
+ }
+ {
+ PyThreadState* __tstate = wxPyBeginAllowThreads();
+ result = (bool)((wxImage const *)arg1)->IsTransparent(arg2,arg3,arg4);
+
+ wxPyEndAllowThreads(__tstate);
+ if (PyErr_Occurred()) SWIG_fail;
+ }
+ {
+ resultobj = result ? Py_True : Py_False; Py_INCREF(resultobj);
+ }
+ return resultobj;
+ fail:
+ return NULL;
+}
+
+
static PyObject *_wrap_Image_FindFirstUnusedColour(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxImage *arg1 = (wxImage *) 0 ;
static PyObject *_wrap_Image_ConvertAlphaToMask(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj;
wxImage *arg1 = (wxImage *) 0 ;
- byte arg2 = (byte) 128 ;
+ byte arg2 = (byte) wxIMAGE_ALPHA_THRESHOLD ;
bool result;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
{ (char *)"Image_GetAlpha", (PyCFunction) _wrap_Image_GetAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"Image_HasAlpha", (PyCFunction) _wrap_Image_HasAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"Image_InitAlpha", (PyCFunction) _wrap_Image_InitAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
+ { (char *)"Image_IsTransparent", (PyCFunction) _wrap_Image_IsTransparent, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"Image_FindFirstUnusedColour", (PyCFunction) _wrap_Image_FindFirstUnusedColour, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"Image_ConvertAlphaToMask", (PyCFunction) _wrap_Image_ConvertAlphaToMask, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"Image_ConvertColourToAlpha", (PyCFunction) _wrap_Image_ConvertColourToAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
{
PyDict_SetItemString(d,"NO_BORDER", SWIG_From_int((int)(wxNO_BORDER)));
}
+ {
+ PyDict_SetItemString(d,"DEFAULT_CONTROL_BORDER", SWIG_From_int((int)(wxDEFAULT_CONTROL_BORDER)));
+ }
{
PyDict_SetItemString(d,"TAB_TRAVERSAL", SWIG_From_int((int)(wxTAB_TRAVERSAL)));
}
wxPyPtrTypeMap_Add("wxFileSystemHandler", "wxPyFileSystemHandler");
+ {
+ PyDict_SetItemString(d,"IMAGE_ALPHA_TRANSPARENT", SWIG_From_int((int)(wxIMAGE_ALPHA_TRANSPARENT)));
+ }
+ {
+ PyDict_SetItemString(d,"IMAGE_ALPHA_THRESHOLD", SWIG_From_int((int)(wxIMAGE_ALPHA_THRESHOLD)));
+ }
+ {
+ PyDict_SetItemString(d,"IMAGE_ALPHA_OPAQUE", SWIG_From_int((int)(wxIMAGE_ALPHA_OPAQUE)));
+ }
SWIG_addvarlink(SWIG_globals,(char*)"NullImage",_wrap_NullImage_get, _wrap_NullImage_set);
SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_FILENAME",_wrap_IMAGE_OPTION_FILENAME_get, _wrap_IMAGE_OPTION_FILENAME_set);
SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_BMP_FORMAT",_wrap_IMAGE_OPTION_BMP_FORMAT_get, _wrap_IMAGE_OPTION_BMP_FORMAT_set);
wxSTATIC_BORDER = wx._core.STATIC_BORDER
wxTRANSPARENT_WINDOW = wx._core.TRANSPARENT_WINDOW
wxNO_BORDER = wx._core.NO_BORDER
+wxDEFAULT_CONTROL_BORDER = wx._core.DEFAULT_CONTROL_BORDER
wxTAB_TRAVERSAL = wx._core.TAB_TRAVERSAL
wxWANTS_CHARS = wx._core.WANTS_CHARS
wxPOPUP_WINDOW = wx._core.POPUP_WINDOW
wxMemoryFSHandler = wx._core.MemoryFSHandler
wxMemoryFSHandlerPtr = wx._core.MemoryFSHandlerPtr
wxMemoryFSHandler_RemoveFile = wx._core.MemoryFSHandler_RemoveFile
+wxIMAGE_ALPHA_TRANSPARENT = wx._core.IMAGE_ALPHA_TRANSPARENT
+wxIMAGE_ALPHA_THRESHOLD = wx._core.IMAGE_ALPHA_THRESHOLD
+wxIMAGE_ALPHA_OPAQUE = wx._core.IMAGE_ALPHA_OPAQUE
wxImageHandler = wx._core.ImageHandler
wxImageHandlerPtr = wx._core.ImageHandlerPtr
wxImageHistogram = wx._core.ImageHistogram