// DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/cpp/mod.rs
// Based on "crates/store/re_types/definitions/rerun/blueprint/archetypes/tensor_view_fit.fbs".

#pragma once

#include "../../blueprint/components/view_fit.hpp"
#include "../../collection.hpp"
#include "../../compiler_utils.hpp"
#include "../../component_batch.hpp"
#include "../../indicator_component.hpp"
#include "../../result.hpp"

#include <cstdint>
#include <optional>
#include <utility>
#include <vector>

namespace rerun::blueprint::archetypes {
    /// **Archetype**: Configures how a selected tensor slice is shown on screen.
    struct TensorViewFit {
        /// How the image is scaled to fit the view.
        std::optional<rerun::blueprint::components::ViewFit> scaling;

      public:
        static constexpr const char IndicatorComponentName[] =
            "rerun.blueprint.components.TensorViewFitIndicator";

        /// Indicator component, used to identify the archetype when converting to a list of components.
        using IndicatorComponent = rerun::components::IndicatorComponent<IndicatorComponentName>;

      public:
        TensorViewFit() = default;
        TensorViewFit(TensorViewFit&& other) = default;

        /// How the image is scaled to fit the view.
        TensorViewFit with_scaling(rerun::blueprint::components::ViewFit _scaling) && {
            scaling = std::move(_scaling);
            // See: https://github.com/rerun-io/rerun/issues/4027
            RR_WITH_MAYBE_UNINITIALIZED_DISABLED(return std::move(*this);)
        }
    };

} // namespace rerun::blueprint::archetypes

namespace rerun {
    /// \private
    template <typename T>
    struct AsComponents;

    /// \private
    template <>
    struct AsComponents<blueprint::archetypes::TensorViewFit> {
        /// Serialize all set component batches.
        static Result<std::vector<ComponentBatch>> serialize(
            const blueprint::archetypes::TensorViewFit& archetype
        );
    };
} // namespace rerun
