11#include <unordered_map>
27 const LegacyBitmapRGBA8&
source,
46 std::optional<std::array<float, 4>> presentationRect = {},
47 bool preferLinearFiltering =
false);
49 DataId id, std::int32_t
x, std::int32_t
y,
54 std::int32_t
x, std::int32_t
y,
65 {
return static_cast<bool>(
asset(
id)); }
74 bool colourKeyTransparent{};
75 std::uint8_t globalAlpha{255};
76 std::shared_ptr<const BitmapRuntimeAsset>
published;
77 RuntimeBitmapExtent logicalExtent{};
78 std::optional<std::array<float, 4>> presentationRect;
79 bool preferLinearFiltering{};
82 void publish(
DataId id, Surface& surface);
84 std::uint32_t nextTag_{1};
85 std::unordered_map<DataId, Surface> surfaces_;
std::shared_ptr< const data::HmdTextureImage > source
bool contains(DataId id) const noexcept
std::expected< void, std::string > blit(DataId id, const LegacyBitmapRGBA8 &source, std::int32_t x, std::int32_t y, BitmapBlitMode mode=BitmapBlitMode::SourceOver)
std::optional< RuntimeBitmapExtent > extent(DataId id) const noexcept
std::optional< std::uint8_t > globalAlpha(DataId id) const noexcept
std::expected< void, std::string > update(DataId id, LegacyBitmapRGBA8 image, std::optional< std::array< float, 4 > > presentationRect={}, bool preferLinearFiltering=false)
std::expected< void, std::string > setGlobalAlpha(DataId id, std::uint8_t alpha)
std::shared_ptr< const BitmapRuntimeAsset > asset(DataId id) const noexcept
bool remove(DataId id) noexcept
std::size_t size() const noexcept
std::expected< DataId, std::string > create(std::uint32_t width, std::uint32_t height, bool transparent, std::uint8_t globalAlpha=255)
std::expected< void, std::string > fill(DataId id, std::int32_t x, std::int32_t y, std::int32_t width, std::int32_t height, std::uint32_t colorRef)
std::expected< void, std::string > blitStraightRGBA8(LegacyBitmapRGBA8 &destination, const LegacyBitmapRGBA8 &source, std::int32_t destinationX, std::int32_t destinationY, BitmapBlitMode mode)
bool isRuntimeBitmapDataId(DataId id) noexcept
constexpr std::uint16_t RuntimeBitmapGroup