Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::components::LoadedImageComponent Struct Reference

Loaded raster image resource, created from a ImageComponent when the href references a raster image (PNG, JPEG, GIF). More...

#include "donner/svg/components/resources/ImageComponent.h"

Public Member Functions

 LoadedImageComponent (ImageResource loadedImage, std::shared_ptr< DecodedImageReservation > reservation=nullptr)
 Store a decoded image with a fresh revision for cache invalidation.
 ~LoadedImageComponent ()
 Destroy pixel storage while its reservation is still held.
 LoadedImageComponent (const LoadedImageComponent &other)
 Copy pixels only after reserving independent storage; refused copies contain no image.
LoadedImageComponent & operator= (const LoadedImageComponent &other)
 Replace the image with a separately budgeted copy.
 LoadedImageComponent (LoadedImageComponent &&other) noexcept=default
 Transfer pixels and their reservation without an additional charge.
LoadedImageComponent & operator= (LoadedImageComponent &&other) noexcept=default
 Replace pixels by transferring their existing reservation.
std::uint64_t revision () const
 Monotonic identity for the current decoded image payload.
void markImageModified ()
 Mark a direct mutation of the decoded image payload.

Public Attributes

std::optional< ImageResource > image
 Loaded image resource.

Detailed Description

Loaded raster image resource, created from a ImageComponent when the href references a raster image (PNG, JPEG, GIF).

Constructor & Destructor Documentation

◆ LoadedImageComponent() [1/3]

donner::svg::components::LoadedImageComponent::LoadedImageComponent ( ImageResource loadedImage,
std::shared_ptr< DecodedImageReservation > reservation = nullptr )
inlineexplicit

Store a decoded image with a fresh revision for cache invalidation.

Parameters
loadedImageDecoded image payload to own.
reservationOptional shared-family reservation acquired before decoding.

◆ LoadedImageComponent() [2/3]

donner::svg::components::LoadedImageComponent::LoadedImageComponent ( const LoadedImageComponent & other)
inline

Copy pixels only after reserving independent storage; refused copies contain no image.

Parameters
otherImage to copy, including its existing family-budget policy.

◆ LoadedImageComponent() [3/3]

donner::svg::components::LoadedImageComponent::LoadedImageComponent ( LoadedImageComponent && other)
defaultnoexcept

Transfer pixels and their reservation without an additional charge.

Parameters
otherImage whose storage is transferred.

Member Function Documentation

◆ operator=() [1/2]

LoadedImageComponent & donner::svg::components::LoadedImageComponent::operator= ( const LoadedImageComponent & other)
inline

Replace the image with a separately budgeted copy.

Parameters
otherImage to copy.

◆ operator=() [2/2]

LoadedImageComponent & donner::svg::components::LoadedImageComponent::operator= ( LoadedImageComponent && other)
defaultnoexcept

Replace pixels by transferring their existing reservation.

Parameters
otherImage whose storage is transferred.

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