FOnlineImages
Platform images (friend avatars, achievement icons) addressed by a path a UI image widget can name, so a lobby screen or an achievements list binds an avatar the way it binds any texture:
- Module
- Networking
- Header
#include "Networking/OnlineImages.h"- Namespace
Mowo
online://avatar/<Platform>/<userId> online://achievement/<achievementId>
The image decoder the Miri UI host installs asks Resolve for any path with the scheme. A miss starts the platform's download and answers false; the caller asks again after the change callback (EOnlineChangeKind::Avatar) or on its next refresh. Pixels the platform hands over directly (Steam) are cached as RGBA; an image the platform only links to (a Discord avatar URL) is cached encoded and decoded by the host, which owns an image decoder.
Properties
| Type | Name | Description |
|---|---|---|
static constexpr const char* | kScheme | Default "online://". |
Public functions
| Returns | Name | Description |
|---|---|---|
std::string | AvatarPath | |
std::string | AchievementIconPath | |
bool | IsOnlinePath | |
uint64_t | HandleFor | A stable id for the path, for graphs that key a texture by number. |
bool | Resolve | Pixels for the path; false while they have not arrived. |
bool | ResolveEncoded | The compressed bytes of an image the platform delivered as a file (PNG or JPEG), for a decoder. |
void | StoreRgba | Platform side: hand over what arrived. |
void | StoreEncoded | |
bool | IsFetchPending | True once a fetch for the path was started and has not been answered, so a per-frame UI does not start it again. |
void | MarkFetchPending | |
void | Clear |
Function details
AvatarPath
static std::string AvatarPath(const std::string& platform, uint64_t userId)AchievementIconPath
static std::string AchievementIconPath(const std::string& achievementId)IsOnlinePath
static bool IsOnlinePath(const std::string& path)HandleFor
static uint64_t HandleFor(const std::string& path)A stable id for the path, for graphs that key a texture by number.
Resolve
static bool Resolve(const std::string& path, FOnlineImage& outImage)Pixels for the path; false while they have not arrived.
ResolveEncoded
static bool ResolveEncoded(const std::string& path, std::vector<uint8_t>& outBytes)The compressed bytes of an image the platform delivered as a file (PNG or JPEG), for a decoder. False when the path is not cached encoded.
StoreRgba
static void StoreRgba(const std::string& path, FOnlineImage image)Platform side: hand over what arrived. Fires the change callback chain's Avatar kind through the owning service, not from here.
StoreEncoded
static void StoreEncoded(const std::string& path, std::vector<uint8_t> bytes)IsFetchPending
static bool IsFetchPending(const std::string& path)True once a fetch for the path was started and has not been answered, so a per-frame UI does not start it again.
MarkFetchPending
static void MarkFetchPending(const std::string& path)Clear
static void Clear()