Is opacity/masking in the plans?
If anyone's working on adding it already, please speak up. :)
image/draw's private drawGlyphOver func could be a good starting point.
Yes we need a clipping path Api. For draw2dimg a MaskPainter can be used so that we can use drawGlyphOver or sth. For opacity we have alpha of RGBA, we can already use opacity.
gofpdf supports already some clipping:
func (f *Fpdf) ClipCircle(x, y, r float64, outline bool)
func (f *Fpdf) ClipEllipse(x, y, rx, ry float64, outline bool)
func (f *Fpdf) ClipEnd()
func (f *Fpdf) ClipPolygon(points []PointType, outline bool)
func (f *Fpdf) ClipRect(x, y, w, h float64, outline bool)
func (f *Fpdf) ClipRoundedRect(x, y, w, h, r float64, outline bool)
func (f *Fpdf) ClipText(x, y float64, txtStr string, outline bool)
http://godoc.org/github.com/jung-kurt/gofpdf
I guess this should be doable, also for different clipping shapes/paths. I can always extend gofpdf if necessary. However I would prefer if first we can complete the low level api before adding new features.
I agree, pdf, ps svg already have clipping capability, I prefer to implement it in draw2dimg before.
I was thinking of a method gc.Clip() that clip a path
Has the low-level API been decided upon yet?
@llgcode the alpha values work to a point, but produce incorrect output when drawing one image over another. (Using draw.DrawMask produces the correct output, so I'll use that for now.)