Re[2]: [PHP] Better way to store data in memory?
| From: | Richard Davey | Date: | Mon, 23 Jul 2007 17:56:29 +0000 |
| Subject: | Re[2]: [PHP] Better way to store data in memory? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-259385@lists.php.net to get a copy of this message | ||
Hi Robert,
Monday, July 23, 2007, 6:00:50 PM, you wrote:
> What kind of data? Can't you just store it in the image? Or a working
> copy of the image?
Afraid not, I'm performing deformation on the data that requires a
temporary location before rendering to the final image. If this was a
straight single pixel change I could do it directly to the canvas as
you suggest.
> Is it possible for you to just store the entires you use? or are you
> actually storing data for 307,200 elements?
The 307,200 comes from a 640x480 image. I'm storing all elements at
the moment. I can implement RLE to save on space, and was about to
start doing that before I posted to the list to find out if I could
avoid using an array at the same time. Depending on the image RLE
itself will help considerably.
> Sure, store it in a string and treat the string as a binary chunk.
Looks like being the only way. It'd be nice to be able to create a
memblock and literally poke/peek to it (safely of course, I'm not
talking about arbitrarily writing to system memory or anything). I'll
check Pear first, but if there's no pre-built lib for it then it might
be time to create one.
Cheers,
Rich
--
Zend Certified Engineer
http://www.corephp.co.uk
"Never trust a computer you can't throw out of a window"