Re: passing image data



Hi Peter,

On Fri, 2003-04-25 at 10:43, Peter Van Osta wrote:
> How do I allocate the memory in the client, before asking the sever to
> fill the data and how do I fill the sequence "buffer" with data. How do
> I reach the addres of the "EzxImgObj->EzxImgBuf->buffer" pointer to
> write to in the server ????

	Why bother allocating the memory in the client ? :-)

> What if I already have allocated a guchar buffer for GDK to contain the
> image data on the client, can I just point EzxImgBuf.buffer in the
> sequence to the same memory space ?

	Yes - you can; but you need to set _release on the sequence to FALSE;
since otherwise the ORB will try to free your sequence on return.

> In the server "EzxImgObj"
> subelements are pointers, but i cannot reach the embedded "EzxImgBuf"
> "_buffer" by "EzxImgObj->EzxImgBuf->buffer"

	The 'data' EzxImageBuf is a member; so you want obj->buf._buffer.

> Is there any example which can be found in a simple way to show how a
> server fills a "nested" structure as in this case ?

	If you look at ORBit2/test/everything/* that has a large set of
examples of all manner of contorted things. Unfortunately it uses out
arguments a lot; instead I'd tend to do:

client:
EszImgObj *obj = foo_corba_method (obj, "image-name", ev);

server:

EszImgObj *obj = EszImgObj__alloc ();
obj->width = 3;
obj->height = 2;
obj->data._buffer = gdk_pixbuf_get_pixels();
obj->data._release = FALSE;

return obj;

	Something like that;

	HTH,

		Michael.

-- 
 mmeeks@gnu.org  <><, Pseudo Engineer, itinerant idiot




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]