Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::geode::GeodeResidentImage Struct Reference

One decoded image's pixels on one device, premultiplied in an RGBA8 texture that draws sample across frames. More...

#include "donner/svg/renderer/geode/GeodeResidentImageComponent.h"

Public Member Functions

 GeodeResidentImage (const GeodeResidentImage &)=delete
GeodeResidentImage & operator= (const GeodeResidentImage &)=delete

Static Public Member Functions

static std::uint64_t TextureBytes (int width, int height)
 Bytes of an RGBA8 texture of width x height pixels.

Public Attributes

gpu::Texture texture
 Premultiplied RGBA8 pixels.
std::uint64_t revision {}
 LoadedImageComponent::revision() of the uploaded pixels.
int width {}
 Image width in pixels.
int height {}
 Image height in pixels. Document budget charged for the texture, and the bytes charged: width * height * 4.
std::shared_ptr< GeodeDocumentGeometryBudget > chargedBudget
std::uint64_t chargedBytes {}
 Bytes charged to chargedBudget. Retirement of the context whose device created the texture.
std::weak_ptr< GeodeHandleRetirement > owner

Detailed Description

One decoded image's pixels on one device, premultiplied in an RGBA8 texture that draws sample across frames.

The texture is written once, when it is created, so every draw that names it samples the pixels of the image revision it was uploaded from. Its bytes are charged to the document's resident limit (GeodeDocumentGeometryBudget::reserveImageBytes) for as long as it exists, and its handle is released on the thread of the context that created it.

Member Function Documentation

◆ TextureBytes()

std::uint64_t donner::geode::GeodeResidentImage::TextureBytes ( int width,
int height )
inlinestaticnodiscard

Bytes of an RGBA8 texture of width x height pixels.

Parameters
widthWidth in pixels; positive.
heightHeight in pixels; positive.

The documentation for this struct was generated from the following file: