reSWIGged

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33328 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2005-04-04 15:57:55 +00:00
parent 5b5c9bc768
commit 57133d5cdb
2 changed files with 76 additions and 2 deletions

View File

@@ -85,6 +85,7 @@ SIMPLE_BORDER = _core_.SIMPLE_BORDER
STATIC_BORDER = _core_.STATIC_BORDER STATIC_BORDER = _core_.STATIC_BORDER
TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW TRANSPARENT_WINDOW = _core_.TRANSPARENT_WINDOW
NO_BORDER = _core_.NO_BORDER NO_BORDER = _core_.NO_BORDER
DEFAULT_CONTROL_BORDER = _core_.DEFAULT_CONTROL_BORDER
TAB_TRAVERSAL = _core_.TAB_TRAVERSAL TAB_TRAVERSAL = _core_.TAB_TRAVERSAL
WANTS_CHARS = _core_.WANTS_CHARS WANTS_CHARS = _core_.WANTS_CHARS
POPUP_WINDOW = _core_.POPUP_WINDOW POPUP_WINDOW = _core_.POPUP_WINDOW
@@ -2033,6 +2034,9 @@ def MemoryFSHandler_RemoveFile(*args, **kwargs):
"""MemoryFSHandler_RemoveFile(String filename)""" """MemoryFSHandler_RemoveFile(String filename)"""
return _core_.MemoryFSHandler_RemoveFile(*args, **kwargs) 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): class ImageHandler(Object):
@@ -2241,6 +2245,15 @@ class Image(Object):
""" """
return _core_.Image_InitAlpha(*args, **kwargs) 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): def FindFirstUnusedColour(*args, **kwargs):
""" """
FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b) FindFirstUnusedColour(int startR=1, int startG=0, int startB=0) -> (success, r, g, b)
@@ -2253,7 +2266,7 @@ class Image(Object):
def ConvertAlphaToMask(*args, **kwargs): 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 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 with alpha value less than ``threshold`` are replaced with mask colour and the

View File

@@ -11506,6 +11506,54 @@ static PyObject *_wrap_Image_InitAlpha(PyObject *, PyObject *args, PyObject *kwa
} }
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) { static PyObject *_wrap_Image_FindFirstUnusedColour(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj; PyObject *resultobj;
wxImage *arg1 = (wxImage *) 0 ; wxImage *arg1 = (wxImage *) 0 ;
@@ -11579,7 +11627,7 @@ static PyObject *_wrap_Image_FindFirstUnusedColour(PyObject *, PyObject *args, P
static PyObject *_wrap_Image_ConvertAlphaToMask(PyObject *, PyObject *args, PyObject *kwargs) { static PyObject *_wrap_Image_ConvertAlphaToMask(PyObject *, PyObject *args, PyObject *kwargs) {
PyObject *resultobj; PyObject *resultobj;
wxImage *arg1 = (wxImage *) 0 ; wxImage *arg1 = (wxImage *) 0 ;
byte arg2 = (byte) 128 ; byte arg2 = (byte) wxIMAGE_ALPHA_THRESHOLD ;
bool result; bool result;
PyObject * obj0 = 0 ; PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ; PyObject * obj1 = 0 ;
@@ -45506,6 +45554,7 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"Image_GetAlpha", (PyCFunction) _wrap_Image_GetAlpha, METH_VARARGS | METH_KEYWORDS, NULL}, { (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_HasAlpha", (PyCFunction) _wrap_Image_HasAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"Image_InitAlpha", (PyCFunction) _wrap_Image_InitAlpha, 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_FindFirstUnusedColour", (PyCFunction) _wrap_Image_FindFirstUnusedColour, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"Image_ConvertAlphaToMask", (PyCFunction) _wrap_Image_ConvertAlphaToMask, 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}, { (char *)"Image_ConvertColourToAlpha", (PyCFunction) _wrap_Image_ConvertColourToAlpha, METH_VARARGS | METH_KEYWORDS, NULL},
@@ -47727,6 +47776,9 @@ SWIGEXPORT(void) SWIG_init(void) {
{ {
PyDict_SetItemString(d,"NO_BORDER", SWIG_From_int((int)(wxNO_BORDER))); 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))); PyDict_SetItemString(d,"TAB_TRAVERSAL", SWIG_From_int((int)(wxTAB_TRAVERSAL)));
} }
@@ -49516,6 +49568,15 @@ SWIGEXPORT(void) SWIG_init(void) {
wxPyPtrTypeMap_Add("wxFileSystemHandler", "wxPyFileSystemHandler"); 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*)"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_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); SWIG_addvarlink(SWIG_globals,(char*)"IMAGE_OPTION_BMP_FORMAT",_wrap_IMAGE_OPTION_BMP_FORMAT_get, _wrap_IMAGE_OPTION_BMP_FORMAT_set);