[GRASS-dev] ps.map: raster always under vector map?

Glynn Clements glynn at gclements.plus.com
Sat May 5 11:30:44 EDT 2007


Markus Neteler wrote:

> > > > For masked images, you need to use the one-operand form of the "image"
> > > > operator with an image dictionary; see the RASTERMASK procedure in
> > > > lib/psdriver/psdriver.ps for an example. This requires support for
> > > > level 3 PostScript (present in GhostScript for a few years now; I
> > > > don't know about printers).
> > > > 
> > > > Regarding the generation of the image data (ps/ps.map/ps_raster.c), a
> > > > masked image needs 2 (mono) or 4 (RGB) components, with the mask byte
> > > > first (i.e. AARRGGBB); see lib/psdriver/Raster.c.
> > > 
> > > I am afraid that I am not able to implement this.
> > 
> > Try the attached patch.
> > 
> > It only works with single rasters, not R/G/B groups. Also, the masked
> > flag is currently hard-coded on; ultimately, this would need to be
> > made into an option to the raster/rgb/group commands.
> 
> do you consider to submit it? It seems to work well.

Not in its present form. The main problem is that the "masked" setting
is currently hard-coded, and masked images require level 3 PostScript. 
This would make the output from ps.map incompatible with older
versions of Ghostscript and some printers.

Realistically, the ps.map input syntax needs to be extended to add a
"masked" option to the raster, greyrast, rgb and group commands, so
that masked images are only used if specifically requested. 
Alternatively, masking could be enabled only if the raster isn't the
bottom-most layer (it used to always be drawn first, but presumably
that has been changed).

Also, the patch only affects the raster/greyrast commands; the
rgb/group case needs similar treatment.

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




More information about the grass-dev mailing list