| Reply | « Previous Thread | Next Thread » |
|
Hello,
I am working on an app that does some image procesing. I would like to do this processing in C since it runs very slowly when implemented in Python. So I want to create a wrapper such that I pass it 1 image, and it returns a string (or an integer representing the string). The question I have is, how do I make a wrapper that takes as input a Python image object (since the function is being called from python) and converts it into a Symbian object suitable for being processed in C. If there is another way to pass an image to the C code through a wrapper please let me know. Any help would be greatly appreciated. |
| yqmtooblue |
| View Public Profile |
| Find all posts by yqmtooblue |
|
You have to create a Python extension in C++.
Get full Symbian/S60 SDK from Nokia along with Carbide.c++. Then create a DLL project (read PyS60 docs chapter on extension modules). On PyS60 you have the standard Python/C API. You have to learn to use this. You can also download PyS60 sources to take a look at some s60 specific standard modules sources. The last thing to do is to learn how to perform your task using Symbian C++ APIs. |
|
Hi yak,
Thanks for your reply. I already am able to create extensions (from following these instructions: http://wiki.research.nokia.com/index.php/PythonWrappers). The only difficult part I am having is the conversion from python image wrapper to symbian image wrapper. It seems your suggestion is to view the PyS60 sources... an unpleasant task at best. Does anyone have a more direct answer? Surely I am not the first who wished to perform image processing in C as opposed to Python! |
| yqmtooblue |
| View Public Profile |
| Find all posts by yqmtooblue |
|
Looking at the sources isn't so bad
![]() Here's a part of ext/graphics/graphicsmodule.cpp file: Code:
static CFbsBitmap *
Bitmap_AsFbsBitmap(PyObject *obj)
{
PyObject *capi_object=PyCAPI_GetCAPI(obj,"_bitmapapi");
if (!capi_object)
return NULL;
CFbsBitmap *bitmap=(CFbsBitmap *)PyCObject_AsVoidPtr(capi_object);
Py_DECREF(capi_object);
return bitmap;
}
This code is not complete, for example the PyCAPI_GetCAPI function is found in the same file but I won't copy it here. Like I said, take a look at the sources. Of course if someone can explain it without looking at the sources, it would be great. |
|
yqmtooblue,
I'm looking to do similar things as you are. Did you have any success? If so, I'd really appreciate if you'd like to share some of your experiences so far. I was thinking I'd start from the source code of the graphics module and continue from there, but so far I haven't been able to compile it into an extension. ![]() You don't feel like sharing any of your source code, do you? If so, feel free to contact me! |
|
I'm trying to pass CFbsBitmap from the FrameReady callback in a camera dll written in Symbian C++ to a Python script... do you guys know how should I do it?
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| 7650 Symbian Connect | alexbas | Symbian Tools & SDKs | 4 | 2008-11-16 11:40 |
| setting of Series 60 MIDP SDK for Symbian OS version 1.2 for networking | servigo | Mobile Java Networking & Messaging & Security | 2 | 2003-07-31 08:47 |
| CcDoc configuration for Doxygen for use with Symbian Series 60 code | nawkboy | General Symbian C++ | 0 | 2003-06-13 02:11 |
| CcDoc configuration for Doxygen for use with Symbian Series 60 code | nawkboy | Symbian Tools & SDKs | 0 | 2003-06-13 02:10 |
| CcDoc configuration for Doxygen for use with Symbian Series 60 code | nawkboy | General Symbian C++ | 0 | 2003-06-13 02:09 |