6#include "../collection.hpp"
7#include "../compiler_utils.hpp"
8#include "../component_batch.hpp"
9#include "../components/blob.hpp"
10#include "../components/draw_order.hpp"
11#include "../components/media_type.hpp"
12#include "../components/opacity.hpp"
13#include "../indicator_component.hpp"
14#include "../result.hpp"
66 std::optional<rerun::components::Opacity>
opacity;
74 static constexpr const char IndicatorComponentName[] =
75 "rerun.components.EncodedImageIndicator";
90 std::optional<rerun::components::MediaType>
media_type = {}
93 image.
blob = image_contents;
98 static std::optional<rerun::components::MediaType> guess_media_type(
99 const std::filesystem::path& path
119 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
128 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
137 RR_WITH_MAYBE_UNINITIALIZED_DISABLED(
return std::move(*
this);)
145 template <
typename T>
150 struct AsComponents<archetypes::EncodedImage> {
152 static Result<std::vector<ComponentBatch>> serialize(
153 const archetypes::EncodedImage& archetype
Generic collection of elements that are roughly contiguous in memory.
Definition collection.hpp:49
A class for representing either a usable value, or an error.
Definition result.hpp:14
All built-in archetypes. See Types in the Rerun manual.
Definition rerun.hpp:72
All Rerun C++ types and functions are in the rerun namespace or one of its nested namespaces.
Definition rerun.hpp:22
Archetype: An image encoded as e.g.
Definition encoded_image.hpp:49
static Result< EncodedImage > from_file(const std::filesystem::path &filepath)
Create a new EncodedImage from the contents of a file on disk, e.g. a PNG or JPEG.
EncodedImage with_opacity(rerun::components::Opacity _opacity) &&
Opacity of the image, useful for layering several images.
Definition encoded_image.hpp:125
std::optional< rerun::components::MediaType > media_type
The Media Type of the asset.
Definition encoded_image.hpp:61
std::optional< rerun::components::DrawOrder > draw_order
An optional floating point value that specifies the 2D drawing order.
Definition encoded_image.hpp:71
EncodedImage with_media_type(rerun::components::MediaType _media_type) &&
The Media Type of the asset.
Definition encoded_image.hpp:116
EncodedImage with_draw_order(rerun::components::DrawOrder _draw_order) &&
An optional floating point value that specifies the 2D drawing order.
Definition encoded_image.hpp:134
rerun::components::Blob blob
The encoded content of some image file, e.g. a PNG or JPEG.
Definition encoded_image.hpp:51
static EncodedImage from_bytes(rerun::Collection< uint8_t > image_contents, std::optional< rerun::components::MediaType > media_type={})
Create a new EncodedImage from the contents of an image file, like a PNG or JPEG.
Definition encoded_image.hpp:88
std::optional< rerun::components::Opacity > opacity
Opacity of the image, useful for layering several images.
Definition encoded_image.hpp:66
Component: A binary blob of data.
Definition blob.hpp:16
Component: Draw order of 2D elements.
Definition draw_order.hpp:19
Indicator component used by archetypes when converting them to component lists.
Definition indicator_component.hpp:30
Component: Degree of transparency ranging from 0.0 (fully transparent) to 1.0 (fully opaque).
Definition opacity.hpp:17