-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing the rasterx interface #9
Comments
Hi Noofbiz,
Sorry for taking so long to get back to you. I had to do some reconfiguring
on my setup and review some stuff before I could answer intelligently.
I am definitely interested in whatever can make writing to opengl faster
and (hopefully) cleaner. You should take a look at the scanx
<https://github.com/srwiley/scanx> repository
// ImgSpanner is a Spanner that draws Spans onto *xgraphics.Image
// or *image.RGBA image types
// It uses either a color function as a the color source, or a fgColor
// if colFunc is nil.
ImgSpanner struct {
baseSpanner
pix []uint8
stride int
// xgraphics.Images swap r and b pixel values
// compared to saved rgb value.
xpixel bool
colorFunc rasterx.ColorFunc
}
Although this version uses the xgraphics.Image type, which it sounds like
you want to avoid, it also uses my new Scanner interface rather than the
freetype Paint interface. This avoids the spans being pushed into a slice
before being sent to the image buffer. Instead the receiving interface gets
the data directly, and is somewhat faster.
I hope this helps. I would be happy to follow what you are doing in this
regard.
best wishes,
srwiley
…On Sat, Jul 11, 2020 at 6:08 PM Noofbiz ***@***.***> wrote:
Hello! I want to be able to render svgs directly to, say, an opengl
framebuffer rather than an image.Image. I've actually already got the
engine and framework and shaders needed, and It seems to me that a lot of
the types in this package could be interfaces, which could then allow me to
implement them to allow me to do just that. Is that a direction you'd be
willing to take? I'll put together the PR and write it myself, I'm just
wondering if you had any tips or ideas on going about it. Thanks!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#9>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC4VOB67GQFS3DTOAPATXR3R3EEI5ANCNFSM4OXRZNMQ>
.
|
That looks like exactly what I need. I'm working on adding svg support to engo. I am currently using rasterx to get images then upload them like pngs or jpgs. But I really want to keep all the parts of the svg separate to support things like dragon bones like animations and motion tweening. So instead of uploading svgs to the GPU as textures, I want to keep them as shapes, curves, etc. |
related to srwiley/oksvg#22 |
Hello! I want to be able to render svgs directly to, say, an opengl framebuffer rather than an image.Image. I've actually already got the engine and framework and shaders needed, and It seems to me that a lot of the types in this package could be interfaces, which could then allow me to implement them to allow me to do just that. Is that a direction you'd be willing to take? I'll put together the PR and write it myself, I'm just wondering if you had any tips or ideas on going about it. Thanks!
The text was updated successfully, but these errors were encountered: