Skip to content
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

Expose ability to create and render textures from arbitrary RGBA buffers #28

Open
kunitoki opened this issue Feb 13, 2025 · 0 comments
Open

Comments

@kunitoki
Copy link

I need to be able to render images using the rive renderer but the method:

    virtual rcp<Texture> makeImageTexture(uint32_t width,
                                          uint32_t height,
                                          uint32_t mipLevelCount,
                                          const uint8_t imageDataRGBA[]) = 0;

is protected inside the RenderContextHelperImpl class, making it impossible to reach from a consumer of the rendering api. I already do the image decoding myself and it would be overkill to do it twice using the Factory decodeImage, we would need a new Factory::makeImageTexture for that to work. The same might apply to the fonts, so we are missing Factory::makeFont allowing to pass an arbitrary byte buffer.

Moreover, the class RiveRenderPath is a private implementation detail but it seems it is the only way to achieve image rendering directly, so i cannot compile this code without exposing the class to the headers.

    rive::RiveRenderPaint paint;
    paint.image (image.getTexture(), jlimit (0.0f, 1.0f, options.opacity));
    paint.blendMode (toBlendMode (options.blendMode));
    renderer.drawPath (unitRectPath.get(), &paint);

Any feedback if this could be opened up in the api ?

@kunitoki kunitoki mentioned this issue Feb 13, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant