Hi Chris, On Sun, Jun 27, 2010 at 12:11 PM, Chris Marshall <c...@alum.mit.edu> wrote:
> On 6/27/2010 10:59 AM, Kartik Thakore wrote: > >> >> Hi >> >> Ok I looked at get_dataref. But I still don't understand why the >> surface->pixels is swaped out when a piddle is written. Both of the >> Devel::Peek for the get_dataref and surface->get_pixels is the exact same. >> > > get_dataref is a perl reference to the data section of > the piddle. The surface->pixels is just a pointer to > the pixel data. I see no copying of data in the code so > it doesn't seem like they should be the same. > Right be surface->pixels is wrapped into a reference. > > I notice on the page you reference for the XS stuff that > there is a surface_new_from routine. Have you tried > creating a piddle of data the size and structure of the > surface and then creating the desired surface from that? > > This is a good idea. How do I make a piddle of bytes 4 * $width * $height ? > At least you would have all the surface and piddle data > in the same spot which seems to be your difficulty here > This might be easier indeed, thanks. --Chris > > On Sun, Jun 27, 2010 at 1:32 AM, Chris Marshall <c...@alum.mit.edu >> <mailto:c...@alum.mit.edu>> wrote: >> >> On 6/26/2010 10:49 PM, Kartik Thakore wrote: >> >> Right but where is the piddle xs code? >> >> >> It is in Basic/Core in the PDL directory. >> The piddle data is in the string of the perl scalar. >> That way it gets the advantage of the perl memory >> allocation/freeing... >> >> --Chris >> >> On Sat, Jun 26, 2010 at 10:35 PM, Chris Marshall >> <c...@alum.mit.edu <mailto:c...@alum.mit.edu> >> <mailto:c...@alum.mit.edu <mailto:c...@alum.mit.edu>>> wrote: >> >> On 6/26/2010 10:10 PM, Kartik Thakore wrote: >> >> What SV_type is getdata_ref using? where can I find that? >> >> >> You can get a copy of the PDL source from CPAN >> and that should explain things. >> >> --Chris >> >> >> >> >> >> No virus found in this incoming message. >> Checked by AVG - www.avg.com <http://www.avg.com> >> >> Version: 9.0.830 / Virus Database: 271.1.1/2964 - Release Date: >> 06/26/10 02:35:00 >> >> >> >> >> >> >> No virus found in this incoming message. >> Checked by AVG - www.avg.com >> Version: 9.0.830 / Virus Database: 271.1.1/2966 - Release Date: 06/27/10 >> 02:35:00 >> >> >