[GRASS5] embedding GRASS display into my app

David Piasecki piasecda at nv.doe.gov
Wed Apr 7 19:27:55 EDT 2004


Thanks. I think the greatest amount of time is spent on drawing the 
13MB vector file, but I might give it a shot. It might be more 
noticeable with smaller file sizes.

David


On Apr 7, 2004, at 4:07 PM, Glynn Clements wrote:

>
> David Piasecki wrote:
>
>> This seems to be working pretty well! Thanks! It only takes 2-3 
>> seconds
>> for the map to render itself in GRASS and save as a PNG file, and then
>> a split second to load in my Cocoa-Java application :)
>
> If you have the GRASS source code, you can speed up the writing of the
> PNG image by adding:
>
> 	png_set_compression_level(png_ptr, Z_NO_COMPRESSION);
>
> immediately before the line:
>
> 	png_write_info(png_ptr, info_ptr);
>
> in src/display/devices/PNGdriver/Graph_Clse.c.
>
> I haven't analysed exactly how much difference this will make, but it
> may be worth trying.
>
> Alternatively, using Z_BEST_SPEED instead of Z_NO_COMPRESSION will
> provide some degree of compression at the expense of some CPU usage
> but, if the PNG file survives long enough to be written to disk, the
> reduced file size may actually improve performance overall.
>
> -- 
> Glynn Clements <glynn.clements at virgin.net>





More information about the grass-dev mailing list