Re: [Rd] Question about grid.group compositing operators in cairo

2022-10-12 Thread Paul Murrell
Hi This issue has expanded to include the behaviour of compositing operators in R graphics more generally. For the record, the discussion is continuing here ... https://github.com/pmur002/rgraphics-compositing Paul On 4/10/22 09:20, Paul Murrell wrote: Interim update:  I have spoken with

Re: [Rd] Question about grid.group compositing operators in cairo

2022-10-03 Thread Paul Murrell
Interim update: I have spoken with Thomas Lin Pedersen (cc'ed), the author/maintainer of 'ragg' and 'svglite', who is working on adding group support for those graphics devices and he has voted in support of the current Cairo implementation, so the needle has shifted towards Cairo at this st

Re: [Rd] Question about grid.group compositing operators in cairo

2022-09-29 Thread Paul Murrell
Hi Some more thoughts ... <1> I said before that currently, dev->group() does this ... [OVER] shape shape shape OP shape shape shape ... and one option would be an implicit group on 'src' and 'dst' like this ... ([OVER] shape shape shape) OP ([OVER] shape shape shape) ... but another appro

Re: [Rd] Question about grid.group compositing operators in cairo

2022-09-28 Thread Paul Murrell
Hi Would it work to explicitly record a filled-and-stroked shape as two separate elements (one only filled and one only stroked) ? Then it should only be as hard to apply the active operator on both of those elements as it is to apply the active operator to more than one shape (?) Paul On

Re: [Rd] Question about grid.group compositing operators in cairo

2022-09-28 Thread Panagiotis Skintzos
Thank you for the very thorough explanation Paul. To answer your question on 11: The dsvg device, simply defines svg elements with their attributes (rect with fill & stroke in my examples). It does not do any internal image processing like cairo. My concern is how to proceed with the implemen

Re: [Rd] Question about grid.group compositing operators in cairo

2022-09-28 Thread Paul Murrell
Hi Thanks for the code (and for the previous attachments). Some thoughts so far (HTML version with images attached) ... <1> As you have pointed out, the Cairo device draws a stroked-and-filled shape with two separate drawing operations: the path is filled and then the path is stroked. I do

Re: [Rd] Question about grid.group compositing operators in cairo

2022-09-27 Thread Panagiotis Skintzos
Here is the code again in text: src <- rectGrob(2/3, 1/3, width=.6, height=.6, gp=gpar(lwd = 5, fill=rgb(0, 0, 0.9, 0.4))) dst <- rectGrob(1/3, 2/3, width=.6, height=.6, gp=gpar(lwd = 5, fill=rgb(0.7, 0, 0, 0.8))) svg("cairo.in.svg", width = 5, height = 5) grid.group(src, "in", dst) dev.off(

Re: [Rd] Question about grid.group compositing operators in cairo

2022-09-27 Thread Panagiotis Skintzos
Hi, sure I attach the test code and my svg. You can also find my current work on ggiraph in the branch ge15 on github: https://github.com/sigmapi/ggiraph/tree/ge15 Thanks, Panagiotis On 27/9/22 04:44, Paul Murrell wrote: Could you also please send me the SVG code that your device is ge

Re: [Rd] Question about grid.group compositing operators in cairo

2022-09-26 Thread Paul Murrell
Could you also please send me the SVG code that your device is generating for your example. Thanks! Paul On 27/09/22 08:50, Paul Murrell wrote: Hi Thanks for the report.  It certainly sounds like I have done something stupid :)  For my debugging and testing could you please share the R

Re: [Rd] Question about grid.group compositing operators in cairo

2022-09-26 Thread Paul Murrell
Hi Thanks for the report. It certainly sounds like I have done something stupid :) For my debugging and testing could you please share the R code from your tests ? Thanks! Paul On 26/09/22 10:27, Panagiotis Skintzos wrote: Hello, I'm trying to update ggiraph package in graphic engine v1

[Rd] Question about grid.group compositing operators in cairo

2022-09-26 Thread Panagiotis Skintzos
Hello, I'm trying to update ggiraph package in graphic engine v15 (currently we support up to v14). I've implemented the group operators and when I compare the outputs of ggiraph::dsvg with the outputs of svg/png, I noticed some weird results. Specifically, some operators in cairo (in, out,