Re: Accessing another extensions resource.. possible?
| From: | Sean | Date: | Thu, 25 Aug 2005 18:36:09 +0000 |
| Subject: | Re: Accessing another extensions resource.. possible? | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2790@lists.php.net to get a copy of this message | ||
Thank you so much everyone. I just got back from vacation so I apologize
for my slow reply.
I was able to get it to work wonderfully. Since I had no desire to use the
gd functions in my extension (I just needed raw access to the pixel data)
and to avoid compilation problems outside the source tree I just copied the
image structure defined by php's gd extension into my code directly. It's
kinda the easy way out but it works so well. I'm not quite at a point where
I can show it but hopfully it'll be ready within a month.
Thanks again everyone!
Sean
""Sean"" <sean@reinvigorate.net> wrote in message
news:7A.89.33075.B3A1EF24@pb1.pair.com...
>I have a question regarding resource management in PHP that I would
>absolutely appreciate any insight on-
>
> Can extension A get access to a resource created by extension B? For
> example- if I wanted to add in a new image function, could I get access to
> the GD extension's gdImage struct?
>
> I wrote an improved Breshenham line algorithm in php that renders the most
> beautiful antialiased lines I've ever seen. The problem is the php
> implementation for it is UBER slow. Hence I'm looking into writing my own
> extension to give it a speed boost. But I'm having a hard time finding
> the right approach to this.
>
> There's three ways I'm thinking this can be done-
> 1. Write my own extension based on GD from scratch
> 2. Inject my line drawing function into gd.h and gd.c (so it'd be a
> modified version of the gd extension that comes with php)
> 3. Write my own extension that is capable of accessing the gdImage struct
> from the GD extensions.
>
> I'd prefer not to write an entire image library from scratch. But I'll do
> it if 2 and 3 aren't possible/reasonable.
>
> Thanks everyone!