[GRASS5] embedding GRASS display into my app

Glynn Clements glynn.clements at virgin.net
Wed Apr 7 19:07:06 EDT 2004


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