On Mar 9, 2007, at 5:53 PM, Raul Perez-alejo Neyra wrote:

>
> thanks to allan for forwarding my message to this mailing list,  
> unfortunately we still have problems with the plplot mem driver. We  
> want plplot to compose a graphic in memory and then pass it to  
> another vector graphic library (cairo).
> In our testing it seems that plplot does not write in the defined  
> buffer, the problem doesn't seems to be cairo because when we force  
> the values of the buffer cairo outputs fine.
> we are using plplot-5.7.2 with xwin and mem drivers only.
>
> here is our test code.
> this example is an hybrid of some code found on sourceforge, and  
> sent to us by Hazen.
> any help will be appreciated.
> gratings Raul.

This is really puzzling. I'm quite sure (from the original example on  
OS-X) that buffer contains a picture of a plot and that cairo_buffer  
is in fact a faithful representation of this plot.

If you insert the following:

check = 0;
for(int i = 0; i < (width * height * 3); i++){
   if(buffer[i] > 0){ check++; }
}
printf("%d\n", check);
        
check = 0;
for(int i = 0; i < (width * height * 4); i++){
   if(cairo_buffer[i] > 0){ check++; }
}
printf("%d\n", check);

You will see that both buffers contain 1060 (red) values. You can  
also verify that the buffer contains a minimum value of 0 and a max  
of 255. The plot is just a box with ticks, and a line in the center.  
Everything will be red on a black background. The call pscolbg 
(255,255,255) is not actually doing anything.

best,
-Hazen


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to