[GRASS-dev] discussion: replacing ps.map

Glynn Clements glynn at gclements.plus.com
Thu Mar 29 18:47:33 EDT 2007


Michael Barton wrote:

> > I have changed this in the current CVS version; the drivers now
> > provide a scaled-raster operation, which is more suitable for a
> > PostScript driver.
> 
> Is this something that is accessible from an external program. That is,
> can/should this replace setting GRASS_HEIGHT and GRASS_WIDTH?

No.

This change only affects programs which draw raster maps, e.g. d.rast.

The change involves two new functions:

	void R_begin_scaled_raster(int [2][2], int [2][2]);
	int R_scaled_raster(int, int, unsigned char *, unsigned char *, unsigned char *, unsigned char *);

These pass unscaled raster data to the driver, which performs the
scaling itself.

The higher-level raster drawing functions in the display library
(D_draw_cell() etc) now use these functions, whereas before they
performed the scaling themselves and passed scaled raster data to the
driver.

This change makes it more practical to implement e.g. a PostScript
driver, where it doesn't make sense for the client to pre-scale the
data.

The original unscaled raster function R_RGB_raster() is only used by
i.point, i.vpoints and i.class. They could be changed to use the
scaled raster functions with 1:1 scaling, although I'm not sure that I
understand them well enough to test any changes, and I'm not sure if
it's worth the effort (AFAIK, they should all be obsolete soon).

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-dev mailing list