rive-app / rive-app/rive-runtime

Expose ability to create and render textures from arbitrary RGBA buffers

Open
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
1.2k
Forks
121
PR merge metrics
No merged PRs in 30d

Description

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 ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the public rendering API around RenderContextHelperImpl::makeImageTexture, Factory::decodeImage, and the private RiveRenderPath mentioned in the issue. Trace the renderer.drawPath usage and determine the public API needed for arbitrary RGBA buffers and direct image rendering; done means the required consumer use case no longer depends on inaccessible implementation details.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.