Re: [GRASS-dev] PSDriver

2022-11-14 Thread Glynn Clements


Brad ReDacted wrote:

> Can someone tell me what spec the (enhanced) postscript driver 
> (lib/psdriver) adheres to? I am having difficulty looking up one of the 
> parameters (box erase, in particular - erase.c).
> 
> I found references to PostScript levels, but no mention of EPS, which is 
> clearly being used in this case. AFAICT, there is no such box erase in EPS.

If the output filename ends in ".eps", then the "ps.encapsulated" flag is
set. This does two things: PS_Set_window() writes "EPSWINDOW" instead
of "WINDOW", and PS_Erase() writes "ERASE" instead of a "BOX" command.

All commands are defined in psdriver.ps.

The PS driver doesn't attempt to generate true Encapsulated
PostScript, it just tries to be slightly more useful if you're going
to something other than send the file straight to a printer. 
Essentially, if ps.encapsulated is set, the driver avoids issuing
"destructive" commands.

BOX just draws a filled rectangle, while ERASE executes an "erasepage"
command.

EPSWINDOW is identical to WINDOW except the former doesn't execute
"initclip".

I have no idea how much use (if any) the PS driver has. Its main
advantage over using the cairo driver is that the PS driver doesn't
rasterise vector commands, whereas cairo will do this for features
which can't otherwise be implemented (e.g. alpha blending). This can
result in PS files generated by the cairo driver being much larger
than those generated by the PS driver while having worse image
quality.
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev


Re: [GRASS-dev] PSDriver

2022-10-13 Thread Vaclav Petras
On Thu, 13 Oct 2022 at 15:43, Markus Neteler  wrote:

> On Thu, Oct 13, 2022 at 8:35 AM Brad ReDacted 
> wrote:
> >
> > Can someone tell me what spec the (enhanced) postscript driver
> > (lib/psdriver) adheres to? I am having difficulty looking up one of the
> > parameters (box erase, in particular - erase.c).
>
> Good question, the driver did not receive much attention in the last 15
> years:
>

I think it would be fair to just select whatever reasonable modern spec and
make it adhere to that, i.e., modernize. (Or just focus on Cairo, that's
another option.)


> and this ticket:
>
> Cairo and PS drivers display only one raster or vector for SVG and PS
> https://trac.osgeo.org/grass/ticket/3033
>

That's definitely a major issue. Perhaps easier to solve for the PS driver.

Not really related to the PS driver, but related to reading images: A
doable feature seems to be adding raster image rendering to the Cairo
driver. It can read an existing image as a background to draw on, but we
are missing functions to draw raster images as overlays (something which
would be accessed using e.g. d.image or used for symbols).

Vaclav
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev


Re: [GRASS-dev] PSDriver

2022-10-13 Thread Markus Neteler
On Thu, Oct 13, 2022 at 8:35 AM Brad ReDacted  wrote:
>
> Hello,
>
> Can someone tell me what spec the (enhanced) postscript driver
> (lib/psdriver) adheres to? I am having difficulty looking up one of the
> parameters (box erase, in particular - erase.c).

Good question, the driver did not receive much attention in the last 15 years:

https://github.com/OSGeo/grass/commits/main/lib/psdriver/

I found to emails which are somewhat related:

[GRASS-dev] documenting the display lib in grass7
- https://lists.osgeo.org/pipermail/grass-dev/2009-January/042023.html
- https://lists.osgeo.org/pipermail/grass-dev/2009-January/042030.html

and this ticket:

Cairo and PS drivers display only one raster or vector for SVG and PS
https://trac.osgeo.org/grass/ticket/3033

> I found references to PostScript levels, but no mention of EPS, which is
> clearly being used in this case. AFAICT, there is no such box erase in EPS.
>
> Anyone here from way back with some info? I would like to correct some
> security issues and possibly expand commands; Like adding
> highresBoundingBox that will accept floats for higher precision.

I cannot comment much on this:

#733: display lib: support for curveto
https://trac.osgeo.org/grass/ticket/3033

Maybe others have more insights?

Markus
___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev


[GRASS-dev] PSDriver

2022-10-13 Thread Brad ReDacted

Hello,

Can someone tell me what spec the (enhanced) postscript driver 
(lib/psdriver) adheres to? I am having difficulty looking up one of the 
parameters (box erase, in particular - erase.c).


I found references to PostScript levels, but no mention of EPS, which is 
clearly being used in this case. AFAICT, there is no such box erase in EPS.


Anyone here from way back with some info? I would like to correct some 
security issues and possibly expand commands; Like adding 
highresBoundingBox that will accept floats for higher precision.



--
Best Regards,
-Brad

___
grass-dev mailing list
grass-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-dev